Convert Costmap2DRos objects into cost or grid maps. More...
#include <Costmap2DConverter.hpp>
Public Member Functions | |
bool | addLayerFromCostmap2D (const costmap_2d::Costmap2D &costmap2d, const std::string &layer, MapType &outputMap) |
bool | addLayerFromCostmap2D (costmap_2d::Costmap2DROS &costmap2d, const std::string &layer, MapType &outputMap) |
bool | addLayerFromCostmap2DAtRobotPose (costmap_2d::Costmap2DROS &costmap2d, const std::string &layer, MapType &outputMap) |
Costmap2DConverter () | |
std::string | errorMessage () const |
Human readable error message string. | |
void | initializeFromCostmap2D (costmap_2d::Costmap2DROS &costmap2d, MapType &outputMap) |
void | initializeFromCostmap2D (const costmap_2d::Costmap2D &costmap2d, MapType &outputMap) |
bool | initializeFromCostmap2DAtRobotPose (costmap_2d::Costmap2DROS &costmap2d, const Length &length, MapType &outputMap) |
virtual | ~Costmap2DConverter () |
Private Attributes | |
std::vector< typename MapType::DataType > | costTranslationTable_ |
std::string | errorMessage_ |
Convert Costmap2DRos objects into cost or grid maps.
MapType | : either grid_map::GridMap or cost_map::CostMap |
TranslationTable | : class that creates a cost -> new type conversion table |
Definition at line 91 of file Costmap2DConverter.hpp.
grid_map::Costmap2DConverter< MapType, TranslationTable >::Costmap2DConverter | ( | ) | [inline] |
Initializes the cost translation table with the default policy for the template map type class.
Definition at line 99 of file Costmap2DConverter.hpp.
virtual grid_map::Costmap2DConverter< MapType, TranslationTable >::~Costmap2DConverter | ( | ) | [inline, virtual] |
Definition at line 104 of file Costmap2DConverter.hpp.
bool grid_map::Costmap2DConverter< MapType, TranslationTable >::addLayerFromCostmap2D | ( | const costmap_2d::Costmap2D & | costmap2d, |
const std::string & | layer, | ||
MapType & | outputMap | ||
) | [inline] |
Load the costmap2d into the specified layer.
costmap2d | from this costmap type object. |
layer | the name of the layer to insert. |
outputMap | to this costmap type object. |
Definition at line 132 of file Costmap2DConverter.hpp.
bool grid_map::Costmap2DConverter< MapType, TranslationTable >::addLayerFromCostmap2D | ( | costmap_2d::Costmap2DROS & | costmap2d, |
const std::string & | layer, | ||
MapType & | outputMap | ||
) | [inline] |
Load the costmap2d into the specified layer.
costmap2d | from this costmap type object. |
layer | the name of the layer to insert. |
outputMap | to this costmap type object. |
Definition at line 168 of file Costmap2DConverter.hpp.
bool grid_map::Costmap2DConverter< MapType, TranslationTable >::addLayerFromCostmap2DAtRobotPose | ( | costmap_2d::Costmap2DROS & | costmap2d, |
const std::string & | layer, | ||
MapType & | outputMap | ||
) | [inline] |
Fill a layer in the output map with data from the subwindow centered at the robot pose.
costmap2d | the underlying Costmap2DROS object. |
layer | the layer name to add. |
outputMap | the initialized and filled in map output map. |
Definition at line 264 of file Costmap2DConverter.hpp.
std::string grid_map::Costmap2DConverter< MapType, TranslationTable >::errorMessage | ( | ) | const [inline] |
Human readable error message string.
Can be used to get a human readable description of the error type after one of the class methods has failed.
Definition at line 312 of file Costmap2DConverter.hpp.
void grid_map::Costmap2DConverter< MapType, TranslationTable >::initializeFromCostmap2D | ( | costmap_2d::Costmap2DROS & | costmap2d, |
MapType & | outputMap | ||
) | [inline] |
Definition at line 108 of file Costmap2DConverter.hpp.
void grid_map::Costmap2DConverter< MapType, TranslationTable >::initializeFromCostmap2D | ( | const costmap_2d::Costmap2D & | costmap2d, |
MapType & | outputMap | ||
) | [inline] |
Definition at line 114 of file Costmap2DConverter.hpp.
bool grid_map::Costmap2DConverter< MapType, TranslationTable >::initializeFromCostmap2DAtRobotPose | ( | costmap_2d::Costmap2DROS & | costmap2d, |
const Length & | length, | ||
MapType & | outputMap | ||
) | [inline] |
Initialize the output map at the robot pose of the underlying Costmap2DROS object.
Note: This needs some beyond just fixing the center of the output map to the robot pose itself. To avoid introducing error, you want to shift the center so the underlying costmap2d cells align with the newly created map object. This does that here.
costmap2d | : the underlying Costmap2DROS object |
geometry,: | size of the subwindow to snapshot around the robot pose |
outputMap | : initialise the output map with the required parameters |
Definition at line 189 of file Costmap2DConverter.hpp.
std::vector<typename MapType::DataType> grid_map::Costmap2DConverter< MapType, TranslationTable >::costTranslationTable_ [private] |
Definition at line 315 of file Costmap2DConverter.hpp.
std::string grid_map::Costmap2DConverter< MapType, TranslationTable >::errorMessage_ [private] |
Definition at line 316 of file Costmap2DConverter.hpp.