Instance thrown when running simulation on gazebo

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

Instance thrown when running simulation on gazebo

alexr
Hi,

I am trying to map a environment on gazebo and at the same time recording the bag for offline mapping.

For few minutes everything runs smoothly but after some time the node crashes with the following message everytime.

[ERROR] (2018-04-13 12:01:11.666) OptimizerGTSAM.cpp:345::optimize() GTSAM exception caught: 
Indeterminant linear system detected while working near variable
44 (Symbol: 44).

Thrown when a linear system is ill-posed.  The most common cause for this
error is having underconstrained variables.  Mathematically, the system is
underdetermined.  See the GTSAM Doxygen documentation at
http://borg.cc.gatech.edu/ on gtsam::IndeterminantLinearSystemException for
more information.
[ERROR] (2018-04-13 12:01:11.667) Rtabmap.cpp:3314::optimizeGraph() Optimization has failed, trying incremental optimization instead, this may take a while (poses=407, links=406)...
terminate called after throwing an instance of 'std::out_of_range'
  what():  map::at
[rtabmap/rtabmap-1] process has died [pid 8206, exit code -6, cmd /home/alex-d/catkin_ws/devel/lib/rtabmap_ros/rtabmap --delete_db_on_start odom:=/p3dx/odom scan:=/scan rgb/image:=/camera/rgb/image_raw depth/image:=/camera/depth/image_raw rgb/camera_info:=/camera/rgb/camera_info __name:=rtabmap __log:=/home/ankit-d/.ros/log/e6c5ad72-3ec4-11e8-bbaf-b8ca3a7f11aa/rtabmap-rtabmap-1.log].
log file: /home/alex-d/.ros/log/e6c5ad72-3ec4-11e8-bbaf-b8ca3a7f11aa/rtabmap-rtabmap-1*.log

Can you tell me how to resolve this issue.

Thanks
------ Alex
Reply | Threaded
Open this post in threaded view
|

Re: Instance thrown when running simulation on gazebo

matlabbe
Administrator
Hi,

Which version do you have? I am trying to understand why incremental optimization is triggered (as it should be only on initialization or when a new map is created, not while mapping as guessPoses here would not be empty) and why the incGraph.at() here is out of bound in your case.

Can you provide launch parameters set to rtabmap?

I opened an issue. For now to avoid this problem, I would suggest to use TORO to avoid optimization failures. Set "Optimizer/Strategy" parameter to 0.

Note also if you want to to offline mapping, you may not start rtabmap, just record the input topics.

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: Instance thrown when running simulation on gazebo

matlabbe
Administrator
I fixed the two problems indicated in my previous post, see this issue: https://github.com/introlab/rtabmap/issues/276

For the GTSAM fail, this is often related to bad covariance set on odometry topic.

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: Instance thrown when running simulation on gazebo

alexr
This post was updated on .
Hi

Thanks for the reply.

Below is the launch file I used for mapping

<launch>

  <arg name="HOME" default="$(env HOME)" />
      
  <group ns="rtabmap">
    <node name="rtabmap" pkg="rtabmap_ros" type="rtabmap" output="screen" args="--delete_db_on_start">
          <param name="frame_id" type="string" value="base_link"/>
        
          <param name="subscribe_depth" type="bool" value="true"/>
          <param name="subscribe_scan" type="bool" value="true"/>
        
          <remap from="odom" to="/p3dx/odom"/>
          <remap from="scan" to="/scan"/>

          <remap from="rgb/image" to="/camera/rgb/image_raw"/>
          <remap from="depth/image" to="/camera/depth/image_raw"/>
          <remap from="rgb/camera_info" to="/camera/rgb/camera_info"/>
          <param name="Rtabmap/DatabasePath" type="string" value="$(arg HOME)/.ros/rtabmap.db"/>  <!-- Database location -->
          <param name="queue_size" type="int" value="10"/>
        
          <!-- RTAB-Map's parameters: do "rosrun rtabmap rtabmap (double-dash)params" to see the list of available parameters. -->
          <param name="Mem/IncrementalMemory" type="string" value="true"/>          <!-- true = Mapping/SLAM mode-->
  
          <param name="Rtabmap/DetectionRate" type="string" value="1"/>             <!-- Don't need to do relocation very often! Though better results if the same rate as when mapping. -->
          <param name="DbSqlite3/CacheSize" type="string" value="10000"/>           <!-- Sqlite cache size (default is 2000) -->
          <param name="DbSqlite3/InMemory" type="string" value="false"/>
          <param name="Rtabmap/TimeThr" type="string" value="700"/>
          <param name="Rtabmap/MemoryThr" type="string" value="400"/>
          <param name="RGBD/NeighborLinkRefining" type="string" value="0"/>             <!-- Do odometry correction with consecutive laser scans -->
          <param name="RGBD/ProximityBySpace" type="string" value="false"/>  <!-- Local loop closure detection (using estimated position) with locations in WM -->
          <param name="RGBD/ProximityByTime" type="string" value="false"/>   <!-- Local loop closure detection with locations in STM -->
          <param name="Mem/BadSignaturesIgnored" type="string" value="false"/>      <!-- Don't ignore bad images for 3D node creation (e.g. white walls) -->
          <param name="Reg/Strategy" type="string" value="2"/>                       <!-- Loop closure transformation refining with ICP: 0=No ICP, 1=ICP 3D, 2=ICP 2D -->
          <param name="Icp/Iterations" type="string" value="100"/>
          <param name="Icp/VoxelSize" type="string" value="0"/>
          <param name="Vis/MinInliers" type="string" value="5"/>                 <!-- 3D visual words minimum inliers to accept loop closure -->
          <param name="Vis/MaxDepth" type="string" value="4.0"/>                 <!-- 3D visual words maximum depth 0=infinity -->
          <param name="Vis/InlierDistance" type="string" value="0.05"/>          <!-- 3D visual words correspondence distance -->
          <param name="RGBD/AngularUpdate" type="string" value="0.01"/>             <!-- Update map only if the robot is moving -->
          <param name="RGBD/LinearUpdate" type="string" value="0.01"/>              <!-- Update map only if the robot is moving -->
          <param name="Rtabmap/TimeThr" type="string" value="0"/>
          <param name="Mem/RehearsalSimilarity" type="string" value="0.45"/>
          <param name="Mem/NotLinkedNodesKept" type="string" value="false"/>   
          <param name="RGBD/OptimizeFromGraphEnd" type="string" value="false"/>    <!-- Optimize graph from the latest node -->
    </node>
  </group>
   </launch>

Should I update the code to the latest commit to fix the problem?

Thanks

------ Alex
Reply | Threaded
Open this post in threaded view
|

Re: Instance thrown when running simulation on gazebo

matlabbe
Administrator
Hi,

yes you should update the git/rebuild/install to have the fix.

cheers,
Mathieu