Apollo 11.0
自动驾驶开放平台
base_matcher.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 <utility>
20#include <vector>
21
22#include "gtest/gtest_prod.h"
23
24#include "cyber/common/macros.h"
29
30namespace apollo {
31namespace perception {
32namespace radar {
33
34typedef std::pair<size_t, size_t> TrackObjectPair;
35
37 // reserved
38};
39
41 Eigen::Vector3d *ref_point = nullptr;
42};
43
45 public:
50 BaseMatcher() = default;
51 virtual ~BaseMatcher() = default;
52
60 virtual bool Init(const MatcherInitOptions &options) { return true; }
61
74 virtual bool Match(const std::vector<RadarTrackPtr> &radar_tracks,
75 const base::Frame &radar_frame,
76 const TrackObjectMatcherOptions &options,
77 std::vector<TrackObjectPair> *assignments,
78 std::vector<size_t> *unassigned_tracks,
79 std::vector<size_t> *unassigned_objects) {
80 return true;
81 }
82
95 virtual void IDMatch(const std::vector<RadarTrackPtr> &radar_tracks,
96 const base::Frame &radar_frame,
97 std::vector<TrackObjectPair> *assignments,
98 std::vector<size_t> *unassigned_tracks,
99 std::vector<size_t> *unassigned_objects);
100
106 virtual std::string Name() const { return "BaseMatcher"; }
107
113 static void SetMaxMatchDistance(double dist);
114
120 static double GetMaxMatchDistance();
121
127 static void SetBoundMatchDistance(double dist);
128
134 static double GetBoundMatchDistance();
135
136 protected:
147 virtual bool RefinedTrack(const base::ObjectPtr &track_object,
148 double track_timestamp,
149 const base::ObjectPtr &radar_object,
150 double radar_timestamp);
151
152 protected:
155 FRIEND_TEST(BaseMatcherTest, base_matcher_test);
156
157 private:
159};
160
162#define PERCEPTION_REGISTER_MATCHER(name) \
163 PERCEPTION_REGISTER_CLASS(BaseMatcher, name)
164
165} // namespace radar
166} // namespace perception
167} // namespace apollo
virtual bool Init(const MatcherInitOptions &options)
Init Base Matcher config
FRIEND_TEST(BaseMatcherTest, base_matcher_test)
virtual void IDMatch(const std::vector< RadarTrackPtr > &radar_tracks, const base::Frame &radar_frame, std::vector< TrackObjectPair > *assignments, std::vector< size_t > *unassigned_tracks, std::vector< size_t > *unassigned_objects)
Target association by id.
static void SetBoundMatchDistance(double dist)
Set the Bound Match Distance
BaseMatcher()=default
Construct a new Base Matcher object
static double GetBoundMatchDistance()
Get the Bound Match Distance
static double GetMaxMatchDistance()
Get the Max Match Distance
virtual std::string Name() const
The name of the radar base Matcher
virtual bool Match(const std::vector< RadarTrackPtr > &radar_tracks, const base::Frame &radar_frame, const TrackObjectMatcherOptions &options, std::vector< TrackObjectPair > *assignments, std::vector< size_t > *unassigned_tracks, std::vector< size_t > *unassigned_objects)
Match radar objects to tracks
virtual bool RefinedTrack(const base::ObjectPtr &track_object, double track_timestamp, const base::ObjectPtr &radar_object, double radar_timestamp)
After the IDMatch, then track targets based on their features.
static void SetMaxMatchDistance(double dist)
Set the Max Match Distance
#define DISALLOW_COPY_AND_ASSIGN(classname)
Definition macros.h:48
std::shared_ptr< Object > ObjectPtr
Definition object.h:127
std::pair< size_t, size_t > TrackObjectPair
class register implement
Definition arena_queue.h:37
#define PERCEPTION_REGISTER_REGISTERER(base_class)
Definition registerer.h:92