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

#include <ground_service.h>

类 apollo::perception::lidar::GroundServiceContent 继承关系图:
apollo::perception::lidar::GroundServiceContent 的协作图:

Public 成员函数

 GroundServiceContent ()=default
 
 ~GroundServiceContent ()=default
 
void GetCopy (SceneServiceContent *content) const override
 
void SetContent (const SceneServiceContent &content) override
 
std::string Name () const override
 
bool Init (double roi_x, double roi_y, uint32_t rows, uint32_t cols)
 
bool PointToGrid (const Eigen::Vector3d &world_point, uint32_t *grid_index) const
 
float PointToPlaneDistance (const Eigen::Vector3d &world_point) const
 
- Public 成员函数 继承自 apollo::perception::lidar::SceneServiceContent
 SceneServiceContent ()=default
 
virtual ~SceneServiceContent ()=default
 
bool IsServiceReady () const
 

Public 属性

GroundGrid grid_
 
Eigen::Vector3d grid_center_
 
uint32_t rows_ = 0
 
uint32_t cols_ = 0
 
double resolution_x_ = 0.0
 
double resolution_y_ = 0.0
 
double bound_x_min_ = 0.0
 
double bound_y_min_ = 0.0
 
double bound_x_max_ = 0.0
 
double bound_y_max_ = 0.0
 

额外继承的成员函数

- Protected 属性 继承自 apollo::perception::lidar::SceneServiceContent
bool service_ready_ = false
 

详细描述

在文件 ground_service.h 第 30 行定义.

构造及析构函数说明

◆ GroundServiceContent()

apollo::perception::lidar::GroundServiceContent::GroundServiceContent ( )
default

◆ ~GroundServiceContent()

apollo::perception::lidar::GroundServiceContent::~GroundServiceContent ( )
default

成员函数说明

◆ GetCopy()

void apollo::perception::lidar::GroundServiceContent::GetCopy ( SceneServiceContent *  content) const
overridevirtual

实现了 apollo::perception::lidar::SceneServiceContent.

在文件 ground_service.cc 第 30 行定义.

30 {
31 GroundServiceContent* ground_content =
32 dynamic_cast<GroundServiceContent*>(content);
33 if (ground_content == nullptr) {
34 return;
35 }
36 ground_content->grid_ = grid_;
37 ground_content->grid_center_ = grid_center_;
38 ground_content->resolution_x_ = resolution_x_;
39 ground_content->resolution_y_ = resolution_y_;
40 ground_content->bound_x_min_ = bound_x_min_;
41 ground_content->bound_y_min_ = bound_y_min_;
42 ground_content->bound_x_max_ = bound_x_max_;
43 ground_content->bound_y_max_ = bound_y_max_;
44 ground_content->rows_ = rows_;
45 ground_content->cols_ = cols_;
46 ground_content->service_ready_ = service_ready_;
47}

◆ Init()

bool apollo::perception::lidar::GroundServiceContent::Init ( double  roi_x,
double  roi_y,
uint32_t  rows,
uint32_t  cols 
)

在文件 ground_service.cc 第 116 行定义.

117 {
118 bound_x_min_ = -roi_x;
119 bound_y_min_ = -roi_y;
120 bound_x_max_ = roi_x;
121 bound_y_max_ = roi_y;
122
123 rows_ = rows;
124 cols_ = cols;
125
128
130 return true;
131}
void Init(int32_t rows, int32_t cols)

◆ Name()

std::string apollo::perception::lidar::GroundServiceContent::Name ( ) const
inlineoverridevirtual

实现了 apollo::perception::lidar::SceneServiceContent.

在文件 ground_service.h 第 45 行定义.

45{ return "GroundServiceContent"; }

◆ PointToGrid()

bool apollo::perception::lidar::GroundServiceContent::PointToGrid ( const Eigen::Vector3d &  world_point,
uint32_t *  grid_index 
) const

在文件 ground_service.cc 第 73 行定义.

74 {
75 double x = world_point(0) - grid_center_(0);
76 double y = world_point(1) - grid_center_(1);
77 if (x < bound_x_min_ || x > bound_x_max_ || y < bound_y_min_ ||
78 y > bound_y_max_) {
79 (*grid_index) = 0;
80 return false;
81 }
82 uint32_t c = std::min(
83 cols_ - 1, static_cast<uint32_t>((x - bound_x_min_) / resolution_x_));
84 uint32_t r = std::min(
85 rows_ - 1, static_cast<uint32_t>((y - bound_y_min_) / resolution_y_));
86 (*grid_index) = GetIndex(r, c, cols_);
87 return true;
88}
uint32_t GetIndex(uint32_t r, uint32_t c, uint32_t cols)

◆ PointToPlaneDistance()

float apollo::perception::lidar::GroundServiceContent::PointToPlaneDistance ( const Eigen::Vector3d &  world_point) const

在文件 ground_service.cc 第 90 行定义.

91 {
92 uint32_t grid_index = 0;
93 if (!PointToGrid(world_point, &grid_index)) {
94 return std::numeric_limits<float>::max();
95 }
96
97 float offset_pt[3];
98 float params[4];
99 float out = std::numeric_limits<float>::max();
100
101 offset_pt[0] = static_cast<float>(world_point(0) - grid_center_(0));
102 offset_pt[1] = static_cast<float>(world_point(1) - grid_center_(1));
103 offset_pt[2] = static_cast<float>(world_point(2) - grid_center_(2));
104
105 const GroundNode* node = grid_.DataPtr() + grid_index;
106 if (node->confidence > 0.f) {
107 params[0] = node->params(0);
108 params[1] = node->params(1);
109 params[2] = node->params(2);
110 params[3] = node->params(3);
112 }
113 return out;
114}
bool PointToGrid(const Eigen::Vector3d &world_point, uint32_t *grid_index) const
T IPlaneToPointSignedDistanceWUnitNorm(const T *pi, const T *p)
Definition i_plane.h:102

◆ SetContent()

void apollo::perception::lidar::GroundServiceContent::SetContent ( const SceneServiceContent &  content)
overridevirtual

实现了 apollo::perception::lidar::SceneServiceContent.

在文件 ground_service.cc 第 49 行定义.

49 {
50 const GroundServiceContent* ground_content =
51 dynamic_cast<const GroundServiceContent*>(&content);
52 if (ground_content == nullptr) {
53 return;
54 }
55 grid_ = ground_content->grid_;
56 grid_center_ = ground_content->grid_center_;
57 resolution_x_ = ground_content->resolution_x_;
58 resolution_y_ = ground_content->resolution_y_;
59 bound_x_min_ = ground_content->bound_x_min_;
60 bound_y_min_ = ground_content->bound_y_min_;
61 bound_x_max_ = ground_content->bound_x_max_;
62 bound_y_max_ = ground_content->bound_y_max_;
63 rows_ = ground_content->rows_;
64 cols_ = ground_content->cols_;
65
66 service_ready_ = true;
67}

类成员变量说明

◆ bound_x_max_

double apollo::perception::lidar::GroundServiceContent::bound_x_max_ = 0.0

在文件 ground_service.h 第 69 行定义.

◆ bound_x_min_

double apollo::perception::lidar::GroundServiceContent::bound_x_min_ = 0.0

在文件 ground_service.h 第 67 行定义.

◆ bound_y_max_

double apollo::perception::lidar::GroundServiceContent::bound_y_max_ = 0.0

在文件 ground_service.h 第 70 行定义.

◆ bound_y_min_

double apollo::perception::lidar::GroundServiceContent::bound_y_min_ = 0.0

在文件 ground_service.h 第 68 行定义.

◆ cols_

uint32_t apollo::perception::lidar::GroundServiceContent::cols_ = 0

在文件 ground_service.h 第 64 行定义.

◆ grid_

GroundGrid apollo::perception::lidar::GroundServiceContent::grid_

在文件 ground_service.h 第 61 行定义.

◆ grid_center_

Eigen::Vector3d apollo::perception::lidar::GroundServiceContent::grid_center_

在文件 ground_service.h 第 62 行定义.

◆ resolution_x_

double apollo::perception::lidar::GroundServiceContent::resolution_x_ = 0.0

在文件 ground_service.h 第 65 行定义.

◆ resolution_y_

double apollo::perception::lidar::GroundServiceContent::resolution_y_ = 0.0

在文件 ground_service.h 第 66 行定义.

◆ rows_

uint32_t apollo::perception::lidar::GroundServiceContent::rows_ = 0

在文件 ground_service.h 第 63 行定义.


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