Apollo 11.0
自动驾驶开放平台
apollo::perception::fusion::DstExistenceFusion类 参考

#include <dst_existence_fusion.h>

类 apollo::perception::fusion::DstExistenceFusion 继承关系图:
apollo::perception::fusion::DstExistenceFusion 的协作图:

Public 成员函数

 DstExistenceFusion (TrackPtr track)
 
 ~DstExistenceFusion ()=default
 
void UpdateWithMeasurement (const SensorObjectPtr measurement, double target_timestamp, double match_dist) override
 update track existence state with measurement
 
void UpdateWithoutMeasurement (const std::string &sensor_id, double measurement_timestamp, double target_timestamp, double min_match_dist) override
 update track state without measurement
 
std::string Name () const
 
double GetToicScore () const
 Get toic score
 
double GetExistenceProbability () const
 Get existence probability
 
- Public 成员函数 继承自 apollo::perception::fusion::BaseExistenceFusion
 BaseExistenceFusion (TrackPtr track)
 
virtual ~BaseExistenceFusion ()=default
 

静态 Public 成员函数

static bool Init (const ExistenceFusionInitOptions &options)
 add dst application
 
- 静态 Public 成员函数 继承自 apollo::perception::fusion::BaseExistenceFusion
static bool Init (const ExistenceFusionInitOptions &options)
 Init base existence fusion config
 

额外继承的成员函数

- Protected 成员函数 继承自 apollo::perception::fusion::BaseExistenceFusion
 DISALLOW_COPY_AND_ASSIGN (BaseExistenceFusion)
 
- Protected 属性 继承自 apollo::perception::fusion::BaseExistenceFusion
TrackPtr track_ref_ = nullptr
 

详细描述

在文件 dst_existence_fusion.h 第 52 行定义.

构造及析构函数说明

◆ DstExistenceFusion()

apollo::perception::fusion::DstExistenceFusion::DstExistenceFusion ( TrackPtr  track)
explicit

在文件 dst_existence_fusion.cc 第 42 行定义.

43 : BaseExistenceFusion(track),
44 fused_toic_(toic_name_),
45 fused_existence_(name_) {}

◆ ~DstExistenceFusion()

apollo::perception::fusion::DstExistenceFusion::~DstExistenceFusion ( )
default

成员函数说明

◆ GetExistenceProbability()

double apollo::perception::fusion::DstExistenceFusion::GetExistenceProbability ( ) const

Get existence probability

返回
double

在文件 dst_existence_fusion.cc 第 340 行定义.

340 {
341 size_t toic_ind = DstManager::Instance()->FodSubsetToInd(
342 fused_existence_.Name(), ExistenceDstMaps::EXIST);
343 fused_existence_.ComputeProbability();
344 const std::vector<double> &existence_probs_vec =
345 fused_existence_.GetProbabilityVec();
346 return existence_probs_vec[toic_ind];
347}
size_t FodSubsetToInd(const std::string &app_name, const uint64_t &fod_subset)
const std::vector< double > & GetProbabilityVec() const
Get the Probability Vec object

◆ GetToicScore()

double apollo::perception::fusion::DstExistenceFusion::GetToicScore ( ) const
inline

Get toic score

返回
double

在文件 dst_existence_fusion.h 第 92 行定义.

92{ return toic_score_; }

◆ Init()

bool apollo::perception::fusion::DstExistenceFusion::Init ( const ExistenceFusionInitOptions &  options)
static

add dst application

参数
options
返回
true
false

在文件 dst_existence_fusion.cc 第 47 行定义.

47 {
48 std::string config_file =
49 GetConfigFile(options.config_path, options.config_file);
50
51 DstExistenceFusionConfig params;
52 if (!cyber::common::GetProtoFromFile(config_file, &params)) {
53 AERROR << "Read config failed: " << config_file;
54 return false;
55 }
56 for (auto valid_dist : params.camera_valid_dist()) {
57 std::string camera_id = valid_dist.camera_name();
58 options_.camera_max_valid_dist_[camera_id] = valid_dist.valid_dist();
59 AINFO << "dst existence fusion params: " << camera_id
60 << " max valid dist: " << options_.camera_max_valid_dist_[camera_id];
61 }
62
64 params.track_object_max_match_distance();
65 AINFO << "dst existence fusion params: "
66 << " track_object_max_match_distance: "
68
69 DstManager::Instance()->AddApp(name_, existence_dst_maps_.fod_subsets_,
70 existence_dst_maps_.subset_names_);
71
72 DstManager::Instance()->AddApp(toic_name_, toic_dst_maps_.fod_subsets_,
73 toic_dst_maps_.subset_names_);
74
75 return DstManager::Instance()->IsAppAdded(name_) &&
76 DstManager::Instance()->IsAppAdded(toic_name_);
77}
bool IsAppAdded(const std::string &app_name)
Whether app added
bool AddApp(const std::string &app_name, const std::vector< uint64_t > &fod_subsets, const std::vector< std::string > &fod_subset_names=std::vector< std::string >())
#define AERROR
Definition log.h:44
#define AINFO
Definition log.h:42
bool GetProtoFromFile(const std::string &file_name, google::protobuf::Message *message)
Parses the content of the file specified by the file_name as a representation of protobufs,...
Definition file.cc:132
std::string GetConfigFile(const std::string &config_path, const std::string &config_file)
Definition util.cc:80

◆ Name()

std::string apollo::perception::fusion::DstExistenceFusion::Name ( ) const

在文件 dst_existence_fusion.cc 第 338 行定义.

338{ return name_; }

◆ UpdateWithMeasurement()

