I am doing the visual SLAM using stereo camera in gazebo world. I am using stereo_image_proc and rtabmap_slam package. The problem I am facing is the map gets elevated after a certain time and I get a lot of drift in the map. The verical shift in the point cloud makes it impossible to do the loop closure.

I have attached the code I am using and the image of vertical shift.


<!-- Odometry -->
<node pkg="rtabmap_odom" type="stereo_odometry" name="stereo_odometry" output="screen">
    <param name="frame_id" type="string" value="chassis"/>
    <param name="odom_frame_id" type="string" value="odom"/>
    <param name="approx_sync"   type="bool" value="false"/>
    <param name="queue_size"    type="int" value="5"/>
   <param name="Odom/Strategy" type="string" value="1"/> <!-- 0=BOW, 1=OpticalFlow -->
  <param name="Odom/EstimationType" type="string" value="1"/> <!-- 3D->2D (PnP) -->
  <param name="Odom/MinInliers" type="string" value="10"/>
  <param name="Odom/RoiRatios" type="string" value="0.03 0.03 0.04 0.04"/>     
  <param name="Odom/MaxDepth" type="string" value="10"/>
  <param name="OdomBow/NNDR" type="string" value="0.8"/>
  <param name="Odom/MaxFeatures" type="string" value="1000"/>
  <param name="GFTT/MinDistance" type="string" value="10"/>
  <param name="GFTT/QualityLevel" type="string" value="0.00001"/> 
  <param name="Mem/BadSignaturesIgnored" type="bool" value="true"/>      
 <param name="queue_size" type="int" value="30"/>

 <!-- RTAB-Map's parameters -->
 <param name="Vis/MinInliers" type="string" value="12"/>
    <param name="Grid/MaxGoundAngle" value="45"/>
<param name="Grid/MaxObstacleHeight" value="5.0"/>
<param name="Grid/MaxGroundHeight" value="0.1"/>
<param name="Grid/MinClusterSize" value="20"/> -->
  <param name="RGBD/ProximityBySpace"        type="string" value="true"/>   <!-- Local loop closure detection (using estimated position) with locations in WM -->
  <param name="RGBD/OptimizeFromGraphEnd"    type="string" value="true"/> <!--false -> <!- Set to false to generate map correction between /map and /odom -->
  <param name="RGBD/LocalImmunizationRatio"    type="string" value=".5"/> 
  <param name="Kp/MaxDepth"                  type="string" value="4.0"/>
  <param name="Reg/Strategy"                 type="string" value="0"/>   <!-- 0 -->   <!-- Loop closure transformation: 0=Visual, 1=ICP, 2=Visual+ICP -->

  <param name="RGBD/CreateOccupancyGrid"     type="string"    value="true"/>
  <param name="Vis/InlierDistance"           type="string" value="0.1"/>    <!-- 3D visual words correspondence distance -->
  <param name="RGBD/AngularUpdate"           type="string" value="0.15"/>    <!-- Update map only if the robot is moving -->
  <param name="RGBD/LinearUpdate"            type="string" value="0.25"/>    <!-- Update map only if the robot is moving -->
  <param name="Rtabmap/DetectionRate"              type="string" value="1000"/> <!-- 1000 -->
  <param name="RGBD/ProximityPathMaxNeighbors" type="string" value="1"/>    <!-- 1-->
  <param name="Rtabmap/TimeThr"              type="string" value="300"/>  <!-- 700 -->
  <param name="Rtabmap/CreateIntermediateNoodes" type="bool" value="true"/>
  <param name="Mem/RehearsalSimilarity"      type="string" value="0.30"/>
  <param name="Reg/Force3DoF"                type="string" value="true"/>   
   <param name="RGBD/OptimizeMaxError"           type="string" value="3"/> 
2D (PnP) -> -->

RVIZ 3D Map Map Graph


1 Answer 1


You can set Reg/Force3DoF to true for odometry node too, to make sure everything is 3DoF.

  • $\begingroup$ Welcome to Robotics matlabbe. Thanks for your answer but we are looking for comprehensive answers that provide some explanation and context. Very short answers cannot do this, so please edit your answer to explain why it is right, ideally with citations. Answers that don't include explanations may be removed. See How to Answer for more info. $\endgroup$
    – Chuck
    Jan 23 at 3:09
  • $\begingroup$ How do they set that value? Can you please link to some documentation, and/or explain what exactly is getting forced to 3DoF? $\endgroup$
    – Chuck
    Jan 23 at 3:10

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.