Apollo 11.0
自动驾驶开放平台
dst_existence_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 <map>
19#include <string>
20#include <vector>
21
22#include "cyber/common/macros.h"
25
26namespace apollo {
27namespace perception {
28namespace fusion {
29
31 // for (N)TOIC: (not)target of interest in camera judgement
32 enum { TOIC = (1 << 0), NTOIC = (1 << 1), TOICUNKNOWN = (TOIC | NTOIC) };
33 std::vector<uint64_t> fod_subsets_ = {TOIC, NTOIC, TOICUNKNOWN};
34 std::vector<std::string> subset_names_ = {"TOIC", "NTOIC", "TOICUNKNOWN"};
35};
36
38 enum { EXIST = (1 << 0), NEXIST = (1 << 1), EXISTUNKNOWN = (EXIST | NEXIST) };
39 std::vector<uint64_t> fod_subsets_ = {EXIST, NEXIST, EXISTUNKNOWN};
40 std::vector<std::string> subset_names_ = {"EXIST", "NEXIST", "EXISTUNKNOWN"};
41};
42
44 std::map<std::string, double> camera_max_valid_dist_ = {
45 {"camera_smartereye", 110}, {"camera_front_obstacle", 110},
46 {"camera_front_narrow", 150}, {"front_6mm", 110},
47 {"camera_rear", 60}, {"camera_front", 110}
48 };
50};
51
53 public:
54 explicit DstExistenceFusion(TrackPtr track);
56
64 static bool Init(const ExistenceFusionInitOptions &options);
65
66 // @brief: update track state with measurement
67 // @param [in]: measurement
68 // @param [in]: target_timestamp
69 void UpdateWithMeasurement(const SensorObjectPtr measurement,
70 double target_timestamp,
71 double match_dist) override;
80 void UpdateWithoutMeasurement(const std::string &sensor_id,
81 double measurement_timestamp,
82 double target_timestamp,
83 double min_match_dist) override;
84
85 std::string Name() const;
86
92 double GetToicScore() const { return toic_score_; }
93
99 double GetExistenceProbability() const;
100
101 private:
108 void UpdateToicWithCameraMeasurement(const SensorObjectPtr &camera_obj,
109 double match_dist);
110
118 void UpdateToicWithoutCameraMeasurement(const std::string &sensor_id,
119 double measurement_timestamp,
120 double match_dist);
121
130 double ComputeDistDecay(base::ObjectConstPtr obj,
131 const std::string &sensor_id, double timestamp);
132
139 double ComputeFeatureInfluence(const SensorObjectPtr measurement);
140
147 double GetExistReliability(const SensorObjectPtr measurement);
148
155 double GetUnexistReliability(const std::string &sensor_id);
156
162 double GetToicProbability() const;
163
165 void UpdateExistenceState();
166
167 private:
168 double existence_score_ = 0.0;
169 Dst fused_toic_;
170 Dst fused_existence_;
171 double toic_score_ = 0.0;
172
173 private:
174 static const char *name_;
175 static const char *toic_name_;
176 static ExistenceDstMaps existence_dst_maps_;
177 static ToicDstMaps toic_dst_maps_;
178 static DstExistenceFusionOptions options_;
179
181};
182
183} // namespace fusion
184} // namespace perception
185} // namespace apollo
void UpdateWithMeasurement(const SensorObjectPtr measurement, double target_timestamp, double match_dist) override
update track existence state with measurement
double GetExistenceProbability() const
Get existence probability
static bool Init(const ExistenceFusionInitOptions &options)
add dst application
void UpdateWithoutMeasurement(const std::string &sensor_id, double measurement_timestamp, double target_timestamp, double min_match_dist) override
update track state without measurement
#define DISALLOW_COPY_AND_ASSIGN(classname)
Definition macros.h:48
std::shared_ptr< const Object > ObjectConstPtr
Definition object.h:128
std::shared_ptr< SensorObject > SensorObjectPtr
std::shared_ptr< Track > TrackPtr
Definition track.h:397
class register implement
Definition arena_queue.h:37