introlab / rtabmap_ros

RTAB-Map's ROS package.
http://wiki.ros.org/rtabmap_ros
BSD 3-Clause "New" or "Revised" License
916 stars 549 forks source link

RTABMAP version 0.20.14 build from source with Odometry node crash. #664

Closed AlysonQ closed 1 year ago

AlysonQ commented 2 years ago

Hello, Screenshot from 2021-10-20 15-04-36

I was trying to build RTABMAP from source code recently. I found that the /rtabmap/rtabmap node is fine to do every function like map_server(load map, just open rtabmap application... and so on) but the /rtabmap/rgbd_odometry and /rtabmap/stereo_odometry will crash everytime I roslaunch.

Here are some information of my setting: Ubuntu 18.04 ROS Melodic x86 platform

Build from source steps:

cd rtabmap/build
cmake -DCMAKE_INSTALL_PREFIX=~/catkin_ws/devel  -DWITH_G2O=OFF ..
make -j4
make install

would you give me some advice or maybe I should try version between 0.20.9~0.20.14?

Thank you, Alyson

matlabbe commented 2 years ago

It is strange that -DWITH_G2O=OFF and the asserts happens in G2O stuff (the code should not go there). What is the output of cmake .. for rtabmap/build folder?

rtabmap_ros may also not load the right rtabmap binaries. Do you still have ros-melodic-rtabmap installed?

AlysonQ commented 2 years ago

Thanks for your quick reply. I'm sure ros-melodic-rtabmap isn't installed. and the cmake ..result as below:

(base) alyson@alyson:~/rtabmap/build$  cmake -DCMAKE_INSTALL_PREFIX=~/catkin_ws/devel  -DWITH_ORB_SLAM2=ON  -DWITH_G2O=OFF .. 
-- MOBILE_BUILD=OFF
-- The imported target "vtkRenderingPythonTkWidgets" references the file
   "/usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/cmake/vtk-6.3/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtk" references the file
   "/usr/bin/vtk"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/cmake/vtk-6.3/VTKTargets.cmake"
but not all the files it references.

