Apollo 10.0
自动驾驶开放平台
target.h
浏览该文件的文档.
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 <memory>
19#include <vector>
20
21#include <boost/circular_buffer.hpp>
22
23#include "modules/perception/camera_tracking/proto/omt.pb.h"
24
30
31namespace apollo {
32namespace perception {
33namespace camera {
34
35struct alignas(16) Target {
36 public:
37 // EIGEN_MAKE_ALIGNED_OPERATOR_NEW
38 explicit Target(const TargetParam &param);
44 void Init(const TargetParam &param);
50 void Add(TrackObjectPtr object);
51
57 void RemoveOld(int frame_id);
58
62 void Clear();
63
69 void Predict(CameraTrackingFrame *frame);
70
76 void Update(CameraTrackingFrame *frame);
77
83 void Update2D(CameraTrackingFrame *frame);
84
90 void Update3D(CameraTrackingFrame *frame);
91
98
104 int Size() const;
105
112 TrackObjectPtr get_object(int index) const;
113 TrackObjectPtr operator[](int index) const;
114
121 bool isTracked() const;
122
129 bool isLost() const;
130
131 public:
132 int lost_age = 0;
133 int id = 0;
134 double start_ts = 0.0;
140
141 // constant position kalman state
143
144 // displacement theta
146
150 std::vector<float> type_probs;
152
155
157
158 private:
159 static int global_track_id;
160 // clapping unreasonable velocities by strategy
161 void ClappingTrackVelocity(const base::ObjectPtr &obj);
162 bool CheckStatic();
163
164 boost::circular_buffer<std::shared_ptr<base::Object>> history_world_states_;
165
166 protected:
168};
169} // namespace camera
170} // namespace perception
171} // namespace apollo
std::shared_ptr< Object > ObjectPtr
Definition object.h:127
std::vector< TrackObjectPtr > TrackObjectPtrs
std::shared_ptr< TrackObject > TrackObjectPtr
class register implement
Definition arena_queue.h:37
TrackObjectPtr operator[](int index) const
Definition target.cc:35
void Clear()
clear tracked_objects
Definition target.cc:33
int Size() const
return the size of tracked_objects
Definition target.cc:31
bool isLost() const
return whether the target is lost
Definition target.cc:516
base::ObjectSubType type
Definition target.h:137
void Add(TrackObjectPtr object)
add object to tracked_objects
Definition target.cc:43
void Update3D(CameraTrackingFrame *frame)
update 3d
Definition target.cc:161
bool isTracked() const
return whether the target is tracked
Definition target.cc:513
void Update2D(CameraTrackingFrame *frame)
update 2d
Definition target.cc:130
void Update(CameraTrackingFrame *frame)
using kalman filter to correct the tracked_objects todo(zero): update world in bev
Definition target.cc:309
KalmanFilterConstVelocity image_center
Definition target.h:154
ObjectTemplateManager * object_template_manager_
Definition target.h:167
KalmanFilterConstVelocity world_center
Definition target.h:138
KalmanFilterConstState< 2 > world_center_const
Definition target.h:142
void RemoveOld(int frame_id)
remove objects older than frame_id
Definition target.cc:56
TrackObjectPtr get_object(int index) const
Get the object accoding to index
Definition target.cc:36
std::vector< float > type_probs
Definition target.h:150
FirstOrderRCLowPassFilter image_wh
Definition target.h:153
FirstOrderRCLowPassFilter direction
Definition target.h:135
TrackObjectPtrs tracked_objects
Definition target.h:156
void UpdateType(CameraTrackingFrame *frame)
update type
Definition target.cc:333
void Init(const TargetParam &param)
init Target
Definition target.cc:65