0
$\begingroup$

Rosanswers logo

Hi,

I'm using rtabmap_ros with kinect and a simulation environment (Gazebo) and ubuntu 14.04 and ros indigo

I'm trying to 3D map a very big structure model (Aircraft model) placed in a Gazebo environment..the 3D mapping is done using a kinect placed on a UAV that autonomously navigates around the structure ... the map starts to be created successfully and incrementally but after a several hours the first mapped parts disappears. covering the structure takes alot of time. The path that the UAV follows is too long and does not include loop closure so I increased the RGBD/localimmunizationRatio from 0.025 to 0.5 to handle longer paths and I set up the RGBD/LocalLoopDetectionSpace to false but still I have the same problem so what could be the problem in my case ??

Here is the launch file part with the parameters I used:

<group ns="$(arg ns)">
<node if="$(arg rgbd_odometry)" pkg="rtabmap_ros" type="rgbd_odometry" name="rgbd_odometry" output="screen">
  <param name="frame_id"           type="string" value="iris/xtion_sensor/camera_depth_optical_frame"/>
  <param name="wait_for_transform" type="bool"   value="true"/>
  <param name="Odom/Force2D"       type="string"   value="true"/>
  <remap from="rgb/image"       to="/iris/xtion_sensor/iris/xtion_sensor_camera/rgb/image_raw"/>
  <remap from="depth/image"     to="/iris/xtion_sensor/iris/xtion_sensor_camera/depth/image_raw"/>
  <remap from="rgb/camera_info" to="/iris/xtion_sensor/iris/xtion_sensor_camera/rgb/camera_info"/>
</node>      
<node name="rtabmap" pkg="rtabmap_ros" type="rtabmap" output="screen" args="$(arg args)">
  <param name="database_path"       type="string" value="$(arg database_path)"/>
  <param name="frame_id"            type="string" value="/iris/xtion_sensor/ground_truth/iris/xtion_sensor/ground_truth/odometry_sensor_link"/>
  <param name="odom_frame_id"       type="string" value="world"/>
  <param name="subscribe_depth"     type="bool"   value="true"/>
  <remap from="odom" to="/iris/ground_truth/odometry"/>

  <remap from="rgb/image"       to="/iris/xtion_sensor/iris/xtion_sensor_camera/rgb/image_raw"/>
  <remap from="depth/image"     to="/iris/xtion_sensor/iris/xtion_sensor_camera/depth/image_raw"/>
  <remap from="rgb/camera_info" to="/iris/xtion_sensor/iris/xtion_sensor_camera/rgb/camera_info"/>
  <remap from="rtabmap/get_map" to="/iris/get_map"/>

  <param name="RGBD/LocalLoopDetectionSpace" type="string" value="false"/>   
  <param name="RGBD/OptimizeFromGraphEnd"    type="string" value="false"/> 
  <param name="Kp/MaxDepth"                  type="string" value="8.5"/>
  <param name="LccIcp/Type"                  type="string" value="1"/>     
  <param name="LccIcp2/CorrespondenceRatio"  type="string" value="0.05"/>
  <param name="LccBow/MinInliers"            type="string" value="10"/>  
  <param name="LccBow/InlierDistance"        type="string" value="0.1"/>  
  <param name="RGBD/AngularUpdate"           type="string" value="0.1"/>  
  <param name="RGBD/LinearUpdate"            type="string" value="0.1"/>    
  <param name="RGBD/LocalImmunizationRatio"  type="string" value="0.50"/>    
  <param name="Rtabmap/TimeThr"              type="string" value="700"/>
  <param name="Mem/RehearsalSimilarity"      type="string" value="0.30"/>   
  
  <!-- localization mode -->
  <param     if="$(arg localization)" name="Mem/IncrementalMemory" type="string" value="false"/>
  <param unless="$(arg localization)" name="Mem/IncrementalMemory" type="string" value="true"/>
  <param name="Mem/InitWMWithAllNodes" type="string" value="$(arg localization)"/> 
