Apollo 10.0
自动驾驶开放平台
base_matcher.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2024 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 camera {
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<CameraTrackPtr> &camera_tracks,
75 const base::Frame &camera_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
88 virtual std::string Name() const { return "BaseMatcher"; }
89
95 static void SetMaxMatchDistance(double dist);
96
102 static double GetMaxMatchDistance();
103
109 static void SetBoundMatchDistance(double dist);
110
116 static double GetBoundMatchDistance();
117
118 protected:
129 virtual bool RefinedTrack(const base::ObjectPtr &track_object,
130 double track_timestamp,
131 const base::ObjectPtr &camera_object,
132 double camera_timestamp);
133
134 protected:
137 FRIEND_TEST(BaseMatcherTest, base_matcher_test);
138
139 private:
141};
142
144#define PERCEPTION_REGISTER_MATCHER(name) \
145 PERCEPTION_REGISTER_CLASS(BaseMatcher, name)
146
147} // namespace camera
148} // namespace perception
149} // namespace apollo
static void SetBoundMatchDistance(double dist)
Set the Bound Match Distance
static double GetBoundMatchDistance()
Get the Bound Match Distance
virtual bool Init(const MatcherInitOptions &options)
Init Base Matcher config
FRIEND_TEST(BaseMatcherTest, base_matcher_test)
virtual bool RefinedTrack(const base::ObjectPtr &track_object, double track_timestamp, const base::ObjectPtr &camera_object, double camera_timestamp)
track targets based on their features.
virtual bool Match(const std::vector< CameraTrackPtr > &camera_tracks, const base::Frame &camera_frame, const TrackObjectMatcherOptions &options, std::vector< TrackObjectPair > *assignments, std::vector< size_t > *unassigned_tracks, std::vector< size_t > *unassigned_objects)
Match camera objects to tracks
BaseMatcher()=default
Construct a new Base Matcher object
virtual std::string Name() const
The name of the camera base Matcher
static void SetMaxMatchDistance(double dist)
Set the Max Match Distance
static double GetMaxMatchDistance()
Get 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