introlab / rtabmap_ros

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

Go to initial position when mapping is finished #597

Open mattijsk14 opened 3 years ago

mattijsk14 commented 3 years ago

Hello,

I want to use RTAB_map autonomously (without 2d nav goal). This is working, but now the robot has to go to the initial start position when completing the mapping..

How can I do this? And is this even possible?

Thanks in advance!!

matlabbe commented 3 years ago

Yes, but which navigation framework are you using? With move_base, we can send the first pose of the map. If we know that odometry is starting at (0,0,0), we can send an Identity goal to move_base (on /move_base_simple/goal topic like if 2d nav goal rviz action). If rtabmap is connected to move_base through actionlib, we can call /rtabmap/set_goal service with the first node of the map, which would contain map0 label:

rosservice call /rtabmap/set_goal "node_id: 1
node_label: 'map0'
frame_id: ''map"