</node>

 <node if="$(arg rtabmapviz)" pkg="rtabmap_ros" type="rtabmapviz" name="rtabmapviz" args="-d $(find rtabmap_ros)/launch/config/rgbd_gui.ini" output="screen">
  <param name="subscribe_depth"     type="bool"   value="true"/>
  <param name="frame_id"            type="string" value="/iris/xtion_sensor/ground_truth/iris/xtion_sensor/ground_truth/odometry_sensor_link"/>
  <param name="wait_for_transform"  type="bool"   value="true"/>

  <remap from="rgb/image"       to="/iris/xtion_sensor/iris/xtion_sensor_camera/rgb/image_raw"/>
  <remap from="depth/image"     to="/iris/xtion_sensor/iris/xtion_sensor_camera/depth/image_raw"/>
  <remap from="rgb/camera_info" to="/iris/xtion_sensor/iris/xtion_sensor_camera/rgb/camera_info"/>
</node>
  <!-- Visualization RVIZ -->
<node if="$(arg rviz)" pkg="rviz" type="rviz" name="rviz" args="-d $(find aircraft_inspection)/rviz/rgbd_gazebo.rviz"/>
<node if="$(arg rviz)" pkg="nodelet" type="nodelet" name="points_xyzrgb" args="load rtabmap_ros/point_cloud_xyzrgb standalone_nodelet">
<remap from="rgb/image"       to="/iris/xtion_sensor/iris/xtion_sensor_camera/rgb/image_raw"/>
<remap from="depth/image"     to="/iris/xtion_sensor/iris/xtion_sensor_camera/depth/image_raw"/>
<remap from="rgb/camera_info" to="/iris/xtion_sensor/iris/xtion_sensor_camera/rgb/camera_info"/>
<remap from="cloud"           to="voxel_cloud" />
<remap from="rtabmap/get_map" to="/iris/get_map"/>

<param name="decimation" type="double" value="2"/>
<param name="voxel_size" type="double" value="0.02"/>
<param name="RGBD/LocalImmunizationRatio"  type="string" value="0.5"/>    

</node>
</group>

Originally posted by Randa on ROS Answers with karma: 3 on 2016-02-14

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Hi,

In your setup, the memory management of rtabmap is enabled:

<param name="Rtabmap/TimeThr" type="string" value="700"/>

That means that when the map update takes more than 700 ms, some oldest locations would be transferred to its long-term memory to keep the algorithm online, splitting the map so that the oldest part is not shown anymore (unless you come back in that area). However, the global map is still available at the end of the run: rtabmap should be paused first then we call publish_map (params: global, optimized, graphOnly) service with global parameter set to 1:

$rosservice call /rtabmap/pause
$rosservice call /rtabmap/publish_map 1 1 1

The graphOnly parameter can be set to 0 to make rtabmap node republish all data (point clouds) on the mapData topic (if rtabmapviz or MapCloud rviz plugin has already cached all the previous clouds, you can only republish the global graph).

To reconstruct the global map offline, you can open the database in rtabmap standalone application, and just click "Edit->Download all clouds".

Note on simulation

You said that there is no loop closure in your path, does that mean you assume perfect odometry? In that case (you need only to assemble the point clouds), you could even disable loop closure detection of rtabmap, thus saving some computational time:

<param name="Kp/WordsPerImage" type="string" value="-1"/>

However, if you plan to work on a real robot, you may have to plan your path with loop closures so that odometry errors can be corrected.

cheers


Originally posted by matlabbe with karma: 6409 on 2016-02-15

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Randa on 2016-02-17:
Thanks for your clarification and suggestion, but I have a question about the ""Rtabmap/TimeThr" parameter, I found that the default value of this paramter is 0(means infinity) so is it better to increase the parameter value in my case or just use the default value??

Comment by matlabbe on 2016-02-17:
Setting it to 0 disables the memory management, so you will not experience parts of map disappearing. However, the processing time will not be bounded, so no guaranty that updates will be done under 1 sec (default Rtabmap/DetectionRate) for long-term mapping.

$\endgroup$

Your Answer

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