# RGBDSlam crashes after a few minutes of running

Hi,

I am running RGBDSlam along with slam_gmapping and hector_exploration_node. Basically, my robot uses hector_Exploration to navigate by using a 2D map created from slam_gmapping. While this is happening, I am running RGBDSlam to create a 3D map.

The problem I am having is that when I run RGBDSlam for longer than 3 mins, the GUI disappears and it crashes. I have been getting exit codes 6 and 11. I switched to RGBDSlam headless mode and it seemed to map for 5 mins without crashing but when I tried to save the file, it said it saved but it never showed up in the directory I saved to and the computer crashed.

So, I was wondering if anyone else has these issues and if there are any solutions. Any help will be appreciated, thank you!

EDIT: This is the debug output when I ran RGBDSlam with the GUI and RGBDSlam crashed.

[ INFO] [1365615045.098933833]: Added Edge between 152 and 164. Inliers: 89
[ INFO] [1365615045.098977351]: new node has id 164
[ INFO] [1365615045.099025858]: Rotation: 29.85, Distance:  0.037m
[ INFO] [1365615045.099081822]: Rotation: 29.85, Distance:  0.037m
[ INFO] [1365615045.099356830]: Added Edge (162-164) to Optimizer:
0.867364  0.00369345   -0.497661  -0.0336218
-5.5463e-05    0.999973  0.00732476  -0.0104783
0.497674 -0.00632563    0.867341    0.012728
0           0           0           1
Information Matrix10.8007       0       0       0       0       0
0 10.8007       0       0       0       0
0       0 10.8007       0       0       0
0       0       0 10.8007       0       0
0       0       0       0 10.8007       0
0       0       0       0       0 10.8007
[ INFO] [1365615045.099517768]: Cleaning: removed 0 matches from 51
[ INFO] [1365615045.099585683]: Added Edge between 162 and 164. Inliers: 51
[ INFO] [1365615045.099634431]: new node has id 164
[ INFO] [1365615045.099677494]: Rotation: 21.61, Distance:  0.061m
[ INFO] [1365615045.099731280]: Rotation: 21.61, Distance:  0.061m
[ INFO] [1365615045.100021379]: Added Edge (161-164) to Optimizer:
0.929718 -0.00995286   -0.368137  -0.0453404
0.00828569    0.999947 -0.00610908  0.00844803
0.368178  0.00262946    0.929752   0.0395426
0           0           0           1
Information Matrix12.3319       0       0       0       0       0
0 12.3319       0       0       0       0
0       0 12.3319       0       0       0
0       0       0 12.3319       0       0
0       0       0       0 12.3319       0
0       0       0       0       0 12.3319
[ INFO] [1365615045.100179181]: Cleaning: removed 0 matches from 51
[ INFO] [1365615045.100259039]: Added Edge between 161 and 164. Inliers: 51

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff03e2db6 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) ^CQuit
(gdb) ^CQuit
(gdb) backtrace
#0  0x00007ffff03e2db6 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007fffaecb36cf in ?? ()
from /usr/lib/x86_64-linux-gnu/dri/libdricore.so
#2  0x0000000000597a85 in GLViewer::pointCloud2GLStrip (this=0xad57b0, pc=
0x7ffe4fefa510)
at /home/iriss/ros/rosbuild_ws/rgbdslam_freiburg/rgbdslam/src/glviewer.cpp:713
pc=0x7ffe4fefa510, transform=...)
at /home/iriss/ros/rosbuild_ws/rgbdslam_freiburg/rgbdslam/src/glviewer.cpp:557
#4  0x00000000005da1ae in GLViewer::qt_static_metacall (_o=<optimized out ...
edit retag close merge delete

I don't know if this is related to much, however, sometimes I get an invalid depth-map (depth image) which causes a crash. I have no clue why I get an invalid image, but I just hope that it doesn't show up.

( 2013-04-03 15:40:50 -0500 )edit

Sort by » oldest newest most voted

In case of crashes, please do the following (not specific to rgbdslam):

