Apollo 11.0
自动驾驶开放平台
radar_track.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 <string>
20
21#include "cyber/common/macros.h"
26
27namespace apollo {
28namespace perception {
29namespace radar {
30
32 public:
39 RadarTrack(const base::ObjectPtr &obs, const double timestamp);
41
48 void UpdataObsRadar(const base::ObjectPtr &obs_radar, const double timestamp);
49
54 void SetObsRadarNullptr();
55
61 int GetObsId() const;
62
69
76
82 double GetTimestamp();
83
89 double GetTrackingTime();
90
97 bool IsDead() { return is_dead_; }
98
103 void SetDead() { is_dead_ = true; }
104
112 bool ConfirmTrack() { return tracked_times_ > s_tracked_times_threshold_; }
113
119 static void SetTrackedTimesThreshold(const int &threshold) {
120 s_tracked_times_threshold_ = threshold;
121 }
122
128 static void SetChosenFilter(const std::string &chosen_filter) {
129 s_chosen_filter_ = chosen_filter;
130 }
131
137 static void SetUseFilter(bool use_filter) { s_use_filter_ = use_filter; }
138
139 private:
140 double timestamp_ = 0.0;
141 int obs_id_ = 0;
142 int tracked_times_ = 0;
143 double tracking_time_ = 0.0;
144 bool is_dead_ = false;
145 base::ObjectPtr obs_radar_ = nullptr; // observasion from radar
146 base::ObjectPtr obs_ = nullptr; // track result after tracking
147 std::shared_ptr<BaseFilter> filter_ = nullptr;
148
149 static std::string s_chosen_filter_;
150 static int s_current_idx_;
151 static int s_tracked_times_threshold_;
152 static bool s_use_filter_;
153
155};
156
157typedef std::shared_ptr<RadarTrack> RadarTrackPtr;
158
159} // namespace radar
160} // namespace perception
161} // namespace apollo
bool ConfirmTrack()
If the target tracking time is greater than the set threshold, which means that the target has been t...
void SetObsRadarNullptr()
Set the Obs Radar Nullptr object
double GetTimestamp()
Get the Timestamp object
static void SetChosenFilter(const std::string &chosen_filter)
Set the Chosen Filter object
base::ObjectPtr GetObs()
Get the Obs object
bool IsDead()
Track state is dead or not
Definition radar_track.h:97
void SetDead()
Set the Dead object
int GetObsId() const
Get the Obs Id object
static void SetUseFilter(bool use_filter)
Set the Use Filter object
double GetTrackingTime()
Get the Tracking Time object
base::ObjectPtr GetObsRadar()
Get the Obs Radar object
static void SetTrackedTimesThreshold(const int &threshold)
Set the Tracked Times Threshold object
void UpdataObsRadar(const base::ObjectPtr &obs_radar, const double timestamp)
update the object after association with a radar obervation
#define DISALLOW_COPY_AND_ASSIGN(classname)
Definition macros.h:48
std::shared_ptr< Object > ObjectPtr
Definition object.h:127
std::shared_ptr< RadarTrack > RadarTrackPtr
class register implement
Definition arena_queue.h:37