Kimera-VIO icon indicating copy to clipboard operation
Kimera-VIO copied to clipboard

Exporting 3D world model

Open ruffsl opened this issue 5 years ago • 2 comments

Many downstream robotic applications are not only reliant on the current pose estimate provided, but also world model collected by SLAM pipelines. This is relevant for planning domains such as in navigation stacks, but also exploration mapping techniques as well, e.g. frontier expansion.

Conventionally, exporting a SLAM framework's internal world representation often consists of projections into discretized occupancy models, either 2D maps or 3D or voxel grids, probabilistic or discrete depending upon application requirements or information available from internal world representation. Such projections could be computed online at runtime or offline ex post facto.

A LIDAR based pipelines, such as Cartographer, Slam Toolbox, often provide such online and offline methods.

Subscribe for Online

https://google-cartographer-ros.readthedocs.io/en/latest/assets_writer.html#exploiting-the-map-generated-by-cartographer-ros

Occupancy grid Node

The occupancy_grid_node listens to the submaps published by SLAM, builds an ROS occupancy_grid out of them and publishes it. This tool is useful to keep old nodes that require a single monolithic map to work happy until new nav stacks can deal with Cartographer’s submaps directly. https://google-cartographer-ros.readthedocs.io/en/latest/ros_api.html#occupancy-grid-node

Published topics

map nav_msgs/OccupancyGrid occupancy grid representation of the pose-graph at map_update_interval frequency

https://github.com/SteveMacenski/slam_toolbox#published-topics

Export for Offline

Pbstream Map Publisher Node

The pbstream_map_publisher is a simple node that creates a static occupancy grid out of a serialized Cartographer state (pbstream format). It is an efficient alternative to the occupancy grid node if live updates are not important. https://google-cartographer-ros.readthedocs.io/en/latest/ros_api.html#pbstream-map-publisher-node

Exposed Services

Topic Type Description
/slam_toolbox/deserialize_map slam_toolbox/DeserializePoseGraph Load a saved serialized pose-graph files from disk
/slam_toolbox/dynamic_map nav_msgs/OccupancyGrid Request the current state of the pose-graph as an occupancy grid
/slam_toolbox/save_map slam_toolbox/SaveMap Save the map image file of the pose-graph that is useable for display or AMCL localization. It is a simple wrapper on map_server/map_saver but is useful.
/slam_toolbox/serialize_map slam_toolbox/SerializePoseGraph Save the map pose-graph and datathat is useable for continued mapping, slam_toolbox localization, offline manipulation, and more

https://github.com/SteveMacenski/slam_toolbox/blob/eloquent-devel/README.md#exposed-services

That said, we could also see how to adjust navigation2 to deal with Kimera_VIO's world representation directly, but I think support exporting for conventional volumetric occupancy model could benefit for legacy or traditional planning approaches. A related discussion ticket about using mesh models directly for navigation: https://github.com/ros-planning/navigation2/issues/1461

Related:

  • https://github.com/MIT-SPARK/Kimera-VIO/issues/12

ruffsl avatar Feb 11 '20 21:02 ruffsl

So relating to this issue, and as I was implying in https://github.com/ros-planning/navigation2/issues/1461, exporting the global 3D Mesh is already possible via Kimera-Semantics by using Voxblox API: just call the rosservice

rosservice call /kimera_semantics_node/generate_mesh "{}"

ToniRV avatar Mar 11 '20 03:03 ToniRV

Can I know what format would this exported 3d mesh have? I want to use this map further for AR applications.

satyamSF avatar Jul 05 '22 08:07 satyamSF

Hi @ToniRV, trying to generate the full mesh here, is it possible to get the ESDF/TSDF file with this command? Also, is there any documentation for this service call?

dt1729 avatar Dec 07 '22 16:12 dt1729

Voxblox does support this as one of the services, and Kimera-Semantics will give you the esdf/tsdf file:

rosservice call /kimera_semantics_node/generate_mesh
rosservice call /kimera_semantics_node/save_map

And so on. For more info, see here.

marcusabate avatar Nov 03 '23 21:11 marcusabate