void apollo::perception::fusion::DstExistenceFusion::UpdateWithMeasurement ( const SensorObjectPtr  measurement,
double  target_timestamp,
double  match_dist 
)
overridevirtual

update track existence state with measurement

参数
measurement
target_timestamp
match_dist

实现了 apollo::perception::fusion::BaseExistenceFusion.

在文件 dst_existence_fusion.cc 第 79 行定义.

81 {
82 std::string sensor_id = measurement->GetSensorId();
83 double timestamp = measurement->GetTimestamp();
84 double max_match_distance = options_.track_object_max_match_distance_;
85 double association_prob = 1 - match_dist / max_match_distance;
86 if (IsCamera(measurement)) {
87 association_prob = 1.0;
88 }
89 base::ObjectConstPtr obj = measurement->GetBaseObject();
90 double exist_factor = GetExistReliability(measurement);
91 double decay = ComputeDistDecay(obj, sensor_id, timestamp);
92 if (IsRadar(measurement)) {
93 decay = ComputeFeatureInfluence(measurement);
94 }
95 double obj_exist_prob = exist_factor * decay;
96 Dst existence_evidence(fused_existence_.Name());
97 existence_evidence.SetBba(
98 {{ExistenceDstMaps::EXIST, obj_exist_prob},
99 {ExistenceDstMaps::EXISTUNKNOWN, 1 - obj_exist_prob}});
100 // TODO(all) hard code for fused exist bba
101 const double exist_fused_w = 1.0;
102 ADEBUG << " before update exist prob: " << GetExistenceProbability();
103 fused_existence_ =
104 fused_existence_ + existence_evidence * exist_fused_w * association_prob;
105 ADEBUG << " update with, EXIST prob: " << GetExistenceProbability()
106 << " obj_id " << measurement->GetBaseObject()->track_id
107 << " association_prob: " << association_prob << " decay: " << decay
108 << " exist_prob: " << obj_exist_prob
109 << " sensor_id: " << measurement->GetSensorId()
110 << " track_id: " << track_ref_->GetTrackId();
111 if (IsCamera(measurement)) {
112 UpdateToicWithCameraMeasurement(measurement, match_dist);
113 }
114 UpdateExistenceState();
115}
double GetExistenceProbability() const
Get existence probability
#define ADEBUG
Definition log.h:41
std::shared_ptr< const Object > ObjectConstPtr
Definition object.h:128
bool IsCamera(const SensorObjectConstPtr &obj)
bool IsRadar(const SensorObjectConstPtr &obj)

◆ UpdateWithoutMeasurement()

void apollo::perception::fusion::DstExistenceFusion::UpdateWithoutMeasurement ( const std::string &  sensor_id,
double  measurement_timestamp,
double  target_timestamp,
double  min_match_dist 
)
overridevirtual

update track state without measurement

参数
sensor_id
measurement_timestamp
target_timestamp
min_match_dist

实现了 apollo::perception::fusion::BaseExistenceFusion.

在文件 dst_existence_fusion.cc 第 117 行定义.

120 {
121 SensorObjectConstPtr camera_object = nullptr;
122 if (algorithm::SensorManager::Instance()->IsCamera(sensor_id)) {
123 camera_object = track_ref_->GetSensorObject(sensor_id);
124 UpdateToicWithoutCameraMeasurement(sensor_id, measurement_timestamp,
125 min_match_dist);
126 }
127 SensorObjectConstPtr lidar_object = track_ref_->GetLatestLidarObject();
128 SensorObjectConstPtr camera_object_latest =
129 track_ref_->GetLatestCameraObject();
130 SensorObjectConstPtr radar_object = track_ref_->GetLatestRadarObject();
131 if ((lidar_object != nullptr && lidar_object->GetSensorId() == sensor_id) ||
132 (camera_object_latest != nullptr &&
133 camera_object_latest->GetSensorId() == sensor_id) ||
134 (radar_object != nullptr && radar_object->GetSensorId() == sensor_id &&
135 lidar_object == nullptr && camera_object_latest == nullptr)) {
136 Dst existence_evidence(fused_existence_.Name());
137 double unexist_factor = GetUnexistReliability(sensor_id);
138 base::ObjectConstPtr obj = track_ref_->GetFusedObject()->GetBaseObject();
139 double dist_decay = ComputeDistDecay(obj, sensor_id, measurement_timestamp);
140 double obj_unexist_prob = unexist_factor * dist_decay;
141 existence_evidence.SetBba(
142 {{ExistenceDstMaps::NEXIST, obj_unexist_prob},
143 {ExistenceDstMaps::EXISTUNKNOWN, 1 - obj_unexist_prob}});
144 // TODO(all) hard code for fused exist bba
145 const double unexist_fused_w = 1.0;
146 double min_match_dist_score = min_match_dist;
147 // if (!sensor_manager->IsCamera(sensor_id)) {
148 // min_match_dist_score = std::max(1 - min_match_dist /
149 // options_.track_object_max_match_distance_, 0.0);
150 // }
151 ADEBUG << " before update exist prob: " << GetExistenceProbability()
152 << " min_match_dist: " << min_match_dist
153 << " min_match_dist_score: " << min_match_dist_score;
154 fused_existence_ = fused_existence_ + existence_evidence * unexist_fused_w *
155 (1 - min_match_dist_score);
156 ADEBUG << " update without, EXIST prob: " << GetExistenceProbability()
157 << " 1 - match_dist_score: " << 1 - min_match_dist_score
158 << " sensor_id: " << sensor_id << " dist_decay: " << dist_decay
159 << " track_id: " << track_ref_->GetTrackId();
160 }
161 UpdateExistenceState();
162}
std::shared_ptr< const SensorObject > SensorObjectConstPtr

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