tum-vision / dvo_slam

Dense Visual Odometry and SLAM
632 stars 306 forks source link

Segfault on dvo_slam #18

Open jefftee opened 9 years ago

jefftee commented 9 years ago

I'm working on getting dvo_slam running on ROS indigo with Ubuntu 14.04 with an Asus Xtion Pro Live. I've worked through all the compilation errors and got dvo_slam seemingly working (though the dvo_vis topics still aren't producing anything). Anyway, it's producing /pose messages that seem reasonable (hovers around 0,0,0 since the device is just sitting on my table):

header: seq: 174 stamp: secs: 1411423061 nsecs: 610369675 frame_id: base_link_estimate pose: pose: position: x: 0.193051555302 y: -0.0157469765671 z: 0.0714707661636 orientation: x: 0.0692083399856 y: -0.0768862753495 z: 0.0798834092357 w: 0.991421881576 covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]

However, if I start moving the camera around, dvo_slam seg faults. Here's the backtrace:

Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fffb1b3a700 (LWP 16908)] dvo_slam::internal::KeyframeGraphImpl::insertNewKeyframe (this=this@entry=0x9433a0, m=...) at /usr/include/c++/4.8/bits/stl_set.h:299 299 { return _M_t.begin(); } (gdb) bt

0 dvo_slam::internal::KeyframeGraphImpl::insertNewKeyframe (this=this@entry=0x9433a0, m=...)

at /usr/include/c++/4.8/bits/stl_set.h:299

1 0x00007ffff73afe91 in dvo_slam::internal::KeyframeGraphImpl::newKeyframe (this=this@entry=0x9433a0, map=...)

at /home/jefftee/Develop/drone_ws/src/dvo_slam/dvo_slam/src/keyframe_graph.cpp:449

2 0x00007ffff73b0726 in dvo_slam::internal::KeyframeGraphImpl::execOptimization (this=0x9433a0)

at /home/jefftee/Develop/drone_ws/src/dvo_slam/dvo_slam/src/keyframe_graph.cpp:422

3 0x00007ffff739087d in operator() (p=, this=0x7fffb21cbfe8)

at /usr/include/boost/bind/mem_fn_template.hpp:49

4 operator()<boost::_mfi::mf0<void, dvo_slam::internal::KeyframeGraphImpl>, boost::_bi::list0> (

a=<synthetic pointer>, f=..., this=0x7fffb21cbff8) at /usr/include/boost/bind/bind.hpp:253

5 operator() (this=0x7fffb21cbfe8) at /usr/include/boost/bind/bind_template.hpp:20

6 tbb::internal::thread_closure_0<boost::_bi::bind_t<void, boost::_mfi::mf0<void, dvo_slam::internal::KeyframeGraphImpl>, boost::_bi::list1boost::_bi::value<dvo_slam::internal::KeyframeGraphImpl* > > >::start_routine (

c=0x7fffb21cbfe8) at /usr/include/tbb/tbb_thread.h:90

7 0x00007ffff5daa182 in start_thread (arg=0x7fffb1b3a700) at pthread_create.c:312

8 0x00007ffff6b25fbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

I think I've narrowed it down to this line in keyframe_graph.cpp:

g2o::OptimizableGraph::EdgeSet::iterator e = std::find_if(last_kv->edges().begin(), last_kv->edges().end(), FindEdge(next_keyframeid - 1, next_odometry_vertexid));

Thanks.

v-mehta commented 9 years ago

I am having the exact same issue on ROS hydro with all the compilation done and no dvo_vis working .... and the cause seems to be in Keyframe_graph.cpp

jefftee commented 9 years ago

Check this thread for the resolution:

https://github.com/tum-vision/dvo_slam/issues/20