ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

rtabmap crash, RealSense D435i, Assertion px != 0 failed

asked 2019-09-13 13:39:22 -0500

frank26080115 gravatar image

Environment is a Raspberry Pi 4, Raspbian Buster, kernel 4.19.66-v71+, ROS Kinetic Kame, rtabmap v0.19.3, rtabmap_ros v0.19.3 , RealSense D435i camera

Almost everything was installed from source

librealsense works, I can use realsense-viewer, realsense2_camera works, I can visualize both RGB and depth with Rviz. The problem happens when I try to use rtabmap. I am using a modified version of the rs_rtabmap.launch file (use a single camera, disable gyro, accel, and enable depth alignment and sync).

If I try to launch with rviz, I end up with

rtabmap: /usr/include/boost/smart_ptr/shared_ptr.hpp:728: typename boost::detail::sp_dereference<T>::type boost::shared_ptr<T>::operator*() const [with T = boost::signals2::mutex; typename boost::detail::sp_dereference<T>::type = boost::signals2::mutex&]: Assertion `px != 0' failed.
[rtabmap/rtabmap-4] process has died [pid 2287, exit code -6, cmd /home/pi/catkin_ws/devel/lib/rtabmap_ros/rtabmap --delete_db_on_start rgb/image:=/D435i/color/image_raw depth/image:=/D435i/aligned_depth_to_color/image_raw rgb/camera_info:=/D435i/color/camera_info rgbd_image:=rgbd_image_relay left/image_rect:=/stereo_camera/left/image_rect_color right/image_rect:=/stereo_camera/right/image_rect left/camera_info:=/stereo_camera/left/camera_info right/camera_info:=/stereo_camera/right/camera_info scan:=/scan scan_cloud:=/scan_cloud user_data:=/user_data user_data_async:=/user_data_async gps/fix:=/gps/fix tag_detections:=/tag_detections odom:=/D435i/odom/sample imu:=/imu/data __name:=rtabmap __log:=/home/pi/.ros/log/5f6c9b08-d651-11e9-827c-dca632195a3e/rtabmap-rtabmap-4.log].

If I try to launch with rtabmarviz, I get

* /D435i/realsense2_camertabmap: /usr/include/boost/smart_ptr/shared_ptr.hpp:728: typename boost::detail::sp_dereference<T>::type boost::shared_ptr<T>::operator*() const [with T = boost::signals2::mutex; typename boost::detail::sp_dereference<T>::type = boost::signals2::mutex&]: Assertion `px != 0' failed.
[rtabmap/rtabmap-4] process has died [pid 32379, exit code -6, cmd /home/pi/catkin_ws/devel/lib/rtabmap_ros/rtabmap --delete_db_on_start rgb/image:=/D435i/color/image_raw depth/image:=/D435i/aligned_depth_to_color/image_raw rgb/camera_info:=/D435i/color/camera_info rgbd_image:=rgbd_image_relay left/image_rect:=/stereo_camera/left/image_rect_color right/image_rect:=/stereo_camera/right/image_rect left/camera_info:=/stereo_camera/left/camera_info right/camera_info:=/stereo_camera/right/camera_info scan:=/scan scan_cloud:=/scan_cloud user_data:=/user_data user_data_async:=/user_data_async gps/fix:=/gps/fix tag_detections:=/tag_detections odom:=/D435i/odom/sample imu:=/imu/data __name:=rtabmap __log:=/home/pi/.ros/log/8b64ca02-d64f-11e9-ac7d-dca632195a3e/rtabmap-rtabmap-4.log].
log file: /home/pi/.ros/log/8b64ca02-d64f-11e9-ac7d-dca632195a3e/rtabmap-rtabmap-4*.log
qt5ct: using qt5ct plugin
rtabmapviz: /usr/include/boost/smart_ptr/shared_ptr.hpp:728: typename boost::detail::sp_dereference<T>::type boost::shared_ptr<T>::operator*() const [with T = boost::signals2::mutex; typename boost::detail::sp_dereference<T>::type = boost::signals2::mutex&]: Assertion `px != 0' failed.
[rtabmap/rtabmapviz-5] process has died [pid 32389, exit code -6, cmd /home/pi/catkin_ws/devel/lib/rtabmap_ros/rtabmapviz -d ~/.ros/rtabmap_gui.ini rgb/image:=/D435i/color/image_raw depth/image:=/D435i/aligned_depth_to_color/image_raw rgb/camera_info:=/D435i/color/camera_info rgbd_image:=rgbd_image_relay left/image_rect:=/stereo_camera/left/image_rect_color right/image_rect:=/stereo_camera/right/image_rect left/camera_info:=/stereo_camera/left/camera_info right/camera_info:=/stereo_camera/right/camera_info scan:=/scan scan_cloud:=/scan_cloud odom:=/D435i/odom/sample __name:=rtabmapviz __log:=/home/pi/.ros/log/8b64ca02-d64f-11e9-ac7d-dca632195a3e/rtabmap-rtabmapviz-5.log].

One of the things I noticed was that these messages are happening async to the launch, notice how it cut off a message. I also don't know how to turn ... (more)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-09-13 22:32:30 -0500

matlabbe gravatar image

PCL >= 1.8 is built by default with -march=native, so every dependencies of rtabmap using Eigen (e.g., g2o) should be also built with this flag, otherwise rtabmap nodes are crashing on start. See also https://github.com/introlab/rtabmap/i...

You can launch the nodes in gdb to see more info about the crash. See http://wiki.ros.org/roslaunch/Tutoria...

Example:

$ roslaunch rtabmap_ros rtabmap.launch args:="-d" launch_prefix:="xterm -e gdb --args"

cheers,
Mathieu

edit flag offensive delete link more

Comments

I've been rebuilding everything, starting from a blank Raspbian Buster image. No ROS installed at all, I just need RTAB-Map

GCC and G++ 6.5 used

vtk6.3, gtk3, qt5, qt5svg5 installed from apt-get, eigen3, tf2, protobuf, tbb2, tesseract, suitesparse, installed from apt-get

boost 1.58.0 installed from source

PCL 1.9 installed from source, explicitly set PCL_ENABLE_SSE:BOOL=ON to have -march=native

g2o installed from source, BUILD_WITH_MARCH_NATIVE:BOOL=ON

gtsam-4.0.0-alpha, installed from source, I don't think there was an option that changes -march, maybe I should add it to CMAKE_CXX_FLAGS?

cvsba-1.0.0 installed from source, I don't think there was an option that changes -march, maybe I should add it to CMAKE_CXX_FLAGS?

OpenCV 3.4 installed from source, OPENCV_ENABLE_NONFREE=ON, with contrib modules, again, I didn't have anything explicitly setting -march

continuing in next comment because of character limit

frank26080115 gravatar image frank26080115  ( 2019-09-18 23:25:54 -0500 )edit

So with the above setup, I built rtabmap 0.19.3-kinetic, and ran it. No GUI launched, no splash screen, got an error that says

terminate called after throwing an instance of 'std::length_error'
what(): vector::_M_fill_insert
Aborted

Previously I installed ROS first (and none of the optional gtsam g2o cvsba opencv), and I at least got rtabmap's gui to show up when I tried to launch it. (but with a crap ton of other non fatal related errors, and that fatal error I originally mentioned)

What am I doing wrong? Is it simply the -march=native thing? Or is there something else? I'll run another build with more CXX_FLAGS tonight

EDIT: I also had to enable -std=c++11 on a lot of builds, does that matter?

frank26080115 gravatar image frank26080115  ( 2019-09-18 23:29:48 -0500 )edit

I would try to keep only the core dependencies, like g2o and opencv. Can you try with:

cd rtabmap/build 
cmake -DWITH_CVSBA=OFF -DWITH_GTSAM=OFF ..
make

If this minimal configuration doesn't work, launch in gdb to see where it crashes. GTSAM requires setting manually -march=native in the CMAKE_CXX_FLAGS. -std=c++11 is fine.

matlabbe gravatar image matlabbe  ( 2019-09-19 07:42:34 -0500 )edit

I did a build with g2o off, cvsba off, and gtsam off, plus Debug... got this out of gdb

#6  0xa5f76354 in std::__throw_length_error(char const*) () at /usr/lib/arm-linux-gnueabihf/libstdc++.so.6
#7  0xb1d4d7d8 in std::vector<long long, std::allocator<long long> >::_M_fill_insert(__gnu_cxx::__normal_iterator<long long*, std::vector<long long, std::allocator<long long> > >, unsigned int, long long const&) ()
    at /usr/local/lib/libopencv_dnn.so.3.4
#8  0xa157b64c in  () at /usr/lib/arm-linux-gnueabihf/libvtkCommonCore-6.3.so.6.3
#9  0xa1448630 in  () at /usr/lib/arm-linux-gnueabihf/libvtkCommonCore-6.3.so.6.3

hmm VTK is installed via apt-get, OpenCV I built myself, also, I swear right now I should have VTK 7 and not 6

I checked my CMakeCache for OpenCV and it was built with VTK6... could that be it? I'll start another OpenCV build again...

EDIT: tried again with VTK7, same result, now suspecting it's libopencv_dnn ...(more)

frank26080115 gravatar image frank26080115  ( 2019-09-19 15:44:20 -0500 )edit

Can you build opencv without VTK? libopencv_dnn is not used directly by rtabmap (not sure what is this library).

matlabbe gravatar image matlabbe  ( 2019-09-22 16:52:05 -0500 )edit

I went back to a fresh raspbian image, and reran my installer script (I've automated almost everything). This time I'm putting ROS Kinetic back on too. I got to a point where rtabmap launches but doesn't bring up a GUI, and GDB pointed it at a .so file that's a part of GTK 2, which is weird since I'm pretty sure I didn't need it and I had GTK 3 installed too.

After getting rid of GTK 2, rtabmap worked.

But right now I'm battling a new problem, it seems like if I don't build libpcl from source, it pulls in libboost 1.67 and having both 1.58 and 1.67 seems to be causing a problem inside of rtabmap, I can get 3 frames from the camera before it complains about https://github.com/introlab/rtabmap/i...

I'm going ...(more)

frank26080115 gravatar image frank26080115  ( 2019-09-23 12:12:01 -0500 )edit

Thanks for all the help so far, consider this topic kinda closed since the error I'm getting now is kind of already known. If I need more help with it, I'll probably open a new topic

frank26080115 gravatar image frank26080115  ( 2019-09-23 12:13:12 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2019-09-13 13:39:22 -0500

Seen: 507 times

Last updated: Sep 13 '19