The ufomap_mapping::Server class is the primary interface for managing a UFOMap instance within a ROS environment. It handles incoming point cloud data, manages the underlying ufo::map::OccupancyMap or ufo::map::OccupancyMapColor, and provides ROS services for map manipulation and retrieval.
To use the server, instantiate it with two ros::NodeHandle objects: one for the public namespace and one for private parameters.
Key Capabilities:
- Point Cloud Integration: Subscribes to
sensor_msgs/PointCloud2 to update the map. - Map Management Services: Provides services to get the map, clear specific volumes, reset the map, and save the map to disk.
- Dynamic Reconfiguration: Supports real-time parameter updates via
dynamic_reconfigure using the ufomap_mapping::ServerConfig type. - Asynchronous Updates: Supports asynchronous map updates to prevent blocking the main ROS thread.
#include <ufomap_mapping/server.h>
// Inside a ROS node or component
ros::NodeHandle nh;
ros::NodeHandle nh_priv("~");
// Initialize the UFOMap server
ufomap_mapping::Server server(nh, nh_priv);