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

The data structure of a Node in the map. More...

#include <base_map_node.h>

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

Public Member Functions

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

Static Public Member Functions

static Eigen::Vector2d GetLeftTopCorner (const BaseMapConfig &option, const MapNodeIndex &index)
 

Protected Member Functions

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

Protected Attributes

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

Detailed Description

The data structure of a Node in the map.

Constructor & Destructor Documentation

◆ BaseMapNode()

apollo::localization::msf::BaseMapNode::BaseMapNode ( BaseMapMatrix matrix,
CompressionStrategy strategy 
)

Construct a map node.

◆ ~BaseMapNode()

virtual apollo::localization::msf::BaseMapNode::~BaseMapNode ( )
virtual

Destruct a map node.

Member Function Documentation

◆ CreateBinary()

virtual unsigned int apollo::localization::msf::BaseMapNode::CreateBinary ( FILE *  file) const
protectedvirtual

Create the binary. Serialization of the object.

Parameters
<return>The the used size of binary is returned.

◆ CreateBodyBinary()

virtual unsigned int apollo::localization::msf::BaseMapNode::CreateBodyBinary ( std::vector< unsigned char > *  buf) const
protectedvirtual

Create the binary body.

Parameters
<buf,buf_size>The buffer and its size.
<return>The required or the used size of is returned.

◆ CreateHeaderBinary()

virtual unsigned int apollo::localization::msf::BaseMapNode::CreateHeaderBinary ( unsigned char *  buf,
unsigned int  buf_size 
) const
protectedvirtual

Create the binary header.

Parameters
<buf,buf_size>The buffer and its size.
<return>The required or the used size of is returned.

◆ Finalize()

virtual void apollo::localization::msf::BaseMapNode::Finalize ( )
virtual

call before deconstruction or reset.

◆ GetBinarySize()

virtual unsigned int apollo::localization::msf::BaseMapNode::GetBinarySize ( ) const
protectedvirtual

Get the binary size of the object.

◆ GetBodyBinarySize()

virtual unsigned int apollo::localization::msf::BaseMapNode::GetBodyBinarySize ( ) const
protectedvirtual

Get the size of the body in bytes.

◆ GetCoordinate() [1/3]

bool apollo::localization::msf::BaseMapNode::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.

Given the local 2D coordinate, return the global coordinate. 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, eigen version.

◆ GetCoordinate() [2/3]

bool apollo::localization::msf::BaseMapNode::GetCoordinate ( const Eigen::Vector3d &  coordinate,
unsigned int *  x,
unsigned int *  y 
) const

◆ GetCoordinate() [3/3]

Eigen::Vector2d apollo::localization::msf::BaseMapNode::GetCoordinate ( unsigned int  x,
unsigned int  y 
) const

Given the local 2D coordinate, return the global coordinate, eigen version.

◆ GetHeaderBinarySize()

virtual unsigned int apollo::localization::msf::BaseMapNode::GetHeaderBinarySize ( ) const
protectedvirtual

Get the size of the header in bytes.

◆ GetIsChanged()

bool apollo::localization::msf::BaseMapNode::GetIsChanged ( ) const
inline

Get if the map data has changed.

◆ GetIsReady()

bool apollo::localization::msf::BaseMapNode::GetIsReady ( ) const
inline

Get if the map node data is ready.

◆ GetIsReserved()

bool apollo::localization::msf::BaseMapNode::GetIsReserved ( ) const
inline

Get if the map node is reserved.

◆ GetLeftTopCorner() [1/2]

const Eigen::Vector2d& apollo::localization::msf::BaseMapNode::GetLeftTopCorner ( ) const
inline

Get the left top corner of the map node.

◆ GetLeftTopCorner() [2/2]

static Eigen::Vector2d apollo::localization::msf::BaseMapNode::GetLeftTopCorner ( const BaseMapConfig option,
const MapNodeIndex index 
)
static

◆ GetMapCellMatrix() [1/2]

const BaseMapMatrix& apollo::localization::msf::BaseMapNode::GetMapCellMatrix ( ) const
inline

Set compression strategy.

Get map cell matrix.

◆ GetMapCellMatrix() [2/2]

BaseMapMatrix& apollo::localization::msf::BaseMapNode::GetMapCellMatrix ( )
inline

◆ GetMapConfig()

const BaseMapConfig& apollo::localization::msf::BaseMapNode::GetMapConfig ( ) const
inline

Get the map settings.

◆ GetMapNodeIndex()

