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::pyramid_map::BaseMapNode Class Referenceabstract

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

#include <base_map_node.h>

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

Public Member Functions

 BaseMapNode ()
 Construct a map node. More...
 
 BaseMapNode (BaseMapMatrix *matrix, CompressionStrategy *strategy)
 Construct a map node. More...
 
virtual ~BaseMapNode ()
 Destruct a map node. More...
 
virtual void Init (const BaseMapConfig *map_config)=0
 Initialize the map node. Call this function first before use it! More...
 
virtual void Init (const BaseMapConfig *map_config, const MapNodeIndex &index, bool create_map_cells=true)=0
 
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 SaveAltitudeImage () const
 Save altitude image of node. More...
 
bool Load ()
 Load the map node from the disk. More...
 
bool Load (const char *filename)
 
virtual 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...
 
virtual bool GetCoordinate (const Eigen::Vector3d &coordinate, unsigned int *x, unsigned int *y) const
 
virtual Eigen::Vector2d GetCoordinate (unsigned int x, unsigned int y) const
 Given the local 2D coordinate, return the global coordinate. More...
 
void SetMapNodeIndex (const MapNodeIndex &index)
 Set the map node index. More...
 
bool SaveIntensityImage (const std::string &path) const
 Save intensity image of node. More...
 
bool SaveAltitudeImage (const std::string &path) const
 Save altitude image of node. More...
 
const BaseMapMatrixGetMapCellMatrix () const
 Get map cell matrix. More...
 
BaseMapMatrixGetMapCellMatrix ()
 
const BaseMapConfigGetMapConfig () const
 Get the map settings. More...
 
const BaseMapNodeConfigGetMapNodeConfig () const
 Get the map node config. 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
 
void SetLeftTopCorner (double x, double y)
 Set the left top corner of the map node. More...
 
float GetMapResolution () const
 Get the resolution of this map nodex. More...
 

Static Public Member Functions

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

Protected Member Functions

bool CreateMapDirectory (const std::string &path) const
 Try to create the map directory. More...
 
bool CreateMapDirectoryRecursively (const std::vector< std::string > &paths) const
 Try to create the map directory recursively. More...
 
bool CheckMapDirectoryRecursively (const std::vector< std::string > &paths) const
 Try to check the map directory recursively. More...
 
virtual bool LoadBinary (FILE *file)
 Load the map cell from a binary chunk. More...
 
virtual bool CreateBinary (FILE *file) const
 Create the binary. Serialization of the object. More...
 
virtual size_t GetBinarySize () const
 Get the binary size of the object. More...
 
virtual size_t LoadHeaderBinary (const unsigned char *buf)
 Load the map node header from a binary chunk. More...
 
virtual size_t CreateHeaderBinary (unsigned char *buf, size_t buf_size) const
 Create the binary header. More...
 
virtual size_t GetHeaderBinarySize () const
 Get the size of the header in bytes. More...
 
virtual size_t LoadBodyBinary (std::vector< unsigned char > *buf)
 Load the map node body from a binary chunk. More...
 
virtual size_t CreateBodyBinary (std::vector< unsigned char > *buf) const
 Create the binary body. More...
 
virtual size_t GetBodyBinarySize () const
 Get the size of the body in bytes. 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...
 
std::shared_ptr< BaseMapNodeConfigmap_node_config_ = nullptr
 The map node config. More...
 
std::shared_ptr< BaseMapMatrixmap_matrix_ = nullptr
 The data structure of the map datas, which is a matrix. More...
 
std::shared_ptr< BaseMapMatrixHandlermap_matrix_handler_ = nullptr
 The class to load and create map matrix binary. 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
 
size_t file_body_binary_size_ = 0
 The body binary size in file. More...
 
size_t uncompressed_file_body_size_ = 0
 
std::shared_ptr< CompressionStrategycompression_strategy_ = nullptr
 

Detailed Description

The data structure of a Node in the map.

Constructor & Destructor Documentation

◆ BaseMapNode() [1/2]

apollo::localization::msf::pyramid_map::BaseMapNode::BaseMapNode ( )

Construct a map node.

◆ BaseMapNode() [2/2]

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

Construct a map node.

◆ ~BaseMapNode()

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

Destruct a map node.

Member Function Documentation

◆ CheckMapDirectoryRecursively()

bool apollo::localization::msf::pyramid_map::BaseMapNode::CheckMapDirectoryRecursively ( const std::vector< std::string > &  paths) const
protected

Try to check the map directory recursively.

◆ ComputeLeftTopCorner()

static Eigen::Vector2d apollo::localization::msf::pyramid_map::BaseMapNode::ComputeLeftTopCorner ( const BaseMapConfig config,
const MapNodeIndex index 
)
static

◆ CreateBinary()

virtual bool apollo::localization::msf::pyramid_map::BaseMapNode::CreateBinary ( FILE *  file) const
protectedvirtual

Create the binary. Serialization of the object.

◆ CreateBodyBinary()

