13 #include <grid_map_msgs/GridMap.h> 17 #include <unordered_map> 24 #include <sensor_msgs/PointCloud2.h> 25 #include <sensor_msgs/Image.h> 27 #include <nav_msgs/OccupancyGrid.h> 28 #include <nav_msgs/GridCells.h> 58 static bool fromMessage(
const grid_map_msgs::GridMap& message,
grid_map::GridMap& gridMap,
const std::vector<std::string>& layers,
bool copyBasicLayers =
true,
bool copyAllNonBasicLayers =
true);
82 grid_map_msgs::GridMap& message);
93 const std::string& pointLayer,
94 sensor_msgs::PointCloud2& pointCloud);
106 const std::vector<std::string>& layers,
107 const std::string& pointLayer,
108 sensor_msgs::PointCloud2& pointCloud);
119 const std::function<
bool(
float)>& condition = [](
float) {
return true; });
141 float dataMin,
float dataMax, nav_msgs::OccupancyGrid& occupancyGrid);
154 float lowerThreshold,
float upperThreshold,
155 nav_msgs::GridCells& gridCells);
182 static bool addLayerFromImage(
const sensor_msgs::Image& image,
const std::string& layer,
184 const float upperValue = 1.0,
const double alphaThreshold = 0.5);
207 const std::string encoding, sensor_msgs::Image& image);
220 const std::string encoding,
const float lowerValue,
const float upperValue,
221 sensor_msgs::Image& image);
247 const std::string encoding,
const float lowerValue,
261 const std::string& topic);
270 static bool loadFromBag(
const std::string& pathToBag,
const std::string& topic,
static void toMessage(const grid_map::GridMap &gridMap, grid_map_msgs::GridMap &message)
static bool toImage(const grid_map::GridMap &gridMap, const std::string &layer, const std::string encoding, sensor_msgs::Image &image)
static bool fromOccupancyGrid(const nav_msgs::OccupancyGrid &occupancyGrid, const std::string &layer, grid_map::GridMap &gridMap)
static void toPointCloud(const grid_map::GridMap &gridMap, const std::string &pointLayer, sensor_msgs::PointCloud2 &pointCloud)
static void toOccupancyGrid(const grid_map::GridMap &gridMap, const std::string &layer, float dataMin, float dataMax, nav_msgs::OccupancyGrid &occupancyGrid)
static bool loadFromBag(const std::string &pathToBag, const std::string &topic, grid_map::GridMap &gridMap)
static bool initializeFromImage(const sensor_msgs::Image &image, const double resolution, grid_map::GridMap &gridMap, const grid_map::Position &position=grid_map::Position::Zero())
virtual ~GridMapRosConverter()
static bool fromMessage(const grid_map_msgs::GridMap &message, grid_map::GridMap &gridMap, const std::vector< std::string > &layers, bool copyBasicLayers=true, bool copyAllNonBasicLayers=true)
static bool saveToBag(const grid_map::GridMap &gridMap, const std::string &pathToBag, const std::string &topic)
static bool addColorLayerFromImage(const sensor_msgs::Image &image, const std::string &layer, grid_map::GridMap &gridMap)
static void toGridCells(const grid_map::GridMap &gridMap, const std::string &layer, float lowerThreshold, float upperThreshold, nav_msgs::GridCells &gridCells)
static bool toCvImage(const grid_map::GridMap &gridMap, const std::string &layer, const std::string encoding, cv_bridge::CvImage &cvImage)
static bool addLayerFromImage(const sensor_msgs::Image &image, const std::string &layer, grid_map::GridMap &gridMap, const float lowerValue=0.0, const float upperValue=1.0, const double alphaThreshold=0.5)