Apollo 11.0
自动驾驶开放平台
hdmap_input.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 <memory>
20#include <string>
21#include <vector>
22
23#include "cyber/common/macros.h"
29
30namespace apollo {
31namespace perception {
32namespace map {
33
35 public:
36 template <class EigenType>
38
39 public:
40 // thread safe
41 bool Init();
42 bool Reset();
43 bool GetRoiHDMapStruct(const base::PointD& pointd, const double distance,
44 std::shared_ptr<base::HdmapStruct> hdmap_struct_prt);
45 bool GetNearestLaneDirection(const base::PointD& pointd,
46 Eigen::Vector3d* lane_direction);
47 bool GetSignals(const Eigen::Vector3d& pointd, double forward_distance,
48 std::vector<apollo::hdmap::Signal>* signals);
49 bool GetBarrierGates(const Eigen::Vector3d& pointd, double forward_distance,
50 std::vector<apollo::hdmap::BarrierGate>* barrier_gates);
51
52 private:
53 bool InitHDMap();
54 bool InitInternal();
55
56 void MergeBoundaryJunction(
57 const std::vector<apollo::hdmap::RoadRoiPtr>& boundary,
58 const std::vector<apollo::hdmap::JunctionInfoConstPtr>& junctions,
59 EigenVector<base::RoadBoundary>* road_boundaries_ptr,
61 EigenVector<base::PointCloud<base::PointD>>* junction_polygons_ptr);
62
63 bool GetRoadBoundaryFilteredByJunctions(
64 const EigenVector<base::RoadBoundary>& road_boundaries,
66 EigenVector<base::RoadBoundary>* flt_road_boundaries_ptr);
67
68 void DownsamplePoints(const base::PointDCloudPtr& raw_cloud_ptr,
70 size_t min_points_num_for_sample = 15) const;
71
72 void SplitBoundary(
73 const base::PointCloud<base::PointD>& boundary_line,
75 EigenVector<base::PointCloud<base::PointD>>* boundary_line_vec_ptr);
76
77 bool GetSignalsFromHDMap(const Eigen::Vector3d& pointd,
78 double forward_distance,
79 std::vector<apollo::hdmap::Signal>* signals);
80
81 bool GetBarrierGatesFromHDMap(
82 const Eigen::Vector3d& pointd, double forward_distance,
83 std::vector<apollo::hdmap::BarrierGate>* barrier_gates);
84
85 bool inited_ = false;
86 lib::Mutex mutex_;
87 std::unique_ptr<apollo::hdmap::HDMap> hdmap_;
88 int hdmap_sample_step_ = 5;
89 std::string hdmap_file_;
90
92};
93
94} // namespace map
95} // namespace perception
96} // namespace apollo
bool GetBarrierGates(const Eigen::Vector3d &pointd, double forward_distance, std::vector< apollo::hdmap::BarrierGate > *barrier_gates)
apollo::common::EigenVector< EigenType > EigenVector
Definition hdmap_input.h:37
bool GetSignals(const Eigen::Vector3d &pointd, double forward_distance, std::vector< apollo::hdmap::Signal > *signals)
bool GetRoiHDMapStruct(const base::PointD &pointd, const double distance, std::shared_ptr< base::HdmapStruct > hdmap_struct_prt)
bool GetNearestLaneDirection(const base::PointD &pointd, Eigen::Vector3d *lane_direction)
#define DECLARE_SINGLETON(classname)
Definition macros.h:52
std::vector< EigenType, Eigen::aligned_allocator< EigenType > > EigenVector
Definition eigen_defs.h:33
std::shared_ptr< PointDCloud > PointDCloudPtr
class register implement
Definition arena_queue.h:37