Apollo | perception | fusion
void ProbabilisticFusion::FuseFrame(const SensorFramePtr& frame) {
AINFO << "Fusing frame: " << frame->GetSensorId()
<< ", foreground_object_number: "
<< frame->GetForegroundObjects().size()
<< ", background_object_number: "
<< frame->GetBackgroundObjects().size()
<< ", timestamp: " << FORMAT_TIMESTAMP(frame->GetTimestamp());
this->FuseForegroundTrack(frame);
this->FusebackgroundTrack(frame);
this->RemoveLostTrack();
}
void ProbabilisticFusion::FuseForegroundTrack(const SensorFramePtr& frame) {
PERF_BLOCK_START();
std::string indicator = "fusion_" + frame->GetSensorId();
AssociationOptions options;
AssociationResult association_result;
matcher_->Associate(options, frame, scenes_, &association_result);
PERF_BLOCK_END_WITH_INDICATOR(indicator, "association");
const std::vector<TrackMeasurmentPair>& assignments =
association_result.assignments;
this->UpdateAssignedTracks(frame, assignments);
PERF_BLOCK_END_WITH_INDICATOR(indicator, "update_assigned_track");
const std::vector<size_t>& unassigned_track_inds =
association_result.unassigned_tracks;
this->UpdateUnassignedTracks(frame, unassigned_track_inds);
PERF_BLOCK_END_WITH_INDICATOR(indicator, "update_unassigned_track");
const std::vector<size_t>& unassigned_obj_inds =
association_result.unassigned_measurements;
this->CreateNewTracks(frame, unassigned_obj_inds);
PERF_BLOCK_END_WITH_INDICATOR(indicator, "create_track");
}