introlab / rtabmap_ros

RTAB-Map's ROS package.
http://wiki.ros.org/rtabmap_ros
BSD 3-Clause "New" or "Revised" License
1.02k stars 560 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 
2805651606 commented 1 month ago

你好,我的基础版本是ros2 humble,使用的d435i相机,运用的算法是vins-fushion,请问也可以利用这个算法建造三维地图?

matlabbe commented 1 month ago

你好,我的基础版本是ros2 humble,使用的d435i相机,运用的算法是vins-fushion,请问也可以利用这个算法建造三维地图?

Hopefully google translate works:

Hello, my basic version is ros2 humble, I use a d435i camera, and the algorithm used is vins-fusion. Can I also use this algorithm to build a three-dimensional map?

It is possible to generate an Octomap with D435i camera form rtabmap node. You can feed vins-fusion output to rtabmap as odometry, then rtabmap will generate the 3D OctoMap.