virtual size_t apollo::localization::msf::pyramid_map::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 size_t apollo::localization::msf::pyramid_map::BaseMapNode::CreateHeaderBinary ( unsigned char *  buf,
size_t  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.

◆ CreateMapDirectory()

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

Try to create the map directory.

◆ CreateMapDirectoryRecursively()

bool apollo::localization::msf::pyramid_map::BaseMapNode::CreateMapDirectoryRecursively ( const std::vector< std::string > &  paths) const
protected

Try to create the map directory recursively.

◆ Finalize()

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

call before deconstruction or reset.

◆ GetBinarySize()

virtual size_t apollo::localization::msf::pyramid_map::BaseMapNode::GetBinarySize ( ) const
protectedvirtual

Get the binary size of the object.

◆ GetBodyBinarySize()

virtual size_t apollo::localization::msf::pyramid_map::BaseMapNode::GetBodyBinarySize ( ) const
protectedvirtual

Get the size of the body in bytes.

◆ GetCoordinate() [1/3]

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

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.

Reimplemented in apollo::localization::msf::pyramid_map::PyramidMapNode.

◆ GetCoordinate() [2/3]

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

◆ GetCoordinate() [3/3]

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

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

Reimplemented in apollo::localization::msf::pyramid_map::PyramidMapNode.

◆ GetHeaderBinarySize()

virtual size_t apollo::localization::msf::pyramid_map::BaseMapNode::GetHeaderBinarySize ( ) const
protectedvirtual

Get the size of the header in bytes.

◆ GetIsChanged()

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

Get if the map data has changed.

◆ GetIsReady()

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

Get if the map node data is ready.

◆ GetIsReserved()

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

Get if the map node is reserved.

◆ GetLeftTopCorner() [1/2]

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

◆ GetLeftTopCorner() [2/2]

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

◆ GetMapCellMatrix() [1/2]

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

Get map cell matrix.

◆ GetMapCellMatrix() [2/2]

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

◆ GetMapConfig()

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

Get the map settings.

◆ GetMapNodeConfig()

const BaseMapNodeConfig& apollo::localization::msf::pyramid_map::BaseMapNode::GetMapNodeConfig ( ) const
inline

Get the map node config.

◆ GetMapNodeIndex()

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

Get the map node index.

◆ GetMapResolution()

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

Get the resolution of this map nodex.

◆ Init() [1/2]

virtual void apollo::localization::msf::pyramid_map::BaseMapNode::Init ( const BaseMapConfig map_config)
pure virtual

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

Implemented in apollo::localization::msf::pyramid_map::NdtMapNode, and apollo::localization::msf::pyramid_map::PyramidMapNode.

◆ Init() [2/2]

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

◆ InitMapMatrix()

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

Initialize the map matrix.

◆ Load() [1/2]

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

Load the map node from the disk.

◆ Load() [2/2]

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

◆ LoadBinary()

virtual bool apollo::localization::msf::pyramid_map::BaseMapNode::LoadBinary ( FILE *  file)
protectedvirtual

Load the map cell from a binary chunk.

◆ LoadBodyBinary()

virtual size_t apollo::localization::msf::pyramid_map::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 size_t apollo::localization::msf::pyramid_map::BaseMapNode::LoadHeaderBinary ( const 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::pyramid_map::BaseMapNode::ResetMapNode ( )
virtual

Reset map cells data.

◆ Save()

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

Save the map node to the disk.

◆ SaveAltitudeImage() [1/2]

bool apollo::localization::msf::pyramid_map::BaseMapNode::SaveAltitudeImage ( ) const

Save altitude image of node.

◆ SaveAltitudeImage() [2/2]

bool apollo::localization::msf::pyramid_map::BaseMapNode::SaveAltitudeImage ( const std::string &  path) const

Save altitude image of node.

◆ SaveIntensityImage() [1/2]

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

Save intensity image of node.

◆ SaveIntensityImage() [2/2]

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

Save intensity image of node.

◆ SetIsChanged()

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

Set if the map node data has changed.

◆ SetIsReserved()

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

Set if the map node is reserved.

◆ SetLeftTopCorner()

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

Set the left top corner of the map node.

◆ SetMapNodeIndex()

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

Set the map node index.

Member Data Documentation

◆ compression_strategy_

std::shared_ptr<CompressionStrategy> apollo::localization::msf::pyramid_map::BaseMapNode::compression_strategy_ = nullptr
protected

The compression strategy.

◆ data_is_ready_

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

◆ file_body_binary_size_

size_t apollo::localization::msf::pyramid_map::BaseMapNode::file_body_binary_size_ = 0
mutableprotected

The body binary size in file.

◆ index_

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

The index of this node.

◆ is_changed_

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

Has the map node been changed.

◆ is_reserved_

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

If the node is reserved in map.

◆ left_top_corner_

Eigen::Vector2d apollo::localization::msf::pyramid_map::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::pyramid_map::BaseMapNode::map_config_ = nullptr
protected

The map settings.

◆ map_matrix_

std::shared_ptr<BaseMapMatrix> apollo::localization::msf::pyramid_map::BaseMapNode::map_matrix_ = nullptr
protected

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

◆ map_matrix_handler_

std::shared_ptr<BaseMapMatrixHandler> apollo::localization::msf::pyramid_map::BaseMapNode::map_matrix_handler_ = nullptr
protected

The class to load and create map matrix binary.

◆ map_node_config_

std::shared_ptr<BaseMapNodeConfig> apollo::localization::msf::pyramid_map::BaseMapNode::map_node_config_ = nullptr
protected

The map node config.

◆ uncompressed_file_body_size_

size_t apollo::localization::msf::pyramid_map::BaseMapNode::uncompressed_file_body_size_ = 0
mutableprotected

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