Apollo  6.0
Open source self driving car software
Public Member Functions | Protected Attributes | List of all members
apollo::localization::msf::LosslessMapNode Class Reference

#include <lossless_map_node.h>

Inheritance diagram for apollo::localization::msf::LosslessMapNode:
Inheritance graph
Collaboration diagram for apollo::localization::msf::LosslessMapNode:
Collaboration graph

Public Member Functions

 LosslessMapNode ()
 
 ~LosslessMapNode ()
 
void SetValue (const Eigen::Vector3d &coordinate, unsigned char intensity)
 Set the value of a pixel in the map node. More...
 
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. More...
 
void SetValueLayer (const Eigen::Vector3d &coordinate, unsigned char intensity)
 Set the value of a pixel in a layer in the map node. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
unsigned char GetValue (const Eigen::Vector3d &coordinate) const
 Given the 3D global coordinate, get the map cell average intensity. More...
 
float GetVar (const Eigen::Vector3d &coordinate) const
 Given the 3D global coordinate, get the map cell variance of the intensity. More...
 
float GetAlt (const Eigen::Vector3d &coordinate) const
 Given the 3D global coordinate, get the map cell's average altitude. More...
 
float GetAltVar (const Eigen::Vector3d &coordinate) const
 Given the 3D global coordinate, get the map cell's variance of the altitude. More...
 
unsigned int GetCount (const Eigen::Vector3d &coordinate) const
 Given the 3D global coordinate, get the map cell's count of the samples. More...
 
unsigned char GetValue (unsigned int row, unsigned int col) const
 Get the map cell average intensity. More...
 
float GetVar (unsigned int row, unsigned int col) const
 Get the map cell variance of the intensity. More...
 
float GetAlt (unsigned int row, unsigned int col) const
 Get the map cell's average altitude. More...
 
float GetAltVar (unsigned int row, unsigned int col) const
 Get the map cell's variance of the altitude. More...
 
unsigned int GetCount (unsigned int row, unsigned int col) const
 Get the map cell's count of the samples. More...
 
const LosslessMapSingleCellGetFirstMapCell (unsigned int row, unsigned int col) const
 Get the constant map cell given the coordinate. More...
 
LosslessMapSingleCellGetFirstMapCell (unsigned int row, unsigned int col)
 
float GetMinAltitude () const
 Get the min altitude of point cloud in the node. More...
 
void SetMinAltitude (float altitude)
 Set the min altitude of point cloud in the node. More...
 
- Public Member Functions inherited from apollo::localization::msf::BaseMapNode
 BaseMapNode (BaseMapMatrix *matrix, CompressionStrategy *strategy)
 Construct a map node. More...
 
virtual ~BaseMapNode ()
 Destruct a map node. More...
 
virtual void Init (const BaseMapConfig *map_config, const MapNodeIndex &index, bool create_map_cells=true)
 Initialize the map node. Call this function first before use it! More...
 
virtual void InitMapMatrix (const BaseMapConfig *map_config)
 Initialize the map matrix. More...
 
virtual void Finalize ()
 call before deconstruction or reset. More...
 
virtual void ResetMapNode ()
 Reset map cells data. More...
 
bool Save ()
 Save the map node to the disk. More...
 
bool SaveIntensityImage () const
 Save intensity image of node. More...
 
bool Load ()
 Load the map node from the disk. More...
 
bool Load (const char *filename)
 
const BaseMapMatrixGetMapCellMatrix () const
 Set compression strategy. More...
 
BaseMapMatrixGetMapCellMatrix ()
 
const BaseMapConfigGetMapConfig () const
 Get the map settings. More...
 
void SetMapNodeIndex (const MapNodeIndex &index)
 Set the map node index. More...
 
const MapNodeIndexGetMapNodeIndex () const
 Get the map node index. More...
 
void SetIsReserved (bool is_reserved)
 Set if the map node is reserved. More...
 
bool GetIsReserved () const
 Get if the map node is reserved. More...
 
bool GetIsChanged () const
 Get if the map data has changed. More...
 
void SetIsChanged (bool is)
 Set if the map node data has changed. More...
 
bool GetIsReady () const
 Get if the map node data is ready. More...
 
const Eigen::Vector2d & GetLeftTopCorner () const
 Get the left top corner of the map node. More...
 
void SetLeftTopCorner (double x, double y)
 
float GetMapResolution () const
 Get the resolution of this map nodex. More...
 
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. <return> If global coordinate (x, y) belongs to this map node. More...
 
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. More...
 

Protected Attributes

float min_altitude_
 The min altitude of point cloud in the node. More...
 
- Protected Attributes inherited from apollo::localization::msf::BaseMapNode
const BaseMapConfigmap_config_ = nullptr
 The map settings. More...
 
MapNodeIndex index_
 The index of this node. More...
 
Eigen::Vector2d left_top_corner_
 The left top corner of the map node in the global coordinate system. More...
 
BaseMapMatrixmap_matrix_
 The data structure of the map datas, which is a matrix. More...
 
bool is_reserved_ = false
 If the node is reserved in map. More...
 
bool is_changed_ = false
 Has the map node been changed. More...
 
bool data_is_ready_ = false
 
unsigned int file_body_binary_size_ = 0
 The body binary size in file. It's useful when reading and writing files. More...
 
CompressionStrategycompression_strategy_ = nullptr
 
float min_altitude_ = 1e6
 The min altitude of point cloud in the node. More...
 

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ LosslessMapNode()

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

◆ ~LosslessMapNode()

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

Member Function Documentation

◆ GetAlt() [1/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.

◆ GetAlt() [2/3]

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

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

◆ GetAlt() [3/3]

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

Get the map cell's average altitude.

◆ GetAltVar() [1/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.

◆ GetAltVar() [2/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.

◆ 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.

◆ GetCount() [1/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.

◆ GetCount() [2/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.

◆ 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.

◆ GetFirstMapCell() [1/2]

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

Get the constant map cell given the coordinate.

◆ GetFirstMapCell() [2/2]

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

◆ GetMinAltitude()

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

Get the min altitude of point cloud in the node.

◆ GetValue() [1/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.

◆ GetValue() [2/3]

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

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

◆ GetValue() [3/3]

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

Get the map cell average intensity.

◆ GetVar() [1/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.

◆ GetVar() [2/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.

◆ 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.

◆ SetMinAltitude()

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

Set the min altitude of point cloud in the node.

◆ SetValue()

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

Set the value of a pixel in the map node.

Parameters
<coordinate>The 3D global coordinate.
<intensity>The reflectance intensity.

◆ 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.

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

◆ 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.

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

Member Data Documentation

◆ min_altitude_

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

The min altitude of point cloud in the node.


The documentation for this class was generated from the following file: