Apollo 11.0
自动驾驶开放平台
hm_tracks_objects_match.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 <string>
19#include <vector>
20
21#include "cyber/common/macros.h"
25
26namespace apollo {
27namespace perception {
28namespace fusion {
29
31 public:
34
42 bool Init(const AssociationInitOptions &options) override {
43 track_object_distance_.set_distance_thresh(
44 static_cast<float>(s_match_distance_thresh_));
45 return true;
46 }
47
59 bool Associate(const AssociationOptions& options,
60 SensorFramePtr sensor_measurements, ScenePtr scene,
61 AssociationResult* association_result) override;
62
63 std::string Name() const override { return "HMTrackersObjectsAssociation"; }
64
65 private:
76 void ComputeAssociationDistanceMat(
77 const std::vector<TrackPtr>& fusion_tracks,
78 const std::vector<SensorObjectPtr>& sensor_objects,
79 const Eigen::Vector3d& ref_point,
80 const std::vector<size_t>& unassigned_tracks,
81 const std::vector<size_t>& unassigned_measurements,
82 std::vector<std::vector<double>>* association_mat);
83
95 void IdAssign(const std::vector<TrackPtr>& fusion_tracks,
96 const std::vector<SensorObjectPtr>& sensor_objects,
97 std::vector<TrackMeasurmentPair>* assignments,
98 std::vector<size_t>* unassigned_fusion_tracks,
99 std::vector<size_t>* unassigned_sensor_objects,
100 bool do_nothing = false, bool post = false);
101
111 void PostIdAssign(const std::vector<TrackPtr>& fusion_tracks,
112 const std::vector<SensorObjectPtr>& sensor_objects,
113 const std::vector<size_t>& unassigned_fusion_tracks,
114 const std::vector<size_t>& unassigned_sensor_objects,
115 std::vector<TrackMeasurmentPair>* post_assignments);
116
129 bool MinimizeAssignment(
130 const std::vector<std::vector<double>>& association_mat,
131 const std::vector<size_t>& track_ind_l2g,
132 const std::vector<size_t>& measurement_ind_l2g,
133 std::vector<TrackMeasurmentPair>* assignments,
134 std::vector<size_t>* unassigned_tracks,
135 std::vector<size_t>* unassigned_measurements);
136
149 void ComputeDistance(const std::vector<TrackPtr>& fusion_tracks,
150 const std::vector<SensorObjectPtr>& sensor_objects,
151 const std::vector<size_t>& unassigned_fusion_track,
152 const std::vector<int>& track_ind_g2l,
153 const std::vector<int>& measurement_ind_g2l,
154 const std::vector<size_t>& measurement_ind_l2g,
155 const std::vector<std::vector<double>>& association_mat,
156 AssociationResult* association_result);
157
167 void GenerateUnassignedData(
168 size_t track_num, size_t objects_num,
169 const std::vector<TrackMeasurmentPair>& assignments,
170 std::vector<size_t>* unassigned_tracks,
171 std::vector<size_t>* unassigned_objects);
172
173 private:
176
178 TrackObjectDistance track_object_distance_;
180 static double s_match_distance_thresh_;
182 static double s_match_distance_bound_;
184 static double s_association_center_dist_threshold_;
185
187};
188
189} // namespace fusion
190} // namespace perception
191} // namespace apollo
bool Associate(const AssociationOptions &options, SensorFramePtr sensor_measurements, ScenePtr scene, AssociationResult *association_result) override
Associate the obstacles measured by the sensor with the obstacles tracked in current scene
std::string Name() const override
The name of BaseDataAssociation
bool Init(const AssociationInitOptions &options) override
initialization
void set_distance_thresh(const float distance_thresh)
Set the distance thresh
#define DISALLOW_COPY_AND_ASSIGN(classname)
Definition macros.h:48
std::shared_ptr< SensorFrame > SensorFramePtr
std::shared_ptr< Scene > ScenePtr
Definition scene.h:88
class register implement
Definition arena_queue.h:37