0
$\begingroup$

Rosanswers logo

I have recorded a map using an Intel Realsense camera(D435i) and RTAB-maps. This is the command I am using to record the map

roslaunch rtabmap_ros rtabmap.launch
      rtabmap_args:="--delete_db_on_start"
      depth_topic:=/camera/aligned_depth_to_color/image_raw
      rgb_topic:=/camera/color/image_raw
      camera_info_topic:=/camera/color/camera_info

It seems to have worked fine, I can load up the saved database file into the rtabmap GUI tool and see the 3d map.

Now I would like to localize and navigate using the recorded db. For this, I modified the launch file I used above to the following: https://docs.google.com/document/d/1gYLuko3W99Uttgul-3IhkJ5UKzBUXo_mB0nqN84n46g/edit?usp=sharing

Here are what I think are the relevant bits:

<arg name="stereo"          default="false"/>

<!-- Choose visualization -->
<arg name="rtabmapviz"              default="false" />
<arg name="rviz"                    default="true" />

<!-- Localization-only mode -->
<arg name="localization"            default="true"/>
<!-- RGB-D related topics -->
<arg name="rgb_topic"               default="/camera/color/image_raw" />
<arg name="depth_topic"             default="/camera/aligned_depth_to_color/image_raw" />
<arg name="camera_info_topic"       default="/camera/color/camera_info" />
<arg name="depth_camera_info_topic" default="$(arg camera_info_topic)" />

  <!-- Visualisation RTAB-Map -->
<node if="$(arg rtabmapviz)" pkg="rtabmap_ros" type="rtabmapviz" name="rtabmapviz" args="-d $(arg gui_cfg)" output="$(arg output)" launch-prefix="$(arg launch_prefix)">
  <param     if="$(arg stereo)" name="subscribe_depth"  type="bool" value="false"/>
  <param unless="$(arg stereo)" name="subscribe_depth"  type="bool" value="true"/>
  <param name="subscribe_rgbd"       type="bool"   value="$(arg subscribe_rgbd)"/>
  <param name="subscribe_stereo"     type="bool"   value="$(arg stereo)"/>
  <param name="subscribe_scan"       type="bool"   value="$(arg subscribe_scan)"/>
  <param name="subscribe_scan_cloud" type="bool"   value="$(arg subscribe_scan_cloud)"/>
  <param if="$(arg visual_odometry)" name="subscribe_odom_info" type="bool" value="true"/>
  <param if="$(arg icp_odometry)"    name="subscribe_odom_info" type="bool" value="true"/>
  <param name="frame_id"             type="string" value="$(arg frame_id)"/>
  <param name="odom_frame_id"        type="string" value="$(arg odom_frame_id)"/>
  <param name="wait_for_transform_duration" type="double"   value="$(arg wait_for_transform)"/>
  <param name="queue_size"           type="int"    value="$(arg queue_size)"/>
  <param name="approx_sync"          type="bool"   value="$(arg approx_sync)"/>

  <remap from="rgb/image"       to="$(arg rgb_topic_relay)"/>
  <remap from="depth/image"     to="$(arg depth_topic_relay)"/>
  <remap from="rgb/camera_info" to="$(arg camera_info_topic)"/>

  <remap     if="$(arg rgbd_sync)" from="rgbd_image" to="$(arg rgbd_topic)"/>
  <remap unless="$(arg rgbd_sync)" from="rgbd_image" to="$(arg rgbd_topic)_relay"/>

  <remap from="left/image_rect"        to="$(arg left_image_topic_relay)"/>
  <remap from="right/image_rect"       to="$(arg right_image_topic_relay)"/>
  <remap from="left/camera_info"       to="$(arg left_camera_info_topic)"/>
  <remap from="right/camera_info"      to="$(arg right_camera_info_topic)"/>

  <remap from="scan"                   to="$(arg scan_topic)"/>
  <remap from="scan_cloud"             to="$(arg scan_cloud_topic)"/>
  <remap from="odom"                   to="$(arg odom_topic)"/>

  <remap from="grid_map"               to="/map"/>
</node>

I know RTAB-maps in localization mode only publishes the map after it has localized, so I drove the rover around a bit... and then a little more .... and then the entire route that was mapped. It still hasn't localized or published anything onto the /map topic.

How would I go about debugging this?

Please note that I am new to ROS, so it is entirely possible that I have missed a step somewhere.

Let me know if you need any more info about my setup.


Originally posted by Drkstr on ROS Answers with karma: 25 on 2019-03-05

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Did you try relaunching with:

$ roslaunch rtabmap_ros rtabmap.launch \
      localization:=true \
      depth_topic:=/camera/aligned_depth_to_color/image_raw \
      rgb_topic:=/camera/color/image_raw \
      camera_info_topic:=/camera/color/camera_info

In rtabmapviz, you can do "Edit->Download clouds (update cache)" to get the map. You should not have to edit rtabmap.launch in most cases, just launch it with different parameters.


Originally posted by matlabbe with karma: 6409 on 2019-03-05

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Drkstr on 2019-03-06:
That worked perfectly, thanks :)

Comment by Drkstr on 2019-03-06:
Now I just need to send it a goal and get it to move to the goal. Any suggestions?

Comment by matlabbe on 2019-03-06:
see move_base with this overview, and this tutorial for an example with rtabmap integration.

Comment by Drkstr on 2019-03-11:
Hey man, ive got a follow-up question for you: https://answers.ros.org/question/318220/trouble-moving-rover-from-rtabmapviz/

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.