-- PCL definitions don't contain "-march=native", make sure all libraries using Eigen are also compiled without that flag to avoid some segmentation faults (with gdb referring to some Eigen functions).
-- Found Sqlite3: /usr/include /usr/lib/x86_64-linux-gnu/libsqlite3.so
-- Found OpenMP_C: -fopenmp  
-- Found OpenMP_CXX: -fopenmp  
-- Found OpenMP: TRUE  found components:  C CXX 
-- Found OpenMP: /usr/lib/gcc/x86_64-linux-gnu/7/libgomp.so;/usr/lib/x86_64-linux-gnu/libpthread.so
-- Add PCL_OMP to definitions
-- Found OpenCV: /usr/local/include/opencv4
-- Found PCL: /usr/include/pcl-1.8;/usr/include/eigen3;/usr/include;/usr/include/ni;/usr/include/openni2;/usr/include/vtk-6.3;/usr/include/freetype2;/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi;/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/opal/mca/event/libevent2022/libevent;/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/opal/mca/event/libevent2022/libevent/include;/usr/lib/x86_64-linux-gnu/openmpi/include;/usr/include/python2.7;/usr/include/x86_64-linux-gnu;/usr/include/hdf5/openmpi;/usr/include/libxml2;/usr/include/jsoncpp;/usr/include/tcl
-- Found ZLIB: /usr/include
-- VTK_RENDERING_BACKEND=OpenGL
-- Found Freenect: /usr/include
-- Found OpenNI2: /usr/include/openni2
-- Found DC1394: /usr/include/dc1394
-- FlyCapture2_INCLUDE_DIR=FlyCapture2_INCLUDE_DIR-NOTFOUND
-- FlyCapture2_LIBRARY=FlyCapture2_LIBRARY-NOTFOUND
-- Triclops_INCLUDE_DIR=Triclops_INCLUDE_DIR-NOTFOUND
-- Triclops_LIBRARY=Triclops_LIBRARY-NOTFOUND
-- FlyCaptureBridge_LIBRARY=FlyCaptureBridge_LIBRARY-NOTFOUND
-- Found octomap 1.9.7: /opt/ros/melodic/include
-- Found installed version of Eigen: /usr/lib/cmake/eigen3
-- Found required Ceres dependency: Eigen version 3.3.4 in /usr/include/eigen3
-- Found required Ceres dependency: glog
-- Found installed version of gflags: /usr/lib/x86_64-linux-gnu/cmake/gflags
-- Detected gflags version: 2.2.1
-- Found required Ceres dependency: gflags
-- Found Ceres version: 1.13.0 installed in: /usr with components: [LAPACK, SuiteSparse, SparseLinearAlgebraLibrary, CXSparse, SchurSpecializations, OpenMP]
-- Found ceres 1.13.0: /usr/include;/usr/include/eigen3;/usr/include
-- Architecture: x86_64
-- Found Pangolin: /home/alyson/Pangolin/include;/home/alyson/Pangolin/build/src/include;/usr/include;/usr/include;/usr/include;/usr/include/eigen3
-- Found ORB_SLAM2: /home/alyson/ORB_SLAM2/include;/home/alyson/ORB_SLAM2/include/CameraModels;/home/alyson/ORB_SLAM2/Thirdparty/g2o;/home/alyson/ORB_SLAM2/;/home/alyson/Pangolin/include;/home/alyson/Pangolin/build/src/include;/usr/include;/usr/include;/usr/include;/usr/include/eigen3
-- Performing Test COMPILER_SUPPORTS_CXX11
-- Performing Test COMPILER_SUPPORTS_CXX11 - Success
-- Performing Test COMPILER_SUPPORTS_CXX0X
-- Performing Test COMPILER_SUPPORTS_CXX0X - Success
-- Found Pthreads
-- --------------------------------------------
-- Info :
--   RTAB-Map Version =     0.20.14
--   CMAKE_VERSION =        3.10.2
--   CMAKE_INSTALL_PREFIX = /home/alyson/catkin_ws/devel
--   CMAKE_BUILD_TYPE =     Release
--   CMAKE_INSTALL_LIBDIR = lib
--   BUILD_APP =            ON
--   BUILD_TOOLS =          ON
--   BUILD_EXAMPLES =       ON
--   BUILD_SHARED_LIBS =    ON
--   CMAKE_CXX_FLAGS =  -fmessage-length=0  -fopenmp -std=c++11
--   FLANN_KDTREE_MEM_OPT = OFF
--   PCL_DEFINITIONS =  ;-DDISABLE_ENSENSO;-DDISABLE_DAVIDSDK;-DDISABLE_DSSDK;-DDISABLE_PCAP;-DDISABLE_PNG;-DDISABLE_LIBUSB_1_0;-DFLANN_STATIC;-Dqh_QHpointer;-DDISABLE_RSSDK
--   PCL_VERSION = 1.8.1
-- 
-- Optional dependencies ('*' affects some default parameters) :
--  *With OpenCV 4.1.0 xfeatures2d = NO, nonfree = NO (License: BSD)
--   With Qt 5.9.7            = YES (License: Open Source or Commercial)
--   With VTK 6.3              = YES (License: BSD)
--   With external SQLite3     = YES (License: Public Domain)
--   With ORB OcTree           = YES (License: GPLv3)
--   With SupertPoint          = NO (WITH_TORCH=OFF)
--   With Python3              = NO (WITH_PYTHON=OFF)
--   With Madgwick             = YES (License: GPL)
--   With FastCV               = NO (FastCV not found)
--   With PDAL                 = NO (PDAL not found)
-- 
--  Solvers:
--   With TORO                 = YES (License: Creative Commons [Attribution-NonCommercial-ShareAlike])
--  *With g2o                  = NO (WITH_G2O=OFF)
--  *With GTSAM                = NO (GTSAM not found)
--  *With Ceres 1.13.0         = YES (License: BSD)
--   With VERTIGO              = NO (GTSAM or g2o required)
--   With cvsba                = NO (cvsba not found)
--  *With libpointmatcher      = NO (libpointmatcher not found)
--   With CCCoreLib            = NO (CCCoreLib not found)
-- 
--  Reconstruction Approaches:
--   With OCTOMAP              = YES (License: BSD)
--   With CPUTSDF              = NO (CPUTSDF not found)
--   With OpenChisel           = NO (open_chisel not found)
--   With AliceVision          = NO (WITH_ALICE_VISION=OFF)
-- 
--  Camera Drivers:
--   With Freenect             = YES (License: Apache v2 and/or GPLv2)
--   With OpenNI2              = YES (License: Apache v2)
--   With Freenect2            = NO (libfreenect2 not found)
--   With Kinect for Windows 2 = NO (Kinect for Windows 2 SDK not found)
--   With Kinect for Azure     = NO (Kinect for Azure SDK not found)
--   With dc1394               = YES (License: LGPL)
--   With FlyCapture2/Triclops = NO (Point Grey SDK not found)
--   With ZED                  = NO (ZED sdk and/or cuda not found)
--   With ZEDOC                = NO (ZED Open Capture not found)
--   With RealSense            = NO (librealsense not found)
--   With RealSense2           = NO (librealsense2 not found)
--   With MyntEyeS             = NO (mynteye s sdk not found)
--   With DepthAI              = NO (depthai-core not found)
-- 
--  Odometry Approaches:
--   With loam_velodyne        = NO (loam_velodyne not found)
--   With floam                = NO (WITH_FLOAM=OFF)
--   With libfovis             = NO (libfovis not found)
--   With libviso2             = NO (libviso2 not found)
--   With dvo_core             = NO (dvo_core not found)
--   With okvis                = NO (okvis not found)
--   With msckf_vio            = NO (WITH_MSCKF_VIO=OFF)
--   With VINS-Fusion          = NO (VINS-Fusion not found)
--   With OpenVINS             = NO (ov_msckf not found)
--   With ORB_SLAM2            = YES (License: GPLv3)
-- Show all options with: cmake -LA | grep WITH_
-- --------------------------------------------
-- Configuring done
AlysonQ commented 2 years ago

