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

#include <ndt_map_node.h>

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

Public Member Functions

 NdtMapNode ()
 
 ~NdtMapNode ()
 
void Init (const BaseMapConfig *map_config)
 Initialize the map node. Call this function first before use it! More...
 
void Init (const BaseMapConfig *map_config, const MapNodeIndex &index, bool create_map_cells=true)
 
float GetMapResolutionZ () const
 Get the resolution of this map nodex. More...
 
Eigen::Vector3d GetCoordinate3D (unsigned int x, unsigned int y, int altitude_index) const
 Given the local x, y, altitude index, return the global coordinate. More...
 
Eigen::Vector3d GetCoordinateCenter3D (unsigned int x, unsigned int y, int altitude_index) const
 Given the local x, y, altitude index, return the global coordinate. More...
 
- Public Member Functions inherited from apollo::localization::msf::pyramid_map::BaseMapNode
 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 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 void Reduce (NdtMapNode *map_node, const NdtMapNode &map_node_new)
 Combine two map nodes (Reduce operation in mapreduce). The result is saved in map_node. More...
 
- Static Public Member Functions inherited from apollo::localization::msf::pyramid_map::BaseMapNode
static Eigen::Vector2d ComputeLeftTopCorner (const BaseMapConfig &config, const MapNodeIndex &index)
 
static Eigen::Vector2d GetLeftTopCorner (const BaseMapConfig &option, const MapNodeIndex &index)
 

Public Attributes

unsigned int num_valid_cells_
 The number of cells with elements. More...
 
unsigned int num_valid_single_cells_
 The number of single cells with elements. More...
 

Additional Inherited Members

- Protected Member Functions inherited from apollo::localization::msf::pyramid_map::BaseMapNode
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 inherited from apollo::localization::msf::pyramid_map::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...
 
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
 

Constructor & Destructor Documentation

◆ NdtMapNode()

apollo::localization::msf::pyramid_map::NdtMapNode::NdtMapNode ( )

◆ ~NdtMapNode()

apollo::localization::msf::pyramid_map::NdtMapNode::~NdtMapNode ( )

Member Function Documentation

◆ GetCoordinate3D()

Eigen::Vector3d apollo::localization::msf::pyramid_map::NdtMapNode::GetCoordinate3D ( unsigned int  x,
unsigned int  y,
int  altitude_index 
) const

Given the local x, y, altitude index, return the global coordinate.

◆ GetCoordinateCenter3D()

Eigen::Vector3d apollo::localization::msf::pyramid_map::NdtMapNode::GetCoordinateCenter3D ( unsigned int  x,
unsigned int  y,
int  altitude_index 
) const

Given the local x, y, altitude index, return the global coordinate.

◆ GetMapResolutionZ()

float apollo::localization::msf::pyramid_map::NdtMapNode::GetMapResolutionZ ( ) const
inline

Get the resolution of this map nodex.

◆ Init() [1/2]

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

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

Implements apollo::localization::msf::pyramid_map::BaseMapNode.

◆ Init() [2/2]

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

◆ Reduce()

static void apollo::localization::msf::pyramid_map::NdtMapNode::Reduce ( NdtMapNode map_node,
const NdtMapNode map_node_new 
)
static

Combine two map nodes (Reduce operation in mapreduce). The result is saved in map_node.

Member Data Documentation

◆ num_valid_cells_

unsigned int apollo::localization::msf::pyramid_map::NdtMapNode::num_valid_cells_

The number of cells with elements.

◆ num_valid_single_cells_

unsigned int apollo::localization::msf::pyramid_map::NdtMapNode::num_valid_single_cells_

The number of single cells with elements.


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