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
[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'
[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
Re: Instance thrown when running simulation on gazebo
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.