Hello @matlabbe , I don't think the problem may because of g2o. I reinstall step by step. Here are some other log as below:

alyson@alyson:~/catkin_ws$ roslaunch rtabmap_ros demo_stereo_outdoor.launch 
WARNING: Could not change permissions for folder [/home/alyson/.ros/log/501b6a16-3230-11ec-ae84-080027b742c0], make sure that the parent folder has correct permissions.
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://alyson:42217/

SUMMARY
========

PARAMETERS
 * /rosdistro: melodic
 * /rosversion: 1.14.12
 * /rtabmap/rtabmap/Grid/DepthDecimation: 4
 * /rtabmap/rtabmap/Grid/FlatObstacleDetected: true
 * /rtabmap/rtabmap/Kp/DetectorStrategy: 6
 * /rtabmap/rtabmap/Kp/MaxDepth: 0
 * /rtabmap/rtabmap/RGBD/CreateOccupancyGrid: true
 * /rtabmap/rtabmap/Rtabmap/TimeThr: 700
 * /rtabmap/rtabmap/Vis/EstimationType: 1
 * /rtabmap/rtabmap/Vis/MaxDepth: 0
 * /rtabmap/rtabmap/frame_id: base_footprint
 * /rtabmap/rtabmap/map_negative_poses_ignored: True
 * /rtabmap/rtabmap/queue_size: 30
 * /rtabmap/rtabmap/subscribe_depth: False
 * /rtabmap/rtabmap/subscribe_rgbd: False
 * /rtabmap/rtabmap/subscribe_stereo: True
 * /rtabmap/stereo_odometry/GFTT/MinDistance: 10
 * /rtabmap/stereo_odometry/GFTT/QualityLevel: 0.00001
 * /rtabmap/stereo_odometry/Odom/GuessMotion: true
 * /rtabmap/stereo_odometry/Odom/Strategy: 0
 * /rtabmap/stereo_odometry/OdomF2M/MaxSize: 1000
 * /rtabmap/stereo_odometry/Vis/EstimationType: 1
 * /rtabmap/stereo_odometry/Vis/MaxDepth: 0
 * /rtabmap/stereo_odometry/Vis/MinInliers: 10
 * /rtabmap/stereo_odometry/frame_id: base_footprint
 * /rtabmap/stereo_odometry/odom_frame_id: odom
 * /rtabmap/stereo_odometry/subscribe_rgbd: False
 * /stereo_camera/stereo_image_proc/disparity_range: 128
 * /use_sim_time: True

NODES
  /
    republish_left (image_transport/republish)
    republish_right (image_transport/republish)
    rviz (rviz/rviz)
  /rtabmap/
    rtabmap (rtabmap_ros/rtabmap)
    stereo_odometry (rtabmap_ros/stereo_odometry)
  /stereo_camera/
    stereo_image_proc (stereo_image_proc/stereo_image_proc)

