Apollo 10.0
自动驾驶开放平台
base_obstacle_tracker.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2023 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 <memory>
19#include <string>
20
21#include "cyber/common/macros.h"
25
26namespace apollo {
27namespace perception {
28namespace camera {
29
34
36
38 public:
40
41 virtual ~BaseObstacleTracker() = default;
42
43 virtual bool Init(const ObstacleTrackerInitOptions& options =
45
46 // @brief: image feature extract.
47 // @param [in/out]: frame
48 virtual bool FeatureExtract(CameraTrackingFrame* frame) = 0;
49
50 // @brief: predict candidate obstales in the new image.
51 // @param [in/out]: frame
52 // candidate obstacle 2D boxes should be filled, required.
53 virtual bool Predict(CameraTrackingFrame* frame) = 0;
54
55 // @brief: calculate similarity of two objects.
56 // @param [in/out]: frame
57 // virtual bool CalSimilarity(CameraTrackingFrame* frame) = 0;
58
59 // @brief: associate obstales by 2D&3D information.
60 // @param [in]: options
61 // @param [in/out]: frame
62 // virtual bool Associate(const ObstacleTrackerOptions &options,
63 // CameraTrackingFrame *frame) = 0;
64
65 // @brief: associate obstales by 2D information.
66 // @param [in/out]: frame
67 // associated obstacles with tracking id should be filled, required,
68 // smoothed 2D&3D information can be filled, optional.
69 virtual bool Associate2D(std::shared_ptr<CameraTrackingFrame> frame) = 0;
70
71 // @brief: associate obstales by 3D information.
72 // @param [in/out]: frame
73 // associated obstacles with tracking id should be filled, required,
74 // smoothed 3D information can be filled, optional.
75 virtual bool Associate3D(std::shared_ptr<CameraTrackingFrame> frame) = 0;
76
77 // todo(wxt): use CameraTrackingFrame or custom object
78 // virtual bool Process(const ObstacleTrackerInitOptions& options,
79 // CameraTrackingFrame* camera_frame) = 0;
80 virtual bool Process(std::shared_ptr<CameraTrackingFrame> camera_frame) = 0;
81
83}; // class BaseObstacleTracker
84
86#define REGISTER_OBSTACLE_TRACKER(name) \
87 PERCEPTION_REGISTER_CLASS(BaseObstacleTracker, name)
88
89} // namespace camera
90} // namespace perception
91} // namespace apollo
virtual bool Init(const ObstacleTrackerInitOptions &options=ObstacleTrackerInitOptions())=0
virtual bool FeatureExtract(CameraTrackingFrame *frame)=0
virtual bool Associate2D(std::shared_ptr< CameraTrackingFrame > frame)=0
virtual bool Process(std::shared_ptr< CameraTrackingFrame > camera_frame)=0
virtual bool Predict(CameraTrackingFrame *frame)=0
virtual bool Associate3D(std::shared_ptr< CameraTrackingFrame > frame)=0
class register implement
Definition arena_queue.h:37
#define PERCEPTION_REGISTER_REGISTERER(base_class)
Definition registerer.h:92