Apollo
10.0
自动驾驶开放平台
base_bipartite_graph_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
17
#pragma once
18
19
#include <string>
20
#include <utility>
21
#include <vector>
22
23
#include "Eigen/Core"
24
25
#include "
cyber/common/macros.h
"
26
#include "
modules/perception/common/algorithm/graph/secure_matrix.h
"
27
#include "
modules/perception/common/lib/interface/base_init_options.h
"
28
#include "
modules/perception/common/lib/registerer/registerer.h
"
29
30
namespace
apollo
{
31
namespace
perception {
32
namespace
lidar {
33
34
using
apollo::perception::BaseInitOptions
;
35
36
struct
BipartiteGraphMatcherInitOptions
:
public
BaseInitOptions
{};
37
38
struct
BipartiteGraphMatcherOptions
{
39
float
cost_thresh
= 4.0f;
40
float
bound_value
= 100.0f;
41
};
42
43
class
BaseBipartiteGraphMatcher
{
44
public
:
45
typedef
std::pair<size_t, size_t>
NodeNodePair
;
46
BaseBipartiteGraphMatcher
() =
default
;
47
virtual
~BaseBipartiteGraphMatcher
() =
default
;
48
57
virtual
void
Match
(
const
BipartiteGraphMatcherOptions
&options,
58
std::vector<NodeNodePair> *assignments,
59
std::vector<size_t> *unassigned_rows,
60
std::vector<size_t> *unassigned_cols) = 0;
66
virtual
std::string
Name
()
const
= 0;
67
73
virtual
algorithm::SecureMat<float>
*
cost_matrix
() {
return
cost_matrix_
; }
74
75
protected
:
76
algorithm::SecureMat<float>
*
cost_matrix_
=
nullptr
;
77
float
max_match_distance_
= 0.0f;
78
79
private
:
80
DISALLOW_COPY_AND_ASSIGN
(
BaseBipartiteGraphMatcher
);
81
};
// class BaseBipartiteGraphMatcher
82
83
PERCEPTION_REGISTER_REGISTERER
(
BaseBipartiteGraphMatcher
);
84
#define PERCEPTION_REGISTER_BIPARTITEGRAPHMATCHER(name) \
85
PERCEPTION_REGISTER_CLASS(BaseBipartiteGraphMatcher, name)
86
87
}
// namespace lidar
88
}
// namespace perception
89
}
// namespace apollo
base_init_options.h
apollo::perception::algorithm::SecureMat
Definition
secure_matrix.h:29
apollo::perception::lidar::BaseBipartiteGraphMatcher
Definition
base_bipartite_graph_matcher.h:43
apollo::perception::lidar::BaseBipartiteGraphMatcher::Name
virtual std::string Name() const =0
Get class name
apollo::perception::lidar::BaseBipartiteGraphMatcher::NodeNodePair
std::pair< size_t, size_t > NodeNodePair
Definition
base_bipartite_graph_matcher.h:45
apollo::perception::lidar::BaseBipartiteGraphMatcher::~BaseBipartiteGraphMatcher
virtual ~BaseBipartiteGraphMatcher()=default
apollo::perception::lidar::BaseBipartiteGraphMatcher::BaseBipartiteGraphMatcher
BaseBipartiteGraphMatcher()=default
apollo::perception::lidar::BaseBipartiteGraphMatcher::cost_matrix
virtual algorithm::SecureMat< float > * cost_matrix()
Get cost matrix
Definition
base_bipartite_graph_matcher.h:73
apollo::perception::lidar::BaseBipartiteGraphMatcher::Match
virtual void Match(const BipartiteGraphMatcherOptions &options, std::vector< NodeNodePair > *assignments, std::vector< size_t > *unassigned_rows, std::vector< size_t > *unassigned_cols)=0
Match bipartite graph
apollo::perception::lidar::BaseBipartiteGraphMatcher::max_match_distance_
float max_match_distance_
Definition
base_bipartite_graph_matcher.h:77
apollo::perception::lidar::BaseBipartiteGraphMatcher::cost_matrix_
algorithm::SecureMat< float > * cost_matrix_
Definition
base_bipartite_graph_matcher.h:76
macros.h
DISALLOW_COPY_AND_ASSIGN
#define DISALLOW_COPY_AND_ASSIGN(classname)
Definition
macros.h:48
apollo
class register implement
Definition
arena_queue.h:37
registerer.h
PERCEPTION_REGISTER_REGISTERER
#define PERCEPTION_REGISTER_REGISTERER(base_class)
Definition
registerer.h:92
secure_matrix.h
apollo::perception::BaseInitOptions
Definition
base_init_options.h:23
apollo::perception::lidar::BipartiteGraphMatcherInitOptions
Definition
base_bipartite_graph_matcher.h:36
apollo::perception::lidar::BipartiteGraphMatcherOptions
Definition
base_bipartite_graph_matcher.h:38
apollo::perception::lidar::BipartiteGraphMatcherOptions::cost_thresh
float cost_thresh
Definition
base_bipartite_graph_matcher.h:39
apollo::perception::lidar::BipartiteGraphMatcherOptions::bound_value
float bound_value
Definition
base_bipartite_graph_matcher.h:40
modules
perception
lidar_tracking
interface
base_bipartite_graph_matcher.h