Apollo  6.0
Open source self driving car software
base_obstacle_tracker.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2018 The Apollo Authors. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *****************************************************************************/
16 #pragma once
17 
18 #include <string>
19 
23 
24 namespace apollo {
25 namespace perception {
26 namespace camera {
27 
29  float image_width;
30  float image_height;
31 };
32 
34 
36  public:
37  BaseObstacleTracker() = default;
38 
39  virtual ~BaseObstacleTracker() = default;
40 
41  virtual bool Init(const ObstacleTrackerInitOptions& options =
43 
44  // @brief: predict candidate obstales in the new image.
45  // @param [in]: options
46  // @param [in/out]: frame
47  // candidate obstacle 2D boxes should be filled, required.
48  virtual bool Predict(const ObstacleTrackerOptions& options,
49  CameraFrame* frame) = 0;
50 
51  // @brief: associate obstales by 2D information.
52  // @param [in]: options
53  // @param [in/out]: frame
54  // associated obstacles with tracking id should be filled, required,
55  // smoothed 2D&3D information can be filled, optional.
56  virtual bool Associate2D(const ObstacleTrackerOptions& options,
57  CameraFrame* frame) = 0;
58 
59  // @brief: associate obstales by 3D information.
60  // @param [in]: options
61  // @param [in/out]: frame
62  // associated obstacles with tracking id should be filled, required,
63  // smoothed 3D information can be filled, optional.
64  virtual bool Associate3D(const ObstacleTrackerOptions& options,
65  CameraFrame* frame) = 0;
66 
67  // @brief: track detected obstacles.
68  // @param [in]: options
69  // @param [in/out]: frame
70  // associated obstacles with tracking id should be filled, required,
71  // motion information of obstacles should be filled, required.
72  virtual bool Track(const ObstacleTrackerOptions& options,
73  CameraFrame* frame) = 0;
74 
75  virtual std::string Name() const = 0;
76 
78  BaseObstacleTracker& operator=(const BaseObstacleTracker&) = delete;
79 }; // class BaseObstacleTracker
80 
82 #define REGISTER_OBSTACLE_TRACKER(name) \
83  PERCEPTION_REGISTER_CLASS(BaseObstacleTracker, name)
84 
85 } // namespace camera
86 } // namespace perception
87 } // namespace apollo
PERCEPTION_REGISTER_REGISTERER(BaseCalibrationService)
Definition: base_init_options.h:24
Definition: camera_frame.h:33
Definition: base_obstacle_tracker.h:33
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
float image_width
Definition: base_obstacle_tracker.h:29
float image_height
Definition: base_obstacle_tracker.h:30
bool Init(const char *binary_name)
Definition: base_obstacle_tracker.h:35
Definition: base_obstacle_tracker.h:28