Stereo B Mapping Problem

Posted by minato_99 on
URL: http://official-rtab-map-forum.206.s1.nabble.com/Stereo-B-Mapping-Problem-tp9801.html

Hi,
I am using a stereo camera to create a map of the gazebo worlds. I have attached image file of gazebo world and the map I created. The map has many corners and contours.




The launch file I have used is below.
<?xml version="1.0" encoding="UTF-8"?>

<launch>

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

  <!-- Localization-only mode -->
  <arg name="localization"            default="false"/>
  
  
<arg name="pi/2" value="1.5707963267948966" />
<arg name="optical_rotate" value="0 0 0 -$(arg pi/2) 0 -$(arg pi/2) " />								<!-- roll  and yaw = -$(arg pi/2) -->
<node pkg="tf" type="static_transform_publisher" name="camera_base_link"
     args="$(arg optical_rotate) chassis camera 50" />  

<!-- Run the ROS package stereo_image_proc -->
<group ns="/stereo" >
    <node pkg="stereo_image_proc" type="stereo_image_proc" name="stereo_image_proc"/>

    <!-- Odometry -->
    <node pkg="rtabmap_odom" type="stereo_odometry" name="stereo_odometry" output="screen">
   <remap from="left/image_rect"   to="left/image_rect_color"/>
     <remap from="right/image_rect"  to="right/image_rect"/>
     <remap from="left/camera_info"  to="left/camera_info"/>
     <remap from="right/camera_info" to="right/camera_info"/>

        <param name="frame_id" type="string" value="chassis"/>
        <param name="odom_frame_id" type="string" value="odom"/>
        <param name="approx_sync"   type="bool" value="true"/>
        <param name="queue_size"    type="int" value="5"/>

        <param name="Odom/MinInliers" type="string" value="12"/>
       <param name="Odom/RoiRatios"  type="string" value="0.03 0.03 0.04 0.04"/> 
    </node>     
</group>


   
 <!-- Mapping -->

<group ns="rtabmap">   
  <node name="rtabmap" pkg="rtabmap_slam" type="rtabmap" output="screen" args="delete_db_on_start"> <!--	delete_db_on_start-->
  	
     <param name="frame_id" type="string" value="chassis"/>
     <param name="subscribe_stereo" type="bool" value="true"/>
     <param name="subscribe_depth"  type="bool" value="true"/>
     <param name="approx_sync"      type="bool" value="true"/>
     
        <remap from="left/image_rect"       to="/stereo/left/image_raw"/>
        <remap from="right/image_rect"      to="/stereo/right/image_raw"/>
        <remap from="left/camera_info"      to="/stereo/left/camera_info"/>
        <remap from="right/camera_info"     to="/stereo/right/camera_info"/>
     
  
     <remap from="odom" to="/stereo/odom"/>

     <param name="queue_size" type="int" value="30"/>

     <!-- RTAB-Map's parameters -->
     <param name="Vis/MinInliers" type="string" value="12"/>
   <!--  <param name="Mem/IncrementalMemory" type="bool" value="true" /> -->
     
     <!-- RTAB-Map's parameters: do "rosrun rtabmap rtabmap (double-dash)params" to see the list of available parameters. -->
   
    
    
  

    
     
      <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="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="Icp/CorrespondenceRatio"      type="string" value="0.1"/>
      
      <param name="Vis/InlierDistance"           type="string" value="0.1"/>    <!-- 3D visual words correspondence distance -->
      <param name="RGBD/AngularUpdate"           type="string" value="0.1"/>    <!-- Update map only if the robot is moving -->
      <param name="RGBD/LinearUpdate"            type="string" value="0.1"/>    <!-- Update map only if the robot is moving -->
      <param name="Rtabmap/DetectionRate"              type="string" value="1000"/>
      <param name="RGBD/ProximityPathMaxNeighbors" type="string" value="1"/>    <!-- 1-->
      <param name="Rtabmap/TimeThr"              type="string" value="700"/>  <!-- 700 -->
      <param name="Mem/RehearsalSimilarity"      type="string" value="0.30"/>
      <param name="Optimizer/Slam2D"             type="string" value="true"/>
      <param name="Reg/Force3DoF"                type="string" value="true"/>   
       <param name="RGBD/OptimizeMaxError"           type="string" value="1"/> 
      
      <!-- localization mode -->
      <param     if="$(arg localization)" name="Mem/IncrementalMemory" type="string" value="true"/>
      <param unless="$(arg localization)" name="Mem/IncrementalMemory" type="string" value="true"/>
      <param name="Mem/InitWMWithAllNodes" type="string" value="$(arg localization)"/> 


     
     
  </node>
 </group>
 <!-- Visualisation RTAB-Map -->
<!--
 <group ns="rtabmap">  

  <node pkg="rtabmap_viz" type="rtabmap_viz" name="rtabmap_viz" args="-d $(find rtabmap_viz)/launch/config/rgbd_gui.ini" output="screen">
     <param name="subscribe_stereo"    type="bool"   value="true"/>
     <param name="subscribe_odom_info" type="bool"   value="true"/>
     <param name="queue_size"          type="int"    value="10"/>
     <param name="frame_id"            type="string" value="chassis"/>
     <remap from="left/image_rect"   to="/stereo/left/image_rect_color"/>
     <remap from="right/image_rect"  to="/stereo/right/image_rect"/>
     <remap from="left/camera_info"  to="/stereo/left/camera_info"/>
     <remap from="right/camera_info" to="/stereo/right/camera_info"/>
     <remap from="odom_info"         to="/stereo/odom_info"/> 
     <remap from="odom"              to="/stereo/odom"/> 
 
  </node> 
</group> -->

   <!-- <remap from="odom_info"         to="/stereo/odom_info"/> -->
     <!-- <remap from="odom"              to="/stereo/odom"/> --> <!-- these goes insinde rtabmap_viz -->
 <!-- Visualisation RVIZ --> 
 

   <node if="$(arg rviz)" pkg="rviz" type="rviz" name="rviz" args="-d $(find rtabmap_demos)/launch/config/demo_stereo_outdoor.rviz"/> 
   
</launch>

What are the parameters should I choose since I always get wrong loop closure detection error. After spending more time in creating a map in a single run. The update time becomes very large the my computer barely run and states the error of odom transformation lost.

What are the parameters should I tweak to get rid of this error ? Thanks.