introlab / rtabmap_ros

RTAB-Map's ROS package.
http://wiki.ros.org/rtabmap_ros
BSD 3-Clause "New" or "Revised" License
957 stars 556 forks source link

ROS2 - Octomap can't be saved using Octomap Saver Node #876

Open AddyPete opened 1 year ago

AddyPete commented 1 year ago

Hi I successfully created Octomap with Kinect 360 using Rtabmap RGBD Odometry.

GIT_1

I want to save this octomap using the ros2 octomap saver node but it doesn't work. It always looping with a message "Waiting for Service...."

GIT_2

I used this command to try to save the map: ros2 run octomap_server octomap_saver_node --ros-args -p octomap_path:=map.bt

The Octomap topic shown in rviz is /rtabmap/octomap_binary

Thank you!

matlabbe commented 1 year ago

It should work:

ros2 run octomap_server octomap_saver_node --ros-args -p octomap_path:=map.bt 
[INFO] [1674957009.554208229] [octomap_saver]: Map received (3516 nodes, 0.050000 m res), saving to map.bt

by default the service name is /octomap_binary. If rtabmap is in rtabmap namespace, you have to remap the service name:

ros2 run octomap_server octomap_saver_node --ros-args -p octomap_path:=map.bt -r octomap_binary:=/rtabmap/octomap_binary

To list all services:

ros2 service list | grep octomap
AddyPete commented 1 year ago

Hello I did the command

ros2 run octomap_server octomap_saver_node --ros-args -p octomap_path:=map.bt -r octomap_binary:=/rtabmap/octomap_binary

But it is still Waiting for Service.........

JAN30_1

This is what it looks like in RTABMap-Viz

JAN30_2

and lastly, this are the service list outputted using ros2 service list | grep octomap

JAN30_3

I'm using ROS2 Foxy

Hopefully I gave you enough information. Thank you

matlabbe commented 1 year ago

Other option is to start octomap_saver_node in rtabmap namespace.

ros2 run octomap_server octomap_saver_node --ros-args --remap  __ns:=/rtabmap -p octomap_path:=map.bt