Apollo 11.0
自动驾驶开放平台
apollo::perception::map::HDMapInput类 参考

#include <hdmap_input.h>

apollo::perception::map::HDMapInput 的协作图:

Public 类型

template<class EigenType >
using EigenVector = apollo::common::EigenVector< EigenType >
 

Public 成员函数

bool Init ()
 
bool Reset ()
 
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)
 
bool GetSignals (const Eigen::Vector3d &pointd, double forward_distance, std::vector< apollo::hdmap::Signal > *signals)
 
bool GetBarrierGates (const Eigen::Vector3d &pointd, double forward_distance, std::vector< apollo::hdmap::BarrierGate > *barrier_gates)
 

详细描述

在文件 hdmap_input.h34 行定义.

成员类型定义说明

◆ EigenVector

在文件 hdmap_input.h37 行定义.

成员函数说明

◆ GetBarrierGates()

bool apollo::perception::map::HDMapInput::GetBarrierGates ( const Eigen::Vector3d &  pointd,
double  forward_distance,
std::vector< apollo::hdmap::BarrierGate > *  barrier_gates 
)

在文件 hdmap_input.cc441 行定义.

443 {
444 lib::MutexLock lock(&mutex_);
445 if (hdmap_.get() == nullptr) {
446 AERROR << "hdmap is not available";
447 return false;
448 }
449 return GetBarrierGatesFromHDMap(pointd, forward_distance, barrier_gates);
450}
#define AERROR
Definition log.h:44

◆ GetNearestLaneDirection()

bool apollo::perception::map::HDMapInput::GetNearestLaneDirection ( const base::PointD pointd,
Eigen::Vector3d *  lane_direction 
)

在文件 hdmap_input.cc353 行定义.

354 {
355 // if (hdmap_ == nullptr) {
356 // return false;
357 // }
358 // apollo::common::PointENU point;
359 // point.set_x(pointd.x);
360 // point.set_y(pointd.y);
361 // point.set_z(pointd.z);
362 // apollo::hdmap::LaneInfoConstPtr nearest_lane;
363 // double nearest_s = 0.0;
364 // double nearest_l = 0.0;
365 // // get nearest lane of query point
366 // int status = hdmap_->GetNearestLane(point, &nearest_lane,
367 // &nearest_s, &nearest_l);
368 // if (status != 0) {
369 // AINFO << "Failed to get nearest lane for point " <<
370 // point.DebugString();
371 // return false;
372 // }
373 // // get lane heading of nearest s
374 // const adu::hdmap::Trajectory& nearest_lane_trajectory
375 // = nearest_lane->trajectory();
376 // double lane_heading
377 // = nearest_lane_trajectory.get_smooth_point(nearest_s).heading();
378 // *lane_direction = Eigen::Vector3d(cos(lane_heading), sin(lane_heading), 0);
379 return true;
380}

◆ GetRoiHDMapStruct()

bool apollo::perception::map::HDMapInput::GetRoiHDMapStruct ( const base::PointD pointd,
const double  distance,
std::shared_ptr< base::HdmapStruct hdmap_struct_prt 
)

在文件 hdmap_input.cc97 行定义.

99 {
100 lib::MutexLock lock(&mutex_);
101 if (hdmap_.get() == nullptr) {
102 AERROR << "hdmap is not available";
103 return false;
104 }
105 // Get original road boundary and junction
106 std::vector<RoadRoiPtr> road_boundary_vec;
107 std::vector<JunctionInfoConstPtr> junctions_vec;
109 point.set_x(pointd.x);
110 point.set_y(pointd.y);
111 point.set_z(pointd.z);
112 if (hdmap_->GetRoadBoundaries(point, distance, &road_boundary_vec,
113 &junctions_vec) != 0) {
114 AERROR << "Failed to get road boundary, point: " << point.DebugString();
115 return false;
116 }
117 junctions_vec.clear();
118 if (hdmap_->GetJunctions(point, distance, &junctions_vec) != 0) {
119 AERROR << "Failed to get junctions, point: " << point.DebugString();
120 return false;
121 }
122 if (hdmap_struct_ptr == nullptr) {
123 return false;
124 }
125 hdmap_struct_ptr->hole_polygons.clear();
126 hdmap_struct_ptr->junction_polygons.clear();
127 hdmap_struct_ptr->road_boundary.clear();
128 hdmap_struct_ptr->road_polygons.clear();
129
130 // Merge boundary and junction
131 EigenVector<base::RoadBoundary> road_boundaries;
132 MergeBoundaryJunction(road_boundary_vec, junctions_vec, &road_boundaries,
133 &(hdmap_struct_ptr->road_polygons),
134 &(hdmap_struct_ptr->junction_polygons));
135 // Filter road boundary by junction
136 GetRoadBoundaryFilteredByJunctions(road_boundaries,
137 hdmap_struct_ptr->junction_polygons,
138 &(hdmap_struct_ptr->road_boundary));
139 return true;
140}

◆ GetSignals()

bool apollo::perception::map::HDMapInput::GetSignals ( const Eigen::Vector3d &  pointd,
double  forward_distance,
std::vector< apollo::hdmap::Signal > *  signals 
)

在文件 hdmap_input.cc430 行定义.

432 {
433 lib::MutexLock lock(&mutex_);
434 if (hdmap_.get() == nullptr) {
435 AERROR << "hdmap is not available";
436 return false;
437 }
438 return GetSignalsFromHDMap(pointd, forward_distance, signals);
439}

◆ Init()

bool apollo::perception::map::HDMapInput::Init ( )

在文件 hdmap_input.cc49 行定义.

49 {
50 lib::MutexLock lock(&mutex_);
51 return InitInternal();
52}

◆ Reset()

bool apollo::perception::map::HDMapInput::Reset ( )

在文件 hdmap_input.cc65 行定义.

65 {
66 lib::MutexLock lock(&mutex_);
67 inited_ = false;
68 return InitInternal();
69}

该类的文档由以下文件生成: