Apollo 10.0
自动驾驶开放平台
apollo::localization::msf::LosslessMapNode类 参考

#include <lossless_map_node.h>

类 apollo::localization::msf::LosslessMapNode 继承关系图:
apollo::localization::msf::LosslessMapNode 的协作图:

Public 成员函数

 LosslessMapNode ()
 
 ~LosslessMapNode ()
 
void SetValue (const Eigen::Vector3d &coordinate, unsigned char intensity)
 Set the value of a pixel in the map node.
 
bool SetValueIfInBound (const Eigen::Vector3d &coordinate, unsigned char intensity)
 Set the value of a pixel in the map node if the pixel in the node.
 
void SetValueLayer (const Eigen::Vector3d &coordinate, unsigned char intensity)
 Set the value of a pixel in a layer in the map node.
 
void GetValue (const Eigen::Vector3d &coordinate, std::vector< unsigned char > *values) const
 Given the 3D global coordinate, get the map cell average intensity of each layer.
 
void GetVar (const Eigen::Vector3d &coordinate, std::vector< float > *vars) const
 Given the 3D global coordinate, get the map cell variance of the intensity of each layer.
 
void GetAlt (const Eigen::Vector3d &coordinate, std::vector< float > *alts) const
 Given the 3D global coordinate, get the map cell's average altitude of each layer.
 
void GetAltVar (const Eigen::Vector3d &coordinate, std::vector< float > *alt_vars) const
 Given the 3D global coordinate, get the map cell's variance of the altitude of each layer.
 
void GetCount (const Eigen::Vector3d &coordinate, std::vector< unsigned int > *counts) const
 Given the 3D global coordinate, get the map cell's count of the samples of each layer.
 
unsigned char GetValue (const Eigen::Vector3d &coordinate) const
 Given the 3D global coordinate, get the map cell average intensity.
 
float GetVar (const Eigen::Vector3d &coordinate) const
 Given the 3D global coordinate, get the map cell variance of the intensity.
 
float GetAlt (const Eigen::Vector3d &coordinate) const
 Given the 3D global coordinate, get the map cell's average altitude.
 
float GetAltVar (const Eigen::Vector3d &coordinate) const
 Given the 3D global coordinate, get the map cell's variance of the altitude
 
unsigned int GetCount (const Eigen::Vector3d &coordinate) const
 Given the 3D global coordinate, get the map cell's count of the samples.
 
unsigned char GetValue (unsigned int row, unsigned int col) const
 Get the map cell average intensity.
 
float GetVar (unsigned int row, unsigned int col) const
 Get the map cell variance of the intensity.
 
float GetAlt (unsigned int row, unsigned int col) const
 Get the map cell's average altitude.
 
float GetAltVar (unsigned int row, unsigned int col) const
 Get the map cell's variance of the altitude
 
unsigned int GetCount (unsigned int row, unsigned int col) const
 Get the map cell's count of the samples.
 
const LosslessMapSingleCellGetFirstMapCell (unsigned int row, unsigned int col) const
 Get the constant map cell given the coordinate.
 
LosslessMapSingleCellGetFirstMapCell (unsigned int row, unsigned int col)
 
float GetMinAltitude () const
 Get the min altitude of point cloud in the node.
 
void SetMinAltitude (float altitude)
 Set the min altitude of point cloud in the node.
 
- Public 成员函数 继承自 apollo::localization::msf::BaseMapNode
 BaseMapNode (BaseMapMatrix *matrix, CompressionStrategy *strategy)
 Construct a map node.
 
virtual ~BaseMapNode ()
 Destruct a map node.
 
virtual void Init (const BaseMapConfig *map_config, const MapNodeIndex &index, bool create_map_cells=true)
 Initialize the map node.
 
virtual void InitMapMatrix (const BaseMapConfig *map_config)
 Initialize the map matrix.
 
virtual void Finalize ()
 call before deconstruction or reset.
 
virtual void ResetMapNode ()
 Reset map cells data.
 
bool Save ()
 Save the map node to the disk.
 
bool SaveIntensityImage () const
 Save intensity image of node.
 
bool Load ()
 Load the map node from the disk.
 
bool Load (const char *filename)
 
const BaseMapMatrixGetMapCellMatrix () const
 Get map cell matrix.
 
BaseMapMatrixGetMapCellMatrix ()
 
const BaseMapConfigGetMapConfig () const
 Get the map settings.
 
void SetMapNodeIndex (const MapNodeIndex &index)
 Set the map node index.
 
const MapNodeIndexGetMapNodeIndex () const
 Get the map node index.
 
void SetIsReserved (bool is_reserved)
 Set if the map node is reserved.
 
bool GetIsReserved () const
 Get if the map node is reserved.
 
bool GetIsChanged () const
 Get if the map data has changed.
 
void SetIsChanged (bool is)
 Set if the map node data has changed.
 
bool GetIsReady () const
 Get if the map node data is ready
 
const Eigen::Vector2d & GetLeftTopCorner () const
 Get the left top corner of the map node.
 
void SetLeftTopCorner (double x, double y)
 
float GetMapResolution () const
 Get the resolution of this map nodex.
 
bool GetCoordinate (const Eigen::Vector2d &coordinate, unsigned int *x, unsigned int *y) const
 Given the global coordinate, get the local 2D coordinate of the map cell matrix.
 
bool GetCoordinate (const Eigen::Vector3d &coordinate, unsigned int *x, unsigned int *y) const
 
Eigen::Vector2d GetCoordinate (unsigned int x, unsigned int y) const
 Given the local 2D coordinate, return the global coordinate, eigen version.
 

Protected 属性

float min_altitude_
 The min altitude of point cloud in the node.
 
- Protected 属性 继承自 apollo::localization::msf::BaseMapNode
const BaseMapConfigmap_config_ = nullptr
 The map settings.
 
MapNodeIndex index_
 The index of this node.
 
Eigen::Vector2d left_top_corner_
 The left top corner of the map node in the global coordinate system.
 
BaseMapMatrixmap_matrix_
 The data structure of the map datas, which is a matrix.
 
bool is_reserved_ = false
 If the node is reserved in map.
 
bool is_changed_ = false
 Has the map node been changed.
 
bool data_is_ready_ = false
 
unsigned int file_body_binary_size_ = 0
 The body binary size in file.
 
CompressionStrategycompression_strategy_ = nullptr
 @bried The compression strategy.
 
float min_altitude_ = 1e6
 The min altitude of point cloud in the node.
 

额外继承的成员函数

- 静态 Public 成员函数 继承自 apollo::localization::msf::BaseMapNode
static Eigen::Vector2d GetLeftTopCorner (const BaseMapConfig &option, const MapNodeIndex &index)
 
- Protected 成员函数 继承自 apollo::localization::msf::BaseMapNode
virtual unsigned int LoadBinary (FILE *file)
 Load the map cell from a binary chunk.
 
virtual unsigned int CreateBinary (FILE *file) const
 Create the binary.
 
virtual unsigned int GetBinarySize () const
 Get the binary size of the object.
 
virtual unsigned int LoadHeaderBinary (unsigned char *buf)
 Load the map node header from a binary chunk.
 
virtual unsigned int CreateHeaderBinary (unsigned char *buf, unsigned int buf_size) const
 Create the binary header.
 
virtual unsigned int GetHeaderBinarySize () const
 Get the size of the header in bytes.
 
virtual unsigned int LoadBodyBinary (std::vector< unsigned char > *buf)
 Load the map node body from a binary chunk.
 
virtual unsigned int CreateBodyBinary (std::vector< unsigned char > *buf) const
 Create the binary body.
 
virtual unsigned int GetBodyBinarySize () const
 Get the size of the body in bytes.
 
bool SaveIntensityImage (const std::string &path) const
 Save intensity image of node.
 

详细描述

在文件 lossless_map_node.h28 行定义.

构造及析构函数说明

◆ LosslessMapNode()

apollo::localization::msf::LosslessMapNode::LosslessMapNode ( )

在文件 lossless_map_node.cc25 行定义.

26 : BaseMapNode(new LosslessMapMatrix(), new ZlibStrategy()) {}
BaseMapNode(BaseMapMatrix *matrix, CompressionStrategy *strategy)
Construct a map node.

◆ ~LosslessMapNode()

apollo::localization::msf::LosslessMapNode::~LosslessMapNode ( )

在文件 lossless_map_node.cc28 行定义.

28{}

成员函数说明

◆ GetAlt() [1/3]

float apollo::localization::msf::LosslessMapNode::GetAlt ( const Eigen::Vector3d &  coordinate) const

Given the 3D global coordinate, get the map cell's average altitude.

在文件 lossless_map_node.cc164 行定义.

164 {
165 Eigen::Vector2d coord2d(coordinate[0], coordinate[1]);
166 unsigned int x = 0;
167 unsigned int y = 0;
168 bool is_success = GetCoordinate(coord2d, &x, &y);
169 DCHECK(is_success);
170 LosslessMapCell& map_cell =
171 static_cast<LosslessMapMatrix*>(map_matrix_)->GetMapCell(y, x);
172 return map_cell.GetAlt();
173}
BaseMapMatrix * map_matrix_
The data structure of the map datas, which is a matrix.
bool GetCoordinate(const Eigen::Vector2d &coordinate, unsigned int *x, unsigned int *y) const
Given the global coordinate, get the local 2D coordinate of the map cell matrix.

◆ GetAlt() [2/3]

void apollo::localization::msf::LosslessMapNode::GetAlt ( const Eigen::Vector3d &  coordinate,
std::vector< float > *  alts 
) const

Given the 3D global coordinate, get the map cell's average altitude of each layer.

在文件 lossless_map_node.cc105 行定义.

106 {
107 Eigen::Vector2d coord2d(coordinate[0], coordinate[1]);
108 unsigned int x = 0;
109 unsigned int y = 0;
110 bool is_success = GetCoordinate(coord2d, &x, &y);
111 DCHECK(is_success);
112 LosslessMapCell& map_cell =
113 static_cast<LosslessMapMatrix*>(map_matrix_)->GetMapCell(y, x);
114 map_cell.GetAlt(alts);
115}

◆ GetAlt() [3/3]

float apollo::localization::msf::LosslessMapNode::GetAlt ( unsigned int  row,
unsigned int  col 
) const
inline

Get the map cell's average altitude.

在文件 lossless_map_node.h100 行定义.

100 {
101 return static_cast<LosslessMapMatrix*>(map_matrix_)
102 ->GetMapCell(row, col)
103 .GetAlt();
104 }

◆ GetAltVar() [1/3]

float apollo::localization::msf::LosslessMapNode::GetAltVar ( const Eigen::Vector3d &  coordinate) const

Given the 3D global coordinate, get the map cell's variance of the altitude

在文件 lossless_map_node.cc175 行定义.

175 {
176 Eigen::Vector2d coord2d(coordinate[0], coordinate[1]);
177 unsigned int x = 0;
178 unsigned int y = 0;
179 bool is_success = GetCoordinate(coord2d, &x, &y);
180 DCHECK(is_success);
181 LosslessMapCell& map_cell =
182 static_cast<LosslessMapMatrix*>(map_matrix_)->GetMapCell(y, x);
183 return map_cell.GetAltVar();
184}

◆ GetAltVar() [2/3]

void apollo::localization::msf::LosslessMapNode::GetAltVar ( const Eigen::Vector3d &  coordinate,
std::vector< float > *  alt_vars 
) const

Given the 3D global coordinate, get the map cell's variance of the altitude of each layer.

在文件 lossless_map_node.cc117 行定义.

118 {
119 Eigen::Vector2d coord2d(coordinate[0], coordinate[1]);
120 unsigned int x = 0;
121 unsigned int y = 0;
122 bool is_success = GetCoordinate(coord2d, &x, &y);
123 DCHECK(is_success);
124 LosslessMapCell& map_cell =
125 static_cast<LosslessMapMatrix*>(map_matrix_)->GetMapCell(y, x);
126 map_cell.GetAltVar(alt_vars);
127}

◆ GetAltVar() [3/3]

float apollo::localization::msf::LosslessMapNode::GetAltVar ( unsigned int  row,
unsigned int  col 
) const
inline

Get the map cell's variance of the altitude

在文件 lossless_map_node.h106 行定义.

106 {
107 return static_cast<LosslessMapMatrix*>(map_matrix_)
108 ->GetMapCell(row, col)
109 .GetAltVar();
110 }

◆ GetCount() [1/3]

unsigned int apollo::localization::msf::LosslessMapNode::GetCount ( const Eigen::Vector3d &  coordinate) const

Given the 3D global coordinate, get the map cell's count of the samples.

在文件 lossless_map_node.cc186 行定义.

187 {
188 Eigen::Vector2d coord2d(coordinate[0], coordinate[1]);
189 unsigned int x = 0;
190 unsigned int y = 0;
191 bool is_success = GetCoordinate(coord2d, &x, &y);
192 DCHECK(is_success);
193 LosslessMapCell& map_cell =
194 static_cast<LosslessMapMatrix*>(map_matrix_)->GetMapCell(y, x);
195 return map_cell.GetCount();
196}

◆ GetCount() [2/3]

void apollo::localization::msf::LosslessMapNode::GetCount ( const Eigen::Vector3d &  coordinate,
std::vector< unsigned int > *  counts 
) const

Given the 3D global coordinate, get the map cell's count of the samples of each layer.

在文件 lossless_map_node.cc129 行定义.

130 {
131 Eigen::Vector2d coord2d(coordinate[0], coordinate[1]);
132 unsigned int x = 0;
133 unsigned int y = 0;
134 bool is_success = GetCoordinate(coord2d, &x, &y);
135 DCHECK(is_success);
136 LosslessMapCell& map_cell =
137 static_cast<LosslessMapMatrix*>(map_matrix_)->GetMapCell(y, x);
138 map_cell.GetCount(counts);
139}

◆ GetCount() [3/3]

unsigned int apollo::localization::msf::LosslessMapNode::GetCount ( unsigned int  row,
unsigned int  col 
) const
inline

Get the map cell's count of the samples.

在文件 lossless_map_node.h112 行定义.

112 {
113 return static_cast<LosslessMapMatrix*>(map_matrix_)
114 ->GetMapCell(row, col)
115 .GetCount();
116 }

◆ GetFirstMapCell() [1/2]

LosslessMapSingleCell & apollo::localization::msf::LosslessMapNode::GetFirstMapCell ( unsigned int  row,
unsigned int  col 
)
inline

在文件 lossless_map_node.h124 行定义.

125 {
126 return static_cast<LosslessMapMatrix*>(map_matrix_)
127 ->GetMapCell(row, col)
128 .map_cells[0];
129 }

◆ GetFirstMapCell() [2/2]

const LosslessMapSingleCell & apollo::localization::msf::LosslessMapNode::GetFirstMapCell ( unsigned int  row,
unsigned int  col 
) const
inline

Get the constant map cell given the coordinate.

在文件 lossless_map_node.h118 行定义.

119 {
120 return static_cast<LosslessMapMatrix*>(map_matrix_)
121 ->GetMapCell(row, col)
122 .map_cells[0];
123 }

◆ GetMinAltitude()

float apollo::localization::msf::LosslessMapNode::GetMinAltitude ( ) const
inline

Get the min altitude of point cloud in the node.

在文件 lossless_map_node.h132 行定义.

132{ return min_altitude_; }
float min_altitude_
The min altitude of point cloud in the node.

◆ GetValue() [1/3]

unsigned char apollo::localization::msf::LosslessMapNode::GetValue ( const Eigen::Vector3d &  coordinate) const

Given the 3D global coordinate, get the map cell average intensity.

在文件 lossless_map_node.cc141 行定义.

142 {
143 Eigen::Vector2d coord2d(coordinate[0], coordinate[1]);
144 unsigned int x = 0;
145 unsigned int y = 0;
146 bool is_success = GetCoordinate(coord2d, &x, &y);
147 DCHECK(is_success);
148 LosslessMapCell& map_cell =
149 static_cast<LosslessMapMatrix*>(map_matrix_)->GetMapCell(y, x);
150 return map_cell.GetValue();
151}

◆ GetValue() [2/3]

void apollo::localization::msf::LosslessMapNode::GetValue ( const Eigen::Vector3d &  coordinate,
std::vector< unsigned char > *  values 
) const

Given the 3D global coordinate, get the map cell average intensity of each layer.

在文件 lossless_map_node.cc81 行定义.

82 {
83 Eigen::Vector2d coord2d(coordinate[0], coordinate[1]);
84 unsigned int x = 0;
85 unsigned int y = 0;
86 bool is_success = GetCoordinate(coord2d, &x, &y);
87 DCHECK(is_success);
88 LosslessMapCell& map_cell =
89 static_cast<LosslessMapMatrix*>(map_matrix_)->GetMapCell(y, x);
90 map_cell.GetValue(values);
91}

◆ GetValue() [3/3]

unsigned char apollo::localization::msf::LosslessMapNode::GetValue ( unsigned int  row,
unsigned int  col 
) const
inline

Get the map cell average intensity.

在文件 lossless_map_node.h88 行定义.

88 {
89 return static_cast<LosslessMapMatrix*>(map_matrix_)
90 ->GetMapCell(row, col)
91 .GetValue();
92 }

◆ GetVar() [1/3]

float apollo::localization::msf::LosslessMapNode::GetVar ( const Eigen::Vector3d &  coordinate) const

Given the 3D global coordinate, get the map cell variance of the intensity.

在文件 lossless_map_node.cc153 行定义.

153 {
154 Eigen::Vector2d coord2d(coordinate[0], coordinate[1]);
155 unsigned int x = 0;
156 unsigned int y = 0;
157 bool is_success = GetCoordinate(coord2d, &x, &y);
158 DCHECK(is_success);
159 LosslessMapCell& map_cell =
160 static_cast<LosslessMapMatrix*>(map_matrix_)->GetMapCell(y, x);
161 return map_cell.GetVar();
162}

◆ GetVar() [2/3]

void apollo::localization::msf::LosslessMapNode::GetVar ( const Eigen::Vector3d &  coordinate,
std::vector< float > *  vars 
) const

Given the 3D global coordinate, get the map cell variance of the intensity of each layer.

在文件 lossless_map_node.cc93 行定义.

94 {
95 Eigen::Vector2d coord2d(coordinate[0], coordinate[1]);
96 unsigned int x = 0;
97 unsigned int y = 0;
98 bool is_success = GetCoordinate(coord2d, &x, &y);
99 DCHECK(is_success);
100 LosslessMapCell& map_cell =
101 static_cast<LosslessMapMatrix*>(map_matrix_)->GetMapCell(y, x);
102 map_cell.GetVar(vars);
103}

◆ GetVar() [3/3]

float apollo::localization::msf::LosslessMapNode::GetVar ( unsigned int  row,
unsigned int  col 
) const
inline

Get the map cell variance of the intensity.

在文件 lossless_map_node.h94 行定义.

94 {
95 return static_cast<LosslessMapMatrix*>(map_matrix_)
96 ->GetMapCell(row, col)
97 .GetVar();
98 }

◆ SetMinAltitude()

void apollo::localization::msf::LosslessMapNode::SetMinAltitude ( float  altitude)
inline

Set the min altitude of point cloud in the node.

在文件 lossless_map_node.h134 行定义.

134{ min_altitude_ = altitude; }

◆ SetValue()

void apollo::localization::msf::LosslessMapNode::SetValue ( const Eigen::Vector3d &  coordinate,
unsigned char  intensity 
)

Set the value of a pixel in the map node.

参数
<coordinate>The 3D global coordinate.
<intensity>The reflectance intensity.

在文件 lossless_map_node.cc30 行定义.

31 {
32 Eigen::Vector2d coord2d(coordinate[0], coordinate[1]);
33 unsigned int x = 0;
34 unsigned int y = 0;
35 bool is_success = GetCoordinate(coord2d, &x, &y);
36 DCHECK(is_success);
37 LosslessMapCell& map_cell =
38 static_cast<LosslessMapMatrix*>(map_matrix_)->GetMapCell(y, x);
39 map_cell.SetValue(coordinate[2], intensity);
40 if (min_altitude_ > coordinate[2]) {
41 min_altitude_ = static_cast<float>(coordinate[2]);
42 }
43 is_changed_ = true;
44}
bool is_changed_
Has the map node been changed.

◆ SetValueIfInBound()

bool apollo::localization::msf::LosslessMapNode::SetValueIfInBound ( const Eigen::Vector3d &  coordinate,
unsigned char  intensity 
)

Set the value of a pixel in the map node if the pixel in the node.

参数
<coordinate>The 3D global coordinate.
<intensity>The reflectance intensity.
<return>True, if pixel in the bound of the node, else False.

在文件 lossless_map_node.cc46 行定义.

47 {
48 Eigen::Vector2d coord2d(coordinate[0], coordinate[1]);
49 unsigned int x = 0;
50 unsigned int y = 0;
51 bool is_success = GetCoordinate(coord2d, &x, &y);
52 if (is_success) {
53 LosslessMapCell& map_cell =
54 static_cast<LosslessMapMatrix*>(map_matrix_)->GetMapCell(y, x);
55 map_cell.SetValue(coordinate[2], intensity);
56 if (min_altitude_ > coordinate[2]) {
57 min_altitude_ = static_cast<float>(coordinate[2]);
58 }
59 is_changed_ = true;
60 return true;
61 } else {
62 return false;
63 }
64}

◆ SetValueLayer()

void apollo::localization::msf::LosslessMapNode::SetValueLayer ( const Eigen::Vector3d &  coordinate,
unsigned char  intensity 
)

Set the value of a pixel in a layer in the map node.

参数
<coordinate>The 3D global coordinate. The z is used as the altitude for the layer match.
<intensity>The reflectance intensity.

在文件 lossless_map_node.cc66 行定义.

67 {
68 Eigen::Vector2d coord2d(coordinate[0], coordinate[1]);
69 unsigned int x = 0;
70 unsigned int y = 0;
71 bool is_success = GetCoordinate(coord2d, &x, &y);
72 DCHECK(is_success);
73 LosslessMapCell& map_cell =
74 static_cast<LosslessMapMatrix*>(map_matrix_)->GetMapCell(y, x);
75 map_cell.SetValueLayer(
76 coordinate[2], intensity,
77 static_cast<const LosslessMapConfig*>(map_config_)->map_layer_alt_thres_);
78 is_changed_ = true;
79}
const BaseMapConfig * map_config_
The map settings.

类成员变量说明

◆ min_altitude_

float apollo::localization::msf::LosslessMapNode::min_altitude_
protected

The min altitude of point cloud in the node.

在文件 lossless_map_node.h138 行定义.


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