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