Apollo 10.0
自动驾驶开放平台
apollo::perception::camera::CameraTrack类 参考

#include <camera_track.h>

apollo::perception::camera::CameraTrack 的协作图:

Public 成员函数

 CameraTrack (const base::ObjectPtr &obs, const double timestamp)
 Construct a new Camera Track object
 
 ~CameraTrack ()
 
void UpdataObsCamera (const base::ObjectPtr &obs_camera, const double timestamp)
 update the object after association with a Camera obervation
 
void SetObsCameraNullptr ()
 Set the Obs Camera Nullptr object
 
int GetObsId () const
 Get the Obs Id object
 
base::ObjectPtr GetObsCamera ()
 Get the Obs Camera object
 
base::ObjectPtr GetObs ()
 Get the Obs object
 
double GetTimestamp ()
 Get the Timestamp object
 
double GetTrackingTime ()
 Get the Tracking Time object
 
bool IsDead ()
 Track state is dead or not
 
void SetDead ()
 Set the Dead object
 
bool IsAssigned ()
 
void SetUnAssigned ()
 
bool ConfirmTrack ()
 If the target tracking time is greater than the set threshold, which means that the target has been tracked.
 

静态 Public 成员函数

static void SetTrackedTimesThreshold (const int &threshold)
 Set the Tracked Times Threshold object
 
static void SetChosenFilter (const std::string &chosen_filter)
 Set the Chosen Filter object
 
static void SetUseFilter (bool use_filter)
 Set the Use Filter object
 

详细描述

在文件 camera_track.h30 行定义.

构造及析构函数说明

◆ CameraTrack()

apollo::perception::camera::CameraTrack::CameraTrack ( const base::ObjectPtr obs,
const double  timestamp 
)

Construct a new Camera Track object

参数
obs
timestamp

在文件 camera_track.cc32 行定义.

32 {
33 s_current_idx_ %= MAX_CAMERA_IDX;
34 obs_id_ = s_current_idx_++;
35 obs_camera_ = base::ObjectPool::Instance().Get();
36 *obs_camera_ = *obs;
37 obs_ = base::ObjectPool::Instance().Get();
38 *obs_ = *obs;
39 timestamp_ = timestamp;
40 tracked_times_ = 1;
41 tracking_time_ = 0.0;
42 is_dead_ = false;
43 is_assigned_ = false;
44
45 // Or use register class instead.
46 filter_.reset(new AdaptiveKalmanFilter);
47 filter_->Init(*obs);
48}

◆ ~CameraTrack()

apollo::perception::camera::CameraTrack::~CameraTrack ( )
inline

在文件 camera_track.h39 行定义.

39{}

成员函数说明

◆ ConfirmTrack()

bool apollo::perception::camera::CameraTrack::ConfirmTrack ( )
inline

If the target tracking time is greater than the set threshold, which means that the target has been tracked.

返回
true
false

在文件 camera_track.h116 行定义.

116{ return tracked_times_ > s_tracked_times_threshold_; }

◆ GetObs()

base::ObjectPtr apollo::perception::camera::CameraTrack::GetObs ( )

Get the Obs object

返回
base::ObjectPtr

在文件 camera_track.cc81 行定义.

81{ return obs_; }

◆ GetObsCamera()

base::ObjectPtr apollo::perception::camera::CameraTrack::GetObsCamera ( )

Get the Obs Camera object

返回
base::ObjectPtr

在文件 camera_track.cc79 行定义.

79{ return obs_camera_; }

◆ GetObsId()

int apollo::perception::camera::CameraTrack::GetObsId ( ) const

Get the Obs Id object

返回
int

在文件 camera_track.cc83 行定义.

83{ return obs_id_; }

◆ GetTimestamp()

double apollo::perception::camera::CameraTrack::GetTimestamp ( )

Get the Timestamp object

返回
double

在文件 camera_track.cc85 行定义.

85{ return timestamp_; }

◆ GetTrackingTime()

double apollo::perception::camera::CameraTrack::GetTrackingTime ( )

Get the Tracking Time object

返回
double

在文件 camera_track.cc87 行定义.

87{ return tracking_time_; }

◆ IsAssigned()

bool apollo::perception::camera::CameraTrack::IsAssigned ( )
inline

在文件 camera_track.h105 行定义.

105{ return is_assigned_; }

◆ IsDead()

bool apollo::perception::camera::CameraTrack::IsDead ( )
inline

Track state is dead or not

返回
true
false

在文件 camera_track.h97 行定义.

97{ return is_dead_; }

◆ SetChosenFilter()

static void apollo::perception::camera::CameraTrack::SetChosenFilter ( const std::string &  chosen_filter)
inlinestatic

Set the Chosen Filter object

参数
chosen_filter

在文件 camera_track.h132 行定义.

132 {
133 s_chosen_filter_ = chosen_filter;
134 }

◆ SetDead()

void apollo::perception::camera::CameraTrack::SetDead ( )
inline

Set the Dead object

在文件 camera_track.h103 行定义.

103{ is_dead_ = true; }

◆ SetObsCameraNullptr()

void apollo::perception::camera::CameraTrack::SetObsCameraNullptr ( )

Set the Obs Camera Nullptr object

在文件 camera_track.cc74 行定义.

74 {
75 obs_camera_ = nullptr;
76 obs_ = nullptr;
77}

◆ SetTrackedTimesThreshold()

static void apollo::perception::camera::CameraTrack::SetTrackedTimesThreshold ( const int &  threshold)
inlinestatic

Set the Tracked Times Threshold object

参数
threshold

在文件 camera_track.h123 行定义.

123 {
124 s_tracked_times_threshold_ = threshold;
125 }

◆ SetUnAssigned()

void apollo::perception::camera::CameraTrack::SetUnAssigned ( )
inline

在文件 camera_track.h107 行定义.

107{ is_assigned_ = false; }

◆ SetUseFilter()

static void apollo::perception::camera::CameraTrack::SetUseFilter ( bool  use_filter)
inlinestatic

Set the Use Filter object

参数
use_filter

在文件 camera_track.h141 行定义.

141{ s_use_filter_ = use_filter; }

◆ UpdataObsCamera()

void apollo::perception::camera::CameraTrack::UpdataObsCamera ( const base::ObjectPtr obs_camera,
const double  timestamp 
)

update the object after association with a Camera obervation

参数
obs_camera
timestamp

在文件 camera_track.cc50 行定义.

51 {
52 *obs_camera_ = *obs_camera;
53 *obs_ = *obs_camera;
54 double time_diff = timestamp - timestamp_;
55 if (s_use_filter_) {
56 Eigen::VectorXd state;
57 state = filter_->UpdateWithObject(*obs_camera_, time_diff);
58 obs_->center(0) = static_cast<float>(state(0));
59 obs_->center(1) = static_cast<float>(state(1));
60 obs_->velocity(0) = static_cast<float>(state(2));
61 obs_->velocity(1) = static_cast<float>(state(3));
62 Eigen::Matrix4d covariance_matrix = filter_->GetCovarianceMatrix();
63 obs_->center_uncertainty(0) = static_cast<float>(covariance_matrix(0, 0));
64 obs_->center_uncertainty(1) = static_cast<float>(covariance_matrix(1, 1));
65 obs_->velocity_uncertainty(0) = static_cast<float>(covariance_matrix(2, 2));
66 obs_->velocity_uncertainty(1) = static_cast<float>(covariance_matrix(3, 3));
67 }
68 tracking_time_ += time_diff;
69 timestamp_ = timestamp;
70 ++tracked_times_;
71 is_assigned_ = true;
72}

该类的文档由以下文件生成: