Apollo  6.0
Open source self driving car software
base_bipartite_graph_matcher.h
Go to the documentation of this file.
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 "Eigen/Core"
23 
24 #include "cyber/common/macros.h"
27 
28 namespace apollo {
29 namespace perception {
30 namespace lidar {
31 
33 
35  float cost_thresh = 4.0f;
36  float bound_value = 100.0f;
37 };
38 
40  public:
41  typedef std::pair<size_t, size_t> NodeNodePair;
42  BaseBipartiteGraphMatcher() = default;
43  virtual ~BaseBipartiteGraphMatcher() = default;
44 
45  // @params[OUT] assignments: matched pair of objects & tracks
46  // @params[OUT] unassigned_rows: unmatched rows
47  // @params[OUT] unassigned_cols: unmatched cols
48  // @return nothing
49  virtual void Match(const BipartiteGraphMatcherOptions &options,
50  std::vector<NodeNodePair> *assignments,
51  std::vector<size_t> *unassigned_rows,
52  std::vector<size_t> *unassigned_cols) = 0;
53  virtual std::string Name() const = 0;
54 
55  virtual common::SecureMat<float> *cost_matrix() { return cost_matrix_; }
56 
57  protected:
58  common::SecureMat<float> *cost_matrix_ = nullptr;
59  float max_match_distance_ = 0.0f;
60 
61  private:
63 }; // class BaseBipartiteGraphMatcher
64 
66 #define PERCEPTION_REGISTER_BIPARTITEGRAPHMATCHER(name) \
67  PERCEPTION_REGISTER_CLASS(BaseBipartiteGraphMatcher, name)
68 
69 } // namespace lidar
70 } // namespace perception
71 } // namespace apollo
std::pair< size_t, size_t > NodeNodePair
Definition: base_bipartite_graph_matcher.h:41
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Definition: base_bipartite_graph_matcher.h:34
#define DISALLOW_COPY_AND_ASSIGN(classname)
Definition: macros.h:48
virtual common::SecureMat< float > * cost_matrix()
Definition: base_bipartite_graph_matcher.h:55
Definition: base_bipartite_graph_matcher.h:32
Definition: base_bipartite_graph_matcher.h:39
PERCEPTION_REGISTER_REGISTERER(BaseOneShotTypeFusion)