32namespace localization {
34namespace pyramid_map {
49 bool create_map_cells =
true) = 0;
66 bool Load(
const char* filename);
71 virtual bool GetCoordinate(
const Eigen::Vector2d& coordinate,
unsigned int* x,
72 unsigned int* y)
const;
73 virtual bool GetCoordinate(
const Eigen::Vector3d& coordinate,
unsigned int* x,
74 unsigned int* y)
const;
76 virtual Eigen::Vector2d
GetCoordinate(
unsigned int x,
unsigned int y)
const;
140 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
147 const std::vector<std::string>& paths)
const;
150 const std::vector<std::string>& paths)
const;
The options of the reflectance map.
std::vector< float > map_resolutions_
The pixel resolutions in the map in meters.
The data structure of the map cells in a map node.
The map node config info.
The data structure of a Node in the map.
const MapNodeIndex & GetMapNodeIndex() 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.
const BaseMapNodeConfig & GetMapNodeConfig() const
Get the map node config.
virtual void Finalize()
call before deconstruction or reset.
std::shared_ptr< CompressionStrategy > compression_strategy_
@bried The compression strategy.
virtual bool LoadBinary(FILE *file)
Load the map cell from a binary chunk.
const BaseMapConfig & GetMapConfig() const
Get the map settings.
bool SaveIntensityImage() const
Save intensity image of node.
bool GetIsChanged() const
Get if the map data has changed.
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.
const BaseMapConfig * map_config_
The map settings.
bool SaveAltitudeImage() const
Save altitude image of node.
bool is_changed_
Has the map node been changed.
const BaseMapMatrix & GetMapCellMatrix() const
Get map cell matrix.
virtual void ResetMapNode()
Reset map cells data.
bool is_reserved_
If the node is reserved in map.
bool Load()
Load the map node from the disk.
bool CreateMapDirectory(const std::string &path) const
Try to create the map directory.
MapNodeIndex index_
The index of this node
virtual ~BaseMapNode()
Destruct a map node.
void SetLeftTopCorner(double x, double y)
Set the left top corner of the map node.
virtual size_t LoadBodyBinary(std::vector< unsigned char > *buf)
Load the map node body from a binary chunk.
const Eigen::Vector2d & GetLeftTopCorner() const
virtual void Init(const BaseMapConfig *map_config, const MapNodeIndex &index, bool create_map_cells=true)=0
size_t uncompressed_file_body_size_
BaseMapMatrix & GetMapCellMatrix()
virtual size_t GetBodyBinarySize() const
Get the size of the body in bytes.
virtual bool CreateBinary(FILE *file) const
Create the binary.
virtual size_t GetBinarySize() const
Get the binary size of the object.
static Eigen::Vector2d ComputeLeftTopCorner(const BaseMapConfig &config, const MapNodeIndex &index)
std::shared_ptr< BaseMapMatrixHandler > map_matrix_handler_
The class to load and create map matrix binary.
std::shared_ptr< BaseMapMatrix > map_matrix_
The data structure of the map datas, which is a matrix.
Eigen::Vector2d left_top_corner_
The left top corner of the map node in the global coordinate system.
bool CheckMapDirectoryRecursively(const std::vector< std::string > &paths) const
Try to check the map directory recursively.
bool Save()
Save the map node to the disk.
BaseMapNode()
Construct a map node.
size_t file_body_binary_size_
The body binary size in file.
std::shared_ptr< BaseMapNodeConfig > map_node_config_
The map node config.
float GetMapResolution() const
Get the resolution of this map nodex.
virtual size_t GetHeaderBinarySize() const
Get the size of the header in bytes.
virtual void Init(const BaseMapConfig *map_config)=0
Initialize the map node.
bool GetIsReady() const
Get if the map node data is ready
virtual size_t LoadHeaderBinary(const unsigned char *buf)
Load the map node header from a binary chunk.
virtual size_t CreateHeaderBinary(unsigned char *buf, size_t buf_size) const
Create the binary header.
void SetMapNodeIndex(const MapNodeIndex &index)
Set the map node index.
void SetIsChanged(bool is)
Set if the map node data has changed.
virtual void InitMapMatrix(const BaseMapConfig *map_config)
Initialize the map matrix.
virtual size_t CreateBodyBinary(std::vector< unsigned char > *buf) const
Create the binary body.
bool CreateMapDirectoryRecursively(const std::vector< std::string > &paths) const
Try to create the map directory recursively.