Re: Navigation with RTAB-Map

Posted by matlabbe on
URL: http://official-rtab-map-forum.206.s1.nabble.com/Navigation-with-RTAB-Map-tp7816p7820.html

Hi,

To keep the launch clean and to be easier to see the differences with original rtabmap.launch, create a new launch file and include rtabmap.launch instead, like this:
<launch>

<arg name="localization" default="true"/>

<!-- ROS navigation stack move_base -->
<group ns="planner">
    <remap from="point_cloud" to="/planner/planner_cloud"/>
    <remap from="map" to="/rtabmap/grid_map"/>
    <remap from="move_base_simple/goal" to="/move_base_simple/goal"/>

    <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
        <param name="base_global_planner" value="navfn/NavfnROS"/>
        <param name="base_local_planner" value="dwa_local_planner/DWAPlannerROS"/>

        <rosparam file="$(find navigation)/param/costmap_common_params.yaml" command="load" ns="global_costmap" />
        <rosparam file="$(find navigation)/param/costmap_common_params.yaml" command="load" ns="local_costmap" />
        <rosparam file="$(find navigation)/param/local_costmap_params.yaml" command="load" />
        <rosparam file="$(find navigation)/param/global_costmap_params.yaml" command="load"/>
        <rosparam file="$(find navigation)/param/base_local_planner_params.yaml" command="load" />
    </node>
</group>

<include file="$(find rtabmap_ros)/launch/rtabmap.launch">
   <arg name="base_link" value="base_link"/>
   <arg name="localization" value="$(arg localization)"/>

   <!-- if you are doing 2D slam -->
   <arg name="args" value="--Reg/Force3DoF true"/>
   ...
</include>

</launch>
Other option is not using rtabmap.launch, and cherry pick only nodes you need following the examples here to create your own launch file.

For your questions, /rtabmap/grid_map can be visualized in RVIZ, but its purpose with move_base is to feed it the map required for its global costmap. When using rtabmap, there is then no need to use map_server, as rtabmap in localization mode will already provide the map. move_base uses this map to update the global costmap, which is then used to do safe global planning.

Your base_footprint is confusing, as base_link is used in the launch file. Do you have external odometry or are you using rtabmap odometry? /odom->/base_footprint would be published by rtabmap's odometry node or your own odometry node.
 /map -> /odom will be published by rtabmap.

For the 2D pose estimate button to work with rtabmap, you should open Tools properties and set 2D pose estimate topic to  /rtabmap/initialpose.

cheers,
Mathieu