const MapNodeIndex& apollo::localization::msf::BaseMapNode::GetMapNodeIndex ( ) const
inline

Get the map node index.

◆ GetMapResolution()

float apollo::localization::msf::BaseMapNode::GetMapResolution ( ) const
inline

Get the resolution of this map nodex.

◆ Init()

virtual void apollo::localization::msf::BaseMapNode::Init ( const BaseMapConfig map_config,
const MapNodeIndex index,
bool  create_map_cells = true 
)
virtual

Initialize the map node. Call this function first before use it!

◆ InitMapMatrix()

virtual void apollo::localization::msf::BaseMapNode::InitMapMatrix ( const BaseMapConfig map_config)
virtual

Initialize the map matrix.

◆ Load() [1/2]

bool apollo::localization::msf::BaseMapNode::Load ( )

Load the map node from the disk.

◆ Load() [2/2]

bool apollo::localization::msf::BaseMapNode::Load ( const char *  filename)

◆ LoadBinary()

virtual unsigned int apollo::localization::msf::BaseMapNode::LoadBinary ( FILE *  file)
protectedvirtual

Load the map cell from a binary chunk.

Parameters
<return>The size read (the real size of object).

◆ LoadBodyBinary()

virtual unsigned int apollo::localization::msf::BaseMapNode::LoadBodyBinary ( std::vector< unsigned char > *  buf)
protectedvirtual

Load the map node body from a binary chunk.

Parameters
<return>The size read (the real size of body).

◆ LoadHeaderBinary()

virtual unsigned int apollo::localization::msf::BaseMapNode::LoadHeaderBinary ( unsigned char *  buf)
protectedvirtual

Load the map node header from a binary chunk.

Parameters
<return>The size read (the real size of header).

◆ ResetMapNode()

virtual void apollo::localization::msf::BaseMapNode::ResetMapNode ( )
virtual

Reset map cells data.

◆ Save()

bool apollo::localization::msf::BaseMapNode::Save ( )

Save the map node to the disk.

◆ SaveIntensityImage() [1/2]

bool apollo::localization::msf::BaseMapNode::SaveIntensityImage ( ) const

Save intensity image of node.

◆ SaveIntensityImage() [2/2]

bool apollo::localization::msf::BaseMapNode::SaveIntensityImage ( const std::string &  path) const
protected

Save intensity image of node.

◆ SetIsChanged()

void apollo::localization::msf::BaseMapNode::SetIsChanged ( bool  is)
inline

Set if the map node data has changed.

◆ SetIsReserved()

void apollo::localization::msf::BaseMapNode::SetIsReserved ( bool  is_reserved)
inline

Set if the map node is reserved.

◆ SetLeftTopCorner()

void apollo::localization::msf::BaseMapNode::SetLeftTopCorner ( double  x,
double  y 
)
inline

◆ SetMapNodeIndex()

void apollo::localization::msf::BaseMapNode::SetMapNodeIndex ( const MapNodeIndex index)
inline

Set the map node index.

Member Data Documentation

◆ compression_strategy_

CompressionStrategy* apollo::localization::msf::BaseMapNode::compression_strategy_ = nullptr
protected

The compression strategy.

◆ data_is_ready_

bool apollo::localization::msf::BaseMapNode::data_is_ready_ = false
protected

◆ file_body_binary_size_

unsigned int apollo::localization::msf::BaseMapNode::file_body_binary_size_ = 0
mutableprotected

The body binary size in file. It's useful when reading and writing files.

◆ index_

MapNodeIndex apollo::localization::msf::BaseMapNode::index_
protected

The index of this node.

◆ is_changed_

bool apollo::localization::msf::BaseMapNode::is_changed_ = false
protected

Has the map node been changed.

◆ is_reserved_

bool apollo::localization::msf::BaseMapNode::is_reserved_ = false
protected

If the node is reserved in map.

◆ left_top_corner_

Eigen::Vector2d apollo::localization::msf::BaseMapNode::left_top_corner_
protected

The left top corner of the map node in the global coordinate system.

◆ map_config_

const BaseMapConfig* apollo::localization::msf::BaseMapNode::map_config_ = nullptr
protected

The map settings.

◆ map_matrix_

BaseMapMatrix* apollo::localization::msf::BaseMapNode::map_matrix_
protected

The data structure of the map datas, which is a matrix.

◆ min_altitude_

float apollo::localization::msf::BaseMapNode::min_altitude_ = 1e6
protected

The min altitude of point cloud in the node.


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