• In your launchfile, set the launch-prefix in the rgbdslam node-tag to a debugger and
• Set the "output" attribute of the node-tag to "screen" e.g. <node pkg="rgbdslam" type="rgbdslam" name="rgbdslam" cwd="node" required="true" output="screen" launch-prefix="/usr/bin/xterm -rv -e gdb -ex run -args">

• Launch the launch-file. An extra terminal "xterm" will be opened.

• When the program crashes, check the error message in the xterm window
• In the xterm window, run backtrace. Also helpful:
1. jump to the first frame (lowest number) where the path of the file location contains "rgbdslam". In the above question post, this would be done by frame 2
2. use list to print some of the source code of that frame, centered at the line that provoked the crash.
3. use print <variablename> to inspect values of variables that may be involved in the crash (e.g., pointer values, array indices...)
• Post the output of these commands and some output of rgbdslam before
• Format it as code (the button with the 1s and the 0s)

Thanks for helping

Edit:

Hm, the backtrace is interesting. The segfault happens in the visualization code, which explains, why it works (longer) in headless mode. I can not reproduce the problem. However, here are some thoughts:

• I've found and fixed a bug concerning the deletion of clouds. Please update (you are using the code from the alufr-ros-pkg repository on google code, I assume) and recompile. It may be the source of your problem.
• If you are running low on main memory, you could try to uncomment #ADD_DEFINITIONS(-DRGB_IS_4TH_DIM) in CMakeLists.txt an recompile. This effectively halves the size of the clouds in memory, but requires rgbdslam to compute the cloud itself from rgb image and depth image, which means you may not subscribe to the ".../points" topic.
• Setting values > 1 for the parameter visualization_skip_step in your launchfile will also reduce the impact on memory (including the memory of the graphics card)
• Exit code -6 is fine (it's a workaround to a deadlock on exit), -11 is memory access releated.
• If you want the GUI, but don't need the 3D view set the parameter "use_glwidget" to false

Edit2:

Concerning the second traceback: This error is very weird, in particular as it occurs after the 430th frame. I've never had this problem, opencv should choose the data type on its own. Since it doesn't do so, try the following. At the end of the file src/node.cpp, could you please replace

cv::reduce(descriptors, sums_vec, 1 /*sum over columns*/, CV_REDUCE_SUM);


by

cv::reduce(descriptors, sums_vec, 1 /*sum over columns*/, CV_REDUCE_SUM, CV_32FC1);


Then recompile.

more

Thanks Felix. I updated my original post with the output.

( 2013-04-10 07:47:05 -0500 )edit

Felix, a few updates. I updated the code and recompiled and set the visualization_skip_step parameter to 3. I ran rgbdslam in headless mode and it crashed after running for a little over 4 mins. I posted the output in the original post. Thanks for your input.

( 2013-04-12 06:37:19 -0500 )edit

For memory you can run top in parallel (shift-M to sort by mem) and check that. If it's near the limit when it crashes that might be a reason. Backtraces at random locations might point to that. If it's not at the limit, @Felix Endres will have some more fun debugging...

( 2013-04-12 06:47:13 -0500 )edit

Also, Felix, I tried to uncomment #ADD_DEFINITIONS(-DRGB_IS_4TH_DIM) and recompile but it gave me a warning that it was dangerous to do that so I didn't do it.

( 2013-04-12 07:16:44 -0500 )edit

My guess is that it's only dangerous if you subscribe to "../points". If you don't it might be safe.

( 2013-04-12 10:53:38 -0500 )edit

It's dangerous, as in "there is color information where a 1 should be". I haven't encountered any problems, but can't ensure that none arise if the clouds are saved/sent and further processed or transformed.

( 2013-04-15 03:52:13 -0500 )edit

BTW, in headless mode, the visualization_skip_step is not used (it's only used to draw the internal 3d visualization more roughly).

( 2013-04-15 07:22:01 -0500 )edit

After adding this line "cv::reduce(descriptors, sums_vec, 1 /sum over columns/, CV_REDUCE_SUM, CV_32FC1);" RGBDSlam hasn't been crashing. Thanks for yall's help.

( 2013-04-18 17:26:44 -0500 )edit