Apollo  6.0
Open source self driving car software
target.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 <memory>
19 #include <vector>
20 
21 #include <boost/circular_buffer.hpp>
22 
27 #include "modules/perception/camera/lib/obstacle/tracker/omt/proto/omt.pb.h"
29 
30 namespace apollo {
31 namespace perception {
32 namespace camera {
33 
34 struct alignas(16) Target {
35  public:
36  // EIGEN_MAKE_ALIGNED_OPERATOR_NEW
37  explicit Target(const omt::TargetParam &param);
38  void Init(const omt::TargetParam &param);
39  void Add(TrackObjectPtr object);
40 
41  void RemoveOld(int frame_id);
42 
43  void Clear();
44 
45  void Predict(CameraFrame *frame);
46 
47  void Update2D(CameraFrame *frame);
48 
49  void Update3D(CameraFrame *frame);
50 
51  void UpdateType(CameraFrame *frame);
52 
53  int Size() const;
54  TrackObjectPtr get_object(int index) const;
55  TrackObjectPtr operator[](int index) const;
56 
57  bool isTracked() const;
58  bool isLost() const;
59 
60  public:
61  int lost_age = 0;
62  int id = 0;
63  double start_ts = 0.0;
69 
70  // constant position kalman state
72 
73  // displacement theta
75 
79  std::vector<float> type_probs;
80  omt::TargetParam target_param_;
81 
84 
86 
87  private:
88  static int global_track_id;
89  // clapping unreasonable velocities by strategy
90  void ClappingTrackVelocity(const base::ObjectPtr &obj);
91  bool CheckStatic();
92 
93  boost::circular_buffer<std::shared_ptr<base::Object>> history_world_states_;
94 
95  protected:
97 };
98 } // namespace camera
99 } // namespace perception
100 } // namespace apollo
MaxNMeanFilter world_lwh
Definition: target.h:76
TrackObjectPtr get_object(int index) const
MeanFilter displacement_theta
Definition: target.h:74
MeanFilter world_velocity
Definition: target.h:78
Definition: camera_frame.h:33
FirstOrderRCLowPassFilter direction
Definition: target.h:64
KalmanFilterConstVelocity image_center
Definition: target.h:83
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
omt::TargetParam target_param_
Definition: target.h:80
void Init(const omt::TargetParam &param)
std::vector< float > type_probs
Definition: target.h:79
Definition: kalman_filter.h:152
double start_ts
Definition: target.h:63
FirstOrderRCLowPassFilter image_wh
Definition: target.h:82
std::shared_ptr< TrackObject > TrackObjectPtr
Definition: track_object.h:34
MeanFilter world_center_for_unmovable
Definition: target.h:68
std::vector< TrackObjectPtr > TrackObjectPtrs
Definition: track_object.h:35
int lost_age
Definition: target.h:61
KalmanFilterConstState< 2 > world_center_const
Definition: target.h:71
Target(const omt::TargetParam &param)
Definition: object_template_manager.h:49
TrackObjectPtr operator[](int index) const
Definition: target.h:34
Definition: kalman_filter.h:171
base::ObjectSubType type
Definition: target.h:66
TrackObjectPtr latest_object
Definition: target.h:65
ObjectTemplateManager * object_template_manager_
Definition: target.h:96
void Predict(CameraFrame *frame)
void Update3D(CameraFrame *frame)
TrackObjectPtrs tracked_objects
Definition: target.h:85
void Update2D(CameraFrame *frame)
MeanFilter world_lwh_for_unmovable
Definition: target.h:77
KalmanFilterConstVelocity world_center
Definition: target.h:67
ObjectSubType
Definition: object_types.h:63
void Add(TrackObjectPtr object)
void UpdateType(CameraFrame *frame)
std::shared_ptr< Object > ObjectPtr
Definition: object.h:123