auto-starting new master
process[master]: started with pid [6163]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 501b6a16-3230-11ec-ae84-080027b742c0
process[rosout-1]: started with pid [6174]
started core service [/rosout]
process[republish_left-2]: started with pid [6181]
process[republish_right-3]: started with pid [6182]
process[stereo_camera/stereo_image_proc-4]: started with pid [6183]
process[rtabmap/stereo_odometry-5]: started with pid [6194]
process[rtabmap/rtabmap-6]: started with pid [6195]
process[rviz-7]: started with pid [6196]
[ WARN] [1634794365.169332546]: The input topic '/stereo_camera/left/camera_info_throttle' is not yet advertised
[ WARN] [1634794365.170162722]: The input topic '/stereo_camera/right/camera_info_throttle' is not yet advertised
[ INFO] [1634794365.993097840]: Starting node...
[ INFO] [1634794366.200711512]: Initializing nodelet with 6 worker threads.
[ INFO] [1634794366.219005396]: Initializing nodelet with 6 worker threads.
[ INFO] [1634794366.341049450]: Odometry: frame_id               = base_footprint
[ INFO] [1634794366.341191939]: Odometry: odom_frame_id          = odom
[ INFO] [1634794366.341240918]: Odometry: publish_tf             = true
[ INFO] [1634794366.341265305]: Odometry: wait_for_transform     = true
[ INFO] [1634794366.341355465]: Odometry: wait_for_transform_duration  = 0.100000
[ INFO] [1634794366.341453278]: Odometry: initial_pose           = xyz=0.000000,0.000000,0.000000 rpy=0.000000,-0.000000,0.000000
[ INFO] [1634794366.341485502]: Odometry: ground_truth_frame_id  = 
[ INFO] [1634794366.341508114]: Odometry: ground_truth_base_frame_id = base_footprint
[ INFO] [1634794366.341541449]: Odometry: config_path            = 
[ INFO] [1634794366.341565216]: Odometry: publish_null_when_lost = true
[ INFO] [1634794366.341589662]: Odometry: guess_frame_id         = 
[ INFO] [1634794366.341618264]: Odometry: guess_min_translation  = 0.000000
[ INFO] [1634794366.341678892]: Odometry: guess_min_rotation     = 0.000000
[ INFO] [1634794366.341708087]: Odometry: guess_min_time         = 0.000000
[ INFO] [1634794366.341731008]: Odometry: expected_update_rate   = 0.000000 Hz
[ INFO] [1634794366.341752266]: Odometry: max_update_rate        = 0.000000 Hz
[ INFO] [1634794366.341803164]: Odometry: wait_imu_to_init       = false
[ INFO] [1634794366.341855809]: Odometry: stereoParams_=1 visParams_=1 icpParams_=0
[ INFO] [1634794366.364955658]: Setting odometry parameter "GFTT/MinDistance"="10"
[ INFO] [1634794366.365468255]: Setting odometry parameter "GFTT/QualityLevel"="0.00001"
[ INFO] [1634794366.397106413]: Setting odometry parameter "Odom/GuessMotion"="true"
[ WARN] [1634794366.440788900]: Parameter "map_negative_poses_ignored" has been removed. Use "map_always_update" instead.
[ INFO] [1634794366.445818431]: /rtabmap/rtabmap(maps): map_filter_radius          = 0.000000
[ INFO] [1634794366.445865716]: /rtabmap/rtabmap(maps): map_filter_angle           = 30.000000
[ INFO] [1634794366.445885649]: /rtabmap/rtabmap(maps): map_cleanup                = true
[ INFO] [1634794366.445899129]: /rtabmap/rtabmap(maps): map_always_update          = false
[ INFO] [1634794366.445912804]: /rtabmap/rtabmap(maps): map_empty_ray_tracing      = true
[ INFO] [1634794366.445922940]: /rtabmap/rtabmap(maps): cloud_output_voxelized     = true
[ INFO] [1634794366.445939806]: /rtabmap/rtabmap(maps): cloud_subtract_filtering   = false
[ INFO] [1634794366.445960493]: /rtabmap/rtabmap(maps): cloud_subtract_filtering_min_neighbors = 2
[ INFO] [1634794366.446459069]: /rtabmap/rtabmap(maps): octomap_tree_depth         = 16
[ INFO] [1634794366.458585940]: Setting odometry parameter "Odom/Strategy"="0"
[ INFO] [1634794366.466735264]: Setting odometry parameter "OdomF2M/MaxSize"="1000"
[ INFO] [1634794366.478440101]: rtabmap: frame_id      = base_footprint
[ INFO] [1634794366.478484812]: rtabmap: map_frame_id  = map
[ INFO] [1634794366.478498268]: rtabmap: use_action_for_goal  = false
[ INFO] [1634794366.478513595]: rtabmap: tf_delay      = 0.050000
[ INFO] [1634794366.478528790]: rtabmap: tf_tolerance  = 0.100000
[ INFO] [1634794366.478540978]: rtabmap: odom_sensor_sync   = false
[ INFO] [1634794366.479289798]: rtabmap: stereo_to_depth = false
[ INFO] [1634794366.479323638]: rtabmap: gen_scan  = false
[ INFO] [1634794366.479338717]: rtabmap: gen_depth  = false
[ INFO] [1634794366.558248519]: Setting RTAB-Map parameter "Grid/DepthDecimation"="4"
[ INFO] [1634794366.560877994]: Setting RTAB-Map parameter "Grid/FlatObstacleDetected"="true"
[ INFO] [1634794366.677130295]: Setting RTAB-Map parameter "Kp/DetectorStrategy"="6"
[ INFO] [1634794366.687015620]: Setting RTAB-Map parameter "Kp/MaxDepth"="0"
[ INFO] [1634794366.705930827]: Setting odometry parameter "Vis/EstimationType"="1"
[ INFO] [1634794366.716668857]: Setting odometry parameter "Vis/MaxDepth"="0"
[ INFO] [1634794366.719965283]: Setting odometry parameter "Vis/MinInliers"="10"
[ INFO] [1634794366.822800742]: Setting RTAB-Map parameter "RGBD/CreateOccupancyGrid"="true"
[ INFO] [1634794366.937932283]: Setting RTAB-Map parameter "Rtabmap/TimeThr"="700"
[ INFO] [1634794366.990634922]: StereoOdometry: approx_sync = false
[ INFO] [1634794366.990676309]: StereoOdometry: queue_size = 5
[ INFO] [1634794366.990691247]: StereoOdometry: subscribe_rgbd = false
[ INFO] [1634794366.990804607]: StereoOdometry: keep_color = false
[ INFO] [1634794367.011523196]: 
/rtabmap/stereo_odometry subscribed to (exact sync):
   /stereo_camera/left/image_rect \
   /stereo_camera/right/image_rect \
   /stereo_camera/left/camera_info_throttle \
   /stereo_camera/right/camera_info_throttle
[ INFO] [1634794367.055259211]: Setting RTAB-Map parameter "Vis/EstimationType"="1"
[ INFO] [1634794367.067623937]: Setting RTAB-Map parameter "Vis/MaxDepth"="0"
[ INFO] [1634794367.386981872]: RTAB-Map detection rate = 1.000000 Hz
[ INFO] [1634794367.396776574]: rtabmap: Deleted database "/home/alyson/.ros/rtabmap.db" (--delete_db_on_start or -d are set).
[ INFO] [1634794367.396826450]: rtabmap: Using database from "/home/alyson/.ros/rtabmap.db" (0 MB).
[ WARN] (2021-10-21 13:32:47.413) Features2d.cpp:561::create() BRIEF, FREAK and DAISY features cannot be used because OpenCV was not built with xfeatures2d module. GFTT/ORB is used instead.
[ WARN] (2021-10-21 13:32:47.440) Features2d.cpp:561::create() BRIEF, FREAK and DAISY features cannot be used because OpenCV was not built with xfeatures2d module. GFTT/ORB is used instead.
[ WARN] (2021-10-21 13:32:47.444) Memory.cpp:742::parseParameters() Mem/UseOdomFeatures is enabled, but Vis/FeatureType and Kp/DetectorStrategy parameters are not the same! Disabling Mem/UseOdomFeatures...
[ WARN] (2021-10-21 13:32:47.445) Features2d.cpp:561::create() BRIEF, FREAK and DAISY features cannot be used because OpenCV was not built with xfeatures2d module. GFTT/ORB is used instead.
[ WARN] (2021-10-21 13:32:47.447) Memory.cpp:742::parseParameters() Mem/UseOdomFeatures is enabled, but Vis/FeatureType and Kp/DetectorStrategy parameters are not the same! Disabling Mem/UseOdomFeatures...
[ WARN] (2021-10-21 13:32:47.513) Features2d.cpp:561::create() BRIEF, FREAK and DAISY features cannot be used because OpenCV was not built with xfeatures2d module. GFTT/ORB is used instead.
[ WARN] (2021-10-21 13:32:47.526) Memory.cpp:742::parseParameters() Mem/UseOdomFeatures is enabled, but Vis/FeatureType and Kp/DetectorStrategy parameters are not the same! Disabling Mem/UseOdomFeatures...
[ INFO] [1634794367.530587341]: rtabmap: Database version = "0.20.14".
[ INFO] [1634794367.530661137]: rtabmap: SLAM mode (Mem/IncrementalMemory=true)
[ WARN] [1634794367.567563045]: rtabmap: Parameters subscribe_stereo and subscribe_rgb cannot be true at the same time. Parameter subscribe_rgb is set to false.
[ INFO] [1634794367.569231246]: /rtabmap/rtabmap: subscribe_depth = false
[ INFO] [1634794367.569315528]: /rtabmap/rtabmap: subscribe_rgb = false
[ INFO] [1634794367.569378194]: /rtabmap/rtabmap: subscribe_stereo = true
[ INFO] [1634794367.569443154]: /rtabmap/rtabmap: subscribe_rgbd = false (rgbd_cameras=1)
[ INFO] [1634794367.569508060]: /rtabmap/rtabmap: subscribe_odom_info = false
[ INFO] [1634794367.569585702]: /rtabmap/rtabmap: subscribe_user_data = false
[ INFO] [1634794367.569677626]: /rtabmap/rtabmap: subscribe_scan = false
[ INFO] [1634794367.569739430]: /rtabmap/rtabmap: subscribe_scan_cloud = false
[ INFO] [1634794367.569806127]: /rtabmap/rtabmap: subscribe_scan_descriptor = false
[ INFO] [1634794367.569862571]: /rtabmap/rtabmap: queue_size    = 30
[ INFO] [1634794367.569928069]: /rtabmap/rtabmap: approx_sync   = false
[ INFO] [1634794367.570102550]: Setup stereo callback
[ INFO] [1634794367.607523592]: 
/rtabmap/rtabmap subscribed to (exact sync):
   /stereo_odometry \
   /stereo_camera/left/image_rect_color \
   /stereo_camera/right/image_rect \
   /stereo_camera/left/camera_info_throttle \
   /stereo_camera/right/camera_info_throttle
[ INFO] [1634794367.765152428]: rtabmap 0.20.14 started...
stereo_odometry: malloc.c:2401: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed.
rtabmap: malloc.c:2401: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed.
No handlers could be found for logger "roslaunch"
[rtabmap/stereo_odometry-5] process has died [pid 6194, exit code -6, cmd /home/alyson/catkin_ws/devel/lib/rtabmap_ros/stereo_odometry left/image_rect:=/stereo_camera/left/image_rect right/image_rect:=/stereo_camera/right/image_rect left/camera_info:=/stereo_camera/left/camera_info_throttle right/camera_info:=/stereo_camera/right/camera_info_throttle rgbd_image:=/stereo_camera/rgbd_image odom:=/stereo_odometry __name:=stereo_odometry __log:=/home/alyson/.ros/log/501b6a16-3230-11ec-ae84-080027b742c0/rtabmap-stereo_odometry-5.log].
log file: /home/alyson/.ros/log/501b6a16-3230-11ec-ae84-080027b742c0/rtabmap-stereo_odometry-5*.log
[rtabmap/rtabmap-6] process has died [pid 6195, exit code -6, cmd /home/alyson/catkin_ws/devel/lib/rtabmap_ros/rtabmap --delete_db_on_start 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_throttle right/camera_info:=/stereo_camera/right/camera_info_throttle rgbd_image:=/stereo_camera/rgbd_image odom:=/stereo_odometry __name:=rtabmap __log:=/home/alyson/.ros/log/501b6a16-3230-11ec-ae84-080027b742c0/rtabmap-rtabmap-6.log].
log file: /home/alyson/.ros/log/501b6a16-3230-11ec-ae84-080027b742c0/rtabmap-rtabmap-6*.log
matlabbe commented 2 years ago

I see it is building with ORB_SLAM2, it is why g2o is available (g2o built inside ORB_SLAM2 is used). However, you should make sure you are using this patch for ORB_SLAM2, to not have malloc problems with Eigen.

AlysonQ commented 2 years ago

Hello, thanks for your advice. It seems work for fix the problem when real-time mapping. But the odometry node still crash when rosbag.

here are commands: roslaunch rtabmap_ros demo_stereo_outdoor.launch rosbag play --clock stereo_outdoorA.bag

未命名

stereo_odometry: malloc.c:2401: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed.
rtabmap: malloc.c:2401: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed.

should I close this issue and open a new one? Thank you very much, Alyson

matlabbe commented 2 years ago

Can you try rebuilding rtabmap without ORB_SLAM2?

cd rtabmap/build
cmake -DWITH_ORB_SLAM=OFF -DWITH_G2O=ON ..
make
make install

then catkin_make again.

AlysonQ commented 2 years ago

It seems something wrong while makestep. 123

matlabbe commented 2 years ago

Not sure to which g2o version it is trying to link to. Normally the default g2o binaries installed with ros should build correctly (ros-noetic-libg2o). Well, try without g2o:

cd rtabmap/build
cmake -DWITH_ORB_SLAM=OFF -DWITH_G2O=OFF ..
make
make install

though ideally having g2o is recommended. If you show the cmake log, we could see to which g2o it is linking to.

AlysonQ commented 2 years ago

here is the cmake log:

alyson@alyson:~/rtabmap/build$ cmake -DWITH_ORB_SLAM=OFF -DWITH_G2O=OFF ..
-- MOBILE_BUILD=OFF
-- The imported target "vtkRenderingPythonTkWidgets" references the file
   "/usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/cmake/vtk-6.3/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtk" references the file
   "/usr/bin/vtk"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/cmake/vtk-6.3/VTKTargets.cmake"
but not all the files it references.

-- PCL definitions don't contain "-march=native", make sure all libraries using Eigen are also compiled without that flag to avoid some segmentation faults (with gdb referring to some Eigen functions).
-- Found Sqlite3: /usr/include /usr/lib/x86_64-linux-gnu/libsqlite3.so
-- Found OpenMP: /usr/lib/gcc/x86_64-linux-gnu/7/libgomp.so;/usr/lib/x86_64-linux-gnu/libpthread.so
-- Add PCL_OMP to definitions
-- Found OpenCV: /usr/include;/usr/include/opencv
-- Found PCL: /usr/include/pcl-1.8;/usr/include/eigen3;/usr/include;/usr/include/ni;/usr/include/openni2;/usr/include/vtk-6.3;/usr/include/freetype2;/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi;/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/opal/mca/event/libevent2022/libevent;/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/opal/mca/event/libevent2022/libevent/include;/usr/lib/x86_64-linux-gnu/openmpi/include;/usr/include/python2.7;/usr/include/x86_64-linux-gnu;/usr/include/hdf5/openmpi;/usr/include/libxml2;/usr/include/jsoncpp;/usr/include/tcl
-- Found ZLIB: /usr/include
-- Could NOT find Qt5Svg (missing: Qt5Svg_DIR)
CMake Warning at /usr/lib/x86_64-linux-gnu/cmake/Qt5/Qt5Config.cmake:39 (message):
  Failed to find Qt5 component "Svg" config file at
  "/usr/lib/x86_64-linux-gnu/cmake/Qt5Svg/Qt5SvgConfig.cmake"
Call Stack (most recent call first):
  CMakeLists.txt:297 (FIND_PACKAGE)

-- VTK_RENDERING_BACKEND=OpenGL
-- Found Freenect: /usr/include
-- Found OpenNI2: /usr/include/openni2
-- Found DC1394: /usr/include/dc1394
-- FlyCapture2_INCLUDE_DIR=FlyCapture2_INCLUDE_DIR-NOTFOUND
-- FlyCapture2_LIBRARY=FlyCapture2_LIBRARY-NOTFOUND
-- Triclops_INCLUDE_DIR=Triclops_INCLUDE_DIR-NOTFOUND
-- Triclops_LIBRARY=Triclops_LIBRARY-NOTFOUND
-- FlyCaptureBridge_LIBRARY=FlyCaptureBridge_LIBRARY-NOTFOUND
-- Found RealSense2: 
-- Found octomap 1.8.1: /usr/include
-- Found ceres 2.0.0: 
-- Architecture: x86_64
-- Found Pthreads
-- --------------------------------------------
-- Info :
--   RTAB-Map Version =     0.20.14
--   CMAKE_VERSION =        3.10.2
--   CMAKE_INSTALL_PREFIX = /home/alyson/catkin_ws/devel
--   CMAKE_BUILD_TYPE =     Release
--   CMAKE_INSTALL_LIBDIR = lib
--   BUILD_APP =            ON
--   BUILD_TOOLS =          ON
--   BUILD_EXAMPLES =       ON
--   BUILD_SHARED_LIBS =    ON
--   CMAKE_CXX_FLAGS =  -fmessage-length=0  -fopenmp -std=c++11
--   FLANN_KDTREE_MEM_OPT = OFF
--   PCL_DEFINITIONS =  ;-DDISABLE_ENSENSO;-DDISABLE_DAVIDSDK;-DDISABLE_DSSDK;-DDISABLE_PCAP;-DDISABLE_PNG;-DDISABLE_LIBUSB_1_0;-DFLANN_STATIC;-Dqh_QHpointer;-DDISABLE_RSSDK
--   PCL_VERSION = 1.8.1
-- 
-- Optional dependencies ('*' affects some default parameters) :
--  *With OpenCV 3.2.0 xfeatures2d = NO, nonfree = NO (License: BSD)
--   With Qt 5.9.5            = YES (License: Open Source or Commercial)
--   With VTK 6.3              = YES (License: BSD)
--   With external SQLite3     = YES (License: Public Domain)
--   With ORB OcTree           = YES (License: GPLv3)
--   With SupertPoint          = NO (WITH_TORCH=OFF)
--   With Python3              = NO (WITH_PYTHON=OFF)
--   With Madgwick             = YES (License: GPL)
--   With FastCV               = NO (FastCV not found)
--   With PDAL                 = NO (PDAL not found)
-- 
--  Solvers:
--   With TORO                 = YES (License: Creative Commons [Attribution-NonCommercial-ShareAlike])
--  *With g2o                  = NO (WITH_G2O=OFF)
--  *With GTSAM                = NO (GTSAM not found)
--  *With Ceres 2.0.0         = YES (License: BSD)
--   With VERTIGO              = NO (GTSAM or g2o required)
--   With cvsba                = NO (cvsba not found)
--  *With libpointmatcher      = NO (libpointmatcher not found)
--   With CCCoreLib            = NO (CCCoreLib not found)
-- 
--  Reconstruction Approaches:
--   With OCTOMAP              = YES (License: BSD)
--   With CPUTSDF              = NO (CPUTSDF not found)
--   With OpenChisel           = NO (open_chisel not found)
--   With AliceVision          = NO (WITH_ALICE_VISION=OFF)
-- 
--  Camera Drivers:
--   With Freenect             = YES (License: Apache v2 and/or GPLv2)
--   With OpenNI2              = YES (License: Apache v2)
--   With Freenect2            = NO (libfreenect2 not found)
--   With Kinect for Windows 2 = NO (Kinect for Windows 2 SDK not found)
--   With Kinect for Azure     = NO (Kinect for Azure SDK not found)
--   With dc1394               = YES (License: LGPL)
--   With FlyCapture2/Triclops = NO (Point Grey SDK not found)
--   With ZED                  = NO (WITH_ZED=OFF)
--   With ZEDOC                = NO (ZED Open Capture not found)
--   With RealSense            = NO (librealsense not found)
--   With RealSense2           = YES (License: Apache-2)
--   With MyntEyeS             = NO (mynteye s sdk not found)
--   With DepthAI              = NO (depthai-core not found)
-- 
--  Odometry Approaches:
--   With loam_velodyne        = NO (loam_velodyne not found)
--   With floam                = NO (WITH_FLOAM=OFF)
--   With libfovis             = NO (libfovis not found)
--   With libviso2             = NO (libviso2 not found)
--   With dvo_core             = NO (dvo_core not found)
--   With okvis                = NO (okvis not found)
--   With msckf_vio            = NO (WITH_MSCKF_VIO=OFF)
--   With VINS-Fusion          = NO (VINS-Fusion not found)
--   With OpenVINS             = NO (ov_msckf not found)
--   With ORB_SLAM             = NO (WITH_ORB_SLAM=OFF)
-- Show all options with: cmake -LA | grep WITH_
-- --------------------------------------------
-- Configuring done
-- Generating done
-- Build files have been written to: /home/alyson/rtabmap/build

though the rtabmap is built successful, the demo_stereo_outdoor.launch is still has rgbd_odometry crash. 未命名

matlabbe commented 2 years ago

Humm, can you try without ceres? If I remember, there are some issues with CERES 2.

cd rtabmap/build
cmake -DWITH_ORB_SLAM=OFF -DWITH_G2O=OFF -DWITH_CERES=OFF ..
make
make install

Otherwise, make sure gdb is installed, then in demo_stereo_outdoor.launch, add launch-prefix="xterm -e gdb --args" next to output="screen" here: https://github.com/introlab/rtabmap_ros/blob/42fca441ff2a4200981d205dc3e09d5eeeb791d3/launch/demo/demo_stereo_outdoor.launch#L50

Type run in gdb terminal, when the node crashes, type bt(backtrace) to show the backtrace.

AlysonQ commented 2 years ago

the gdb terminal shows

(gdb)bt
No stack
(gdb)
matlabbe commented 2 years ago

Did you start the node with run to initialize it?

AlysonQ commented 2 years ago

Sorry... I miss the runcommand

01 02 03

matlabbe commented 2 years ago

It is crashing in libimage_transport_plugins.so. There is something wrong with the ros binaries. I suggest to do a sudo apt upgrade to make sure all ros binaries are at the latest version. Then delete your ~/catkin_ws/build directory and redo a catkin_make.

matlabbe commented 1 year ago

The malloc.c:2379: sysmalloc: Assertion '(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed. is caused by latest realsense2 library when rtabmap is built with it. The workaround to make the ros node not crash on this malloc assertion is to build rtabmap library without realsense2 support:

cd rtabmap/build
cmake -DWITH_REALSENSE2=OFF ..
make

Related issue: https://github.com/introlab/rtabmap_ros/issues/881