Apollo 11.0
自动驾驶开放平台
probabilistic_fusion.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#include <vector>
21
22#include "cyber/common/macros.h"
28
29namespace apollo {
30namespace perception {
31namespace fusion {
32
34 bool use_lidar = true;
35 bool use_radar = true;
36 bool use_camera = true;
37 std::string tracker_method;
39 std::string gate_keeper_method;
40 std::vector<std::string> prohibition_sensors;
41};
42
44 public:
47
55 bool Init(const FusionInitOptions& options) override;
56
66 bool Fuse(const base::FrameConstPtr& sensor_frame,
67 std::vector<base::ObjectPtr>* fused_objects) override;
68
69 std::string Name() const override { return "ProbabilisticFusion"; }
70
71 private:
80 bool IsPublishSensor(const base::FrameConstPtr& sensor_frame) const;
81
87 void FuseFrame(const SensorFramePtr& frame);
88
95 void CollectFusedObjects(double timestamp,
96 std::vector<base::ObjectPtr>* fused_objects);
97
103 void FuseForegroundTrack(const SensorFramePtr& frame);
104
110 void FusebackgroundTrack(const SensorFramePtr& frame);
111
113 void RemoveLostTrack();
114
121 void UpdateAssignedTracks(
122 const SensorFramePtr& frame,
123 const std::vector<TrackMeasurmentPair>& assignments);
124
131 void UpdateUnassignedTracks(const SensorFramePtr& frame,
132 const std::vector<size_t>& unassigned_track_inds);
133
140 void CreateNewTracks(const SensorFramePtr& frame,
141 const std::vector<size_t>& unassigned_obj_inds);
142
150 void CollectObjectsByTrack(double timestamp, const TrackPtr& track,
151 std::vector<base::ObjectPtr>* fused_objects);
152
159 void CollectSensorMeasurementFromObject(
160 const SensorObjectConstPtr& object,
161 base::SensorObjectMeasurement* measurement);
162
163 private:
164 std::mutex data_mutex_;
165 std::mutex fuse_mutex_;
166
167 ScenePtr scenes_;
168 std::vector<std::shared_ptr<BaseTracker>> trackers_; // for foreground
169
170 std::unique_ptr<BaseDataAssociation> matcher_;
171 std::unique_ptr<BaseGatekeeper> gate_keeper_;
172
173 FusionParams params_;
174
176};
177
178} // namespace fusion
179} // namespace perception
180} // namespace apollo
bool Init(const FusionInitOptions &options) override
Initialization
std::string Name() const override
The name of BaseFusionSystem
bool Fuse(const base::FrameConstPtr &sensor_frame, std::vector< base::ObjectPtr > *fused_objects) override
Probabilistic fusion of sensor data, the input is the detection results of different sensors,...
#define DISALLOW_COPY_AND_ASSIGN(classname)
Definition macros.h:48
std::shared_ptr< const Frame > FrameConstPtr
Definition frame.h:61
std::shared_ptr< const SensorObject > SensorObjectConstPtr
std::shared_ptr< SensorFrame > SensorFramePtr
std::shared_ptr< Track > TrackPtr
Definition track.h:397
std::shared_ptr< Scene > ScenePtr
Definition scene.h:88
class register implement
Definition arena_queue.h:37