MIT-SPARK / Kimera-VIO

Visual Inertial Odometry with SLAM capabilities and 3D Mesh generation.
BSD 2-Clause "Simplified" License
1.53k stars 416 forks source link

Exporting 3D world model #29

Closed ruffsl closed 10 months ago

ruffsl commented 4 years ago

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:

ToniRV commented 4 years ago

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 "{}"
satyamSF commented 2 years ago

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

dt1729 commented 1 year ago

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?

marcusabate commented 10 months ago

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.