Apollo 10.0
自动驾驶开放平台
camera_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"
25
26namespace apollo {
27namespace perception {
28namespace camera {
29
31 public:
38 CameraTrack(const base::ObjectPtr &obs, const double timestamp);
40
47 void UpdataObsCamera(const base::ObjectPtr &obs_camera,
48 const double timestamp);
49
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
105 bool IsAssigned() { return is_assigned_; }
106
107 void SetUnAssigned() { is_assigned_ = false; }
108
116 bool ConfirmTrack() { return tracked_times_ > s_tracked_times_threshold_; }
117
123 static void SetTrackedTimesThreshold(const int &threshold) {
124 s_tracked_times_threshold_ = threshold;
125 }
126
132 static void SetChosenFilter(const std::string &chosen_filter) {
133 s_chosen_filter_ = chosen_filter;
134 }
135
141 static void SetUseFilter(bool use_filter) { s_use_filter_ = use_filter; }
142
143 private:
144 double timestamp_ = 0.0;
145 int obs_id_ = 0;
146 int tracked_times_ = 0;
147 double tracking_time_ = 0.0;
148 bool is_dead_ = false;
149 bool is_assigned_ = false;
150 base::ObjectPtr obs_camera_ = nullptr; // observasion from Camera
151 base::ObjectPtr obs_ = nullptr; // track result after tracking
152 std::shared_ptr<BaseFilter> filter_ = nullptr;
153
154 static std::string s_chosen_filter_;
155 static int s_current_idx_;
156 static int s_tracked_times_threshold_;
157 static bool s_use_filter_;
158
160};
161
162typedef std::shared_ptr<CameraTrack> CameraTrackPtr;
163
164} // namespace camera
165} // namespace perception
166} // namespace apollo
double GetTimestamp()
Get the Timestamp object
base::ObjectPtr GetObs()
Get the Obs object
bool IsDead()
Track state is dead or not
void SetDead()
Set the Dead object
double GetTrackingTime()
Get the Tracking Time object
base::ObjectPtr GetObsCamera()
Get the Obs Camera object
bool ConfirmTrack()
If the target tracking time is greater than the set threshold, which means that the target has been t...
static void SetChosenFilter(const std::string &chosen_filter)
Set the Chosen Filter object
static void SetTrackedTimesThreshold(const int &threshold)
Set the Tracked Times Threshold object
void UpdataObsCamera(const base::ObjectPtr &obs_camera, const double timestamp)
update the object after association with a Camera obervation
static void SetUseFilter(bool use_filter)
Set the Use Filter object
int GetObsId() const
Get the Obs Id object
void SetObsCameraNullptr()
Set the Obs Camera Nullptr object
#define DISALLOW_COPY_AND_ASSIGN(classname)
Definition macros.h:48
std::shared_ptr< Object > ObjectPtr
Definition object.h:127
std::shared_ptr< CameraTrack > CameraTrackPtr
class register implement
Definition arena_queue.h:37