Map moving while mapping

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Map moving while mapping

Bill
RTABMap is awsome - I've a simple iRobot create base, with Xtion and Neato XV-11 providing laser and RGB-D, and RTABMap is able to build nice 2D map 3D point cloud.  I run it in mapping mode but run navigation move_base node that maintain costmaps.  I figured out that when RTABMap is in localization mode the map doesn't change nor 'move around', but in mapping mode it moves so much it completely dis-aligned with costmap in matter of seconds.  I run it with laser enabled, and my odometry do need to be calibrated.  Is there an option that 'nails down' maps during mapping?  Does it make sense?
Reply | Threaded
Open this post in threaded view
|

Re: Map moving while mapping

matlabbe
Administrator
In mapping mode, there are some events that can trigger a map update:
  • Pose correction with the laser scans (if "RGBD/PoseScanMatching"="true")
  • Loop closure detection
  • Transfer/Retrieval of nodes (if "Rtabmap/TimeThr" > "0")
  • If "RGBD/OptimizeFromGraphEnd" = "true", the whole map is always optimized from the last pose instead of the first pose in the map. You can try to enable/disable it to see what happens. Well, if you set to false, the map will be "nailed down" on the first node of the map.
Are you talking about the global or the local costmap? The global costmap is generated from the occupancy grid map generated by rtabmap, so they must be always aligned. Here is my global_costmap_params.yaml for example from the az3_mapping_robot_nav.launch :
global_frame: map
robot_base_frame: base_footprint
update_frequency: 1
publish_frequency: 2
always_send_full_costmap: false
plugins:
   - {name: static_layer, type: "rtabmap_ros::StaticLayer"}
   - {name: inflation_layer, type: "costmap_2d::InflationLayer"}
and the related move_base configuration (/map is the generated /grid_map from rtabmap):
<group ns="planner">
     <remap from="map" to="/map"/>
        
     <node pkg="move_base" type="move_base" respawn="true" name="move_base" output="screen">
        <param name="base_global_planner" value="navfn/NavfnROS"/>
    	<rosparam file="$(find rtabmap_ros)/launch/azimut3/config/costmap_common_params.yaml" command="load" ns="global_costmap" />
     	<rosparam file="$(find rtabmap_ros)/launch/azimut3/config/costmap_common_params.yaml" command="load" ns="local_costmap" />
    	<rosparam file="$(find rtabmap_ros)/launch/azimut3/config/local_costmap_params_2d.yaml" command="load" ns="local_costmap" />
    	<rosparam file="$(find rtabmap_ros)/launch/azimut3/config/global_costmap_params.yaml" command="load" ns="global_costmap"/>
    	<rosparam file="$(find rtabmap_ros)/launch/azimut3/config/base_local_planner_params.yaml" command="load" />
     </node>
</group>
If you have a screenshot of the problem and a launch file example (rtabmap and move_base stuff), it may help to understand better if you have still problems. Cheers, Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: Map moving while mapping

Bill
Thanks!!  It was the OptimizeFromGraphEnd - when I set that to True and run RTABMap in mapping mode, the navigation local costmap will get out of alignment whenever map get updated.  Setting that to false and map indeed get nailed down similar to hector mapping in slam mode.
Reply | Threaded
Open this post in threaded view
|

Re: Map moving while mapping

matlabbe
Administrator
It is still strange that with RGBD/OptimizeFromGraphEnd = true, the costmap of move_base doesn't "follow" the map published by rtabmap. For navigation though, it could be easier to use RGBD/OptimizeFromGraphEnd=false because the map's referential doesn't change.
Reply | Threaded
Open this post in threaded view
|

Re: Map moving while mapping

Bill
I agree.  Costmaps should follow the map when map is updated :)