introlab / rtabmap_ros

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

RTABMAP_ROS segmentation error #178

Open feignedjesse2 opened 7 years ago

feignedjesse2 commented 7 years ago

Hello,

I have been using RTABMAP for quite a while now to map my environment using freenect (with kinect 360) and rtabmap. normally I always use roslaunch rtabmap_ros rtabmap.launch, but this does not work anymore suddenly. I get error -11, segmentation error:

 jesse@jesse-W35xSTQ-370ST:~/catkin_ws$ roslaunch rtabmap_ros rtabmap.launch 
... logging to /home/jesse/.ros/log/6bfe6120-490f-11e7-87da-0cd2923bd742/roslaunch-jesse-W35xSTQ-370ST-29710.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://jesse-W35xSTQ-370ST:33719/

SUMMARY
========

PARAMETERS
 * /rosdistro: indigo
 * /rosversion: 1.11.21
 * /rtabmap/rgbd_odometry/approx_sync: True
 * /rtabmap/rgbd_odometry/config_path: 
 * /rtabmap/rgbd_odometry/frame_id: camera_link
 * /rtabmap/rgbd_odometry/queue_size: 10
 * /rtabmap/rgbd_odometry/wait_for_transform_duration: 0.2
 * /rtabmap/rtabmap/Mem/IncrementalMemory: true
 * /rtabmap/rtabmap/Mem/InitWMWithAllNodes: false
 * /rtabmap/rtabmap/approx_sync: True
 * /rtabmap/rtabmap/config_path: 
 * /rtabmap/rtabmap/database_path: ~/.ros/rtabmap.db
 * /rtabmap/rtabmap/frame_id: camera_link
 * /rtabmap/rtabmap/queue_size: 10
 * /rtabmap/rtabmap/subscribe_depth: True
 * /rtabmap/rtabmap/subscribe_scan: False
 * /rtabmap/rtabmap/subscribe_scan_cloud: False
 * /rtabmap/rtabmap/subscribe_stereo: False
 * /rtabmap/rtabmap/wait_for_transform_duration: 0.2
 * /rtabmap/rtabmapviz/frame_id: camera_link
 * /rtabmap/rtabmapviz/queue_size: 10
 * /rtabmap/rtabmapviz/subscribe_depth: True
 * /rtabmap/rtabmapviz/subscribe_odom_info: True
 * /rtabmap/rtabmapviz/subscribe_scan: False
 * /rtabmap/rtabmapviz/subscribe_scan_cloud: False
 * /rtabmap/rtabmapviz/subscribe_stereo: False
 * /rtabmap/rtabmapviz/wait_for_transform_duration: 0.2

NODES
  /rtabmap/
    rgbd_odometry (rtabmap_ros/rgbd_odometry)
    rtabmap (rtabmap_ros/rtabmap)
    rtabmapviz (rtabmap_ros/rtabmapviz)

ROS_MASTER_URI=http://localhost:11311

core service [/rosout] found
process[rtabmap/rgbd_odometry-1]: started with pid [29728]
process[rtabmap/rtabmap-2]: started with pid [29729]
process[rtabmap/rtabmapviz-3]: started with pid [29730]
[ INFO] [1496574904.414697913]: Initializing nodelet with 8 worker threads.
[ INFO] [1496574904.428332363]: Starting node...
[ INFO] [1496574904.476739692]: Starting node...
[ INFO] [1496574904.495772953]: rtabmap: frame_id = camera_link
[ INFO] [1496574904.495812923]: rtabmap: map_frame_id = map
[ INFO] [1496574904.495826741]: rtabmap: queue_size = 10
[ INFO] [1496574904.495849953]: rtabmap: tf_delay = 0.050000
[ INFO] [1496574904.495864266]: rtabmap: tf_tolerance = 0.100000
[ INFO] [1496574904.495876985]: rtabmap: depth_cameras = 1
[ INFO] [1496574904.495886533]: rtabmap: approx_sync = true
[ INFO] [1496574904.541254182]: rtabmapviz: Using configuration from "/home/jesse/.ros/rtabmap_gui.ini"
[ INFO] [1496574904.673177881]: Setting RTAB-Map parameter "Mem/IncrementalMemory"="true"
[ INFO] [1496574904.674021232]: Setting RTAB-Map parameter "Mem/InitWMWithAllNodes"="false"
[ INFO] [1496574905.065615865]: 
/rtabmap/rgbd_odometry subscribed to (approx sync):
   /camera/rgb/image_rect_color,
   /camera/depth_registered/image_raw,
   /camera/rgb/camera_info
[ INFO] [1496574905.295339803]: RTAB-Map detection rate = 1.000000 Hz
[ INFO] [1496574905.295393791]: rtabmap: Using database from "/home/jesse/.ros/rtabmap.db".
[ INFO] [1496574905.300958069]: rtabmap: Database version = "0.11.8".
[rtabmap/rtabmapviz-3] process has died [pid 29730, exit code -11, cmd /opt/ros/indigo/lib/rtabmap_ros/rtabmapviz -d ~/.ros/rtabmap_gui.ini rgb/image:=/camera/rgb/image_rect_color depth/image:=/camera/depth_registered/image_raw rgb/camera_info:=/camera/rgb/camera_info 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 __name:=rtabmapviz __log:=/home/jesse/.ros/log/6bfe6120-490f-11e7-87da-0cd2923bd742/rtabmap-rtabmapviz-3.log].
log file: /home/jesse/.ros/log/6bfe6120-490f-11e7-87da-0cd2923bd742/rtabmap-rtabmapviz-3*.log
[ INFO] [1496574905.444893836]: 
/rtabmap/rtabmap subscribed to (approx sync):
   /camera/rgb/image_rect_color,
   /camera/depth_registered/image_raw,
   /camera/rgb/camera_info,
   /rtabmap/odom
[ INFO] [1496574905.445257760]: rtabmap 0.11.8 started...

I have tried running the individual nodes and the node rtabmapviz, called by using rosrun rtabmap rtabmapviz throws the following error:

jesse@jesse-W35xSTQ-370ST:~$ rosrun rtabmap_ros rtabmapviz

Segmentatiefout (geheugendump gemaakt) jesse@jesse-W35xSTQ-370ST:~$

"Segmentatiefout" is Dutch for segmentation error.

since this node is also run from the launch file I think this is the problem

So I tried installing from source (following all the instructions from this github page), maybe it would fix this issue, but when using make -j4 I get these errors:


make -j4
[  5%] Built target rtabmap_utilite
Scanning dependencies of target imagesJoiner
Scanning dependencies of target extractObject
[  5%] Built target res_tool
[  6%] Building CXX object tools/ImagesJoiner/CMakeFiles/imagesJoiner.dir/main.cpp.o
[  6%] Building CXX object tools/ExtractObject/CMakeFiles/extractObject.dir/main.cpp.o
[  7%] [  7%] Building CXX object corelib/src/CMakeFiles/rtabmap_core.dir/OptimizerGTSAM.cpp.o
Building CXX object corelib/src/CMakeFiles/rtabmap_core.dir/OptimizerG2O.cpp.o
Linking CXX executable ../../../bin/rtabmap-imagesJoiner
[  7%] Built target imagesJoiner
[  7%] Building CXX object corelib/src/CMakeFiles/rtabmap_core.dir/OptimizerCVSBA.cpp.o
In file included from /opt/ros/indigo/include/g2o/types/sba/types_sba.h:30:0,
                 from /home/jesse/rtabmap/corelib/src/OptimizerG2O.cpp:49:
/opt/ros/indigo/include/g2o/core/base_vertex.h:62:67: warning: ‘Eigen::AlignedBit’ is deprecated (declared at /usr/local/include/eigen3/Eigen/src/Core/util/Constants.h:162) [-Wdeprecated-declarations]
     typedef Map<Matrix<double, D, D>, Matrix<double,D,D>::Flags & AlignedBit ? Aligned : Unaligned >  HessianBlockType;
                                                                   ^
In file included from /opt/ros/indigo/include/g2o/types/sba/types_sba.h:31:0,
                 from /home/jesse/rtabmap/corelib/src/OptimizerG2O.cpp:49:
/opt/ros/indigo/include/g2o/core/base_binary_edge.h:59:75: warning: ‘Eigen::AlignedBit’ is deprecated (declared at /usr/local/include/eigen3/Eigen/src/Core/util/Constants.h:162) [-Wdeprecated-declarations]
       typedef Map<Matrix<double, Di, Dj>, Matrix<double, Di, Dj>::Flags & AlignedBit ? Aligned : Unaligned > HessianBlockType;
                                                                           ^
/opt/ros/indigo/include/g2o/core/base_binary_edge.h:60:75: warning: ‘Eigen::AlignedBit’ is deprecated (declared at /usr/local/include/eigen3/Eigen/src/Core/util/Constants.h:162) [-Wdeprecated-declarations]
       typedef Map<Matrix<double, Dj, Di>, Matrix<double, Dj, Di>::Flags & AlignedBit ? Aligned : Unaligned > HessianBlockTransposedType;
                                                                           ^
In file included from /opt/ros/indigo/include/g2o/types/sba/types_sba.h:32:0,
                 from /home/jesse/rtabmap/corelib/src/OptimizerG2O.cpp:49:
/opt/ros/indigo/include/g2o/core/base_multi_edge.h:69:47: warning: ‘Eigen::AlignedBit’ is deprecated (declared at /usr/local/include/eigen3/Eigen/src/Core/util/Constants.h:162) [-Wdeprecated-declarations]
       typedef Map<MatrixXd, MatrixXd::Flags & AlignedBit ? Aligned : Unaligned > HessianBlockType;
                                               ^
[  8%] Building CXX object corelib/src/CMakeFiles/rtabmap_core.dir/Registration.cpp.o
[  8%] Building CXX object corelib/src/CMakeFiles/rtabmap_core.dir/RegistrationIcp.cpp.o
[  9%] Building CXX object corelib/src/CMakeFiles/rtabmap_core.dir/RegistrationVis.cpp.o
In file included from /usr/local/include/eigen3/Eigen/Core:347:0,
                 from /home/jesse/rtabmap/corelib/src/../include/rtabmap/core/Transform.h:34,
                 from /home/jesse/rtabmap/corelib/src/../include/rtabmap/core/Link.h:33,
                 from /home/jesse/rtabmap/corelib/src/../include/rtabmap/core/Optimizer.h:35,
                 from /home/jesse/rtabmap/corelib/src/../include/rtabmap/core/OptimizerG2O.h:33,
                 from /home/jesse/rtabmap/corelib/src/OptimizerG2O.cpp:35:
/usr/local/include/eigen3/Eigen/src/Core/AssignEvaluator.h: In instantiation of ‘void Eigen::internal::call_assignment_no_alias(Dst&, const Src&, const Func&) [with Dst = Eigen::Matrix<int, -1, 1>; Src = Eigen::Matrix<long int, -1, 1, 0, -1, 1>; Func = Eigen::internal::assign_op<int, long int>]’:
/usr/local/include/eigen3/Eigen/src/Core/AssignEvaluator.h:804:42:   required from ‘void Eigen::internal::call_assignment(Dst&, const Src&, const Func&, typename Eigen::internal::enable_if<(! Eigen::internal::evaluator_assume_aliasing<Src>::value), void*>::type) [with Dst = Eigen::Matrix<int, -1, 1>; Src = Eigen::Matrix<long int, -1, 1, 0, -1, 1>; Func = Eigen::internal::assign_op<int, long int>; typename Eigen::internal::enable_if<(! Eigen::internal::evaluator_assume_aliasing<Src>::value), void*>::type = void*]’
/usr/local/include/eigen3/Eigen/src/Core/AssignEvaluator.h:782:93:   required from ‘void Eigen::internal::call_assignment(Dst&, const Src&) [with Dst = Eigen::Matrix<int, -1, 1>; Src = Eigen::Matrix<long int, -1, 1, 0, -1, 1>]’
/usr/local/include/eigen3/Eigen/src/Core/PlainObjectBase.h:710:65:   required from ‘Derived& Eigen::PlainObjectBase<Derived>::_set(const Eigen::DenseBase<OtherDerived>&) [with OtherDerived = Eigen::Matrix<long int, -1, 1, 0, -1, 1>; Derived = Eigen::Matrix<int, -1, 1>]’
/usr/local/include/eigen3/Eigen/src/Core/Matrix.h:225:30:   required from ‘Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>& Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::operator=(const Eigen::DenseBase<OtherDerived>&) [with OtherDerived = Eigen::Matrix<long int, -1, 1, 0, -1, 1>; _Scalar = int; int _Rows = -1; int _Cols = 1; int _Options = 0; int _MaxRows = -1; int _MaxCols = 1]’
/usr/local/include/eigen3/Eigen/src/Core/PermutationMatrix.h:365:17:   required from ‘Eigen::PermutationMatrix<SizeAtCompileTime, MaxSizeAtCompileTime, IndexType>& Eigen::PermutationMatrix<SizeAtCompileTime, MaxSizeAtCompileTime, IndexType>::operator=(const Eigen::PermutationBase<OtherDerived>&) [with Other = Eigen::PermutationMatrix<-1, -1, long int>; int SizeAtCompileTime = -1; int MaxSizeAtCompileTime = -1; _StorageIndex = int]’
/opt/ros/indigo/include/g2o/solvers/eigen/linear_solver_eigen.h:66:18:   required from ‘void g2o::LinearSolverEigen<MatrixType>::CholeskyDecomposition::analyzePatternWithPermutation(g2o::LinearSolverEigen<MatrixType>::SparseMatrix&, const PermutationMatrix&) [with MatrixType = Eigen::Matrix<double, 6, 6>; g2o::LinearSolverEigen<MatrixType>::SparseMatrix = Eigen::SparseMatrix<double, 0>; g2o::LinearSolverEigen<MatrixType>::PermutationMatrix = Eigen::PermutationMatrix<-1, -1, long int>]’
/opt/ros/indigo/include/g2o/solvers/eigen/linear_solver_eigen.h:193:9:   required from ‘void g2o::LinearSolverEigen<MatrixType>::computeSymbolicDecomposition(const g2o::SparseBlockMatrix<MatrixType>&) [with MatrixType = Eigen::Matrix<double, 6, 6>]’
/opt/ros/indigo/include/g2o/solvers/eigen/linear_solver_eigen.h:98:39:   required from ‘bool g2o::LinearSolverEigen<MatrixType>::solve(const g2o::SparseBlockMatrix<MatrixType>&, double*, double*) [with MatrixType = Eigen::Matrix<double, 6, 6>]’
/home/jesse/rtabmap/corelib/src/OptimizerG2O.cpp:1012:1:   required from here
/usr/local/include/eigen3/Eigen/src/Core/util/StaticAssert.h:32:40: error: static assertion failed: YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY
     #define EIGEN_STATIC_ASSERT(X,MSG) static_assert(X,#MSG);
                                        ^
/usr/local/include/eigen3/Eigen/src/Core/util/XprHelper.h:816:3: note: in expansion of macro ‘EIGEN_STATIC_ASSERT’
   EIGEN_STATIC_ASSERT((Eigen::internal::has_ReturnType<ScalarBinaryOpTraits<LHS, RHS,BINOP> >::value), \
   ^
/usr/local/include/eigen3/Eigen/src/Core/AssignEvaluator.h:834:3: note: in expansion of macro ‘EIGEN_CHECK_BINARY_COMPATIBILIY’
   EIGEN_CHECK_BINARY_COMPATIBILIY(Func,typename ActualDstTypeCleaned::Scalar,typename Src::Scalar);
   ^
[  9%] Building CXX object corelib/src/CMakeFiles/rtabmap_core.dir/Odometry.cpp.o
make[2]: *** [corelib/src/CMakeFiles/rtabmap_core.dir/OptimizerG2O.cpp.o] Fout 1
make[2]: *** Wachten op onvoltooide taken...
Linking CXX executable ../../../bin/rtabmap-extractObject
[  9%] Built target extractObject
make[1]: *** [corelib/src/CMakeFiles/rtabmap_core.dir/all] Fout 2
make: *** [all] Fout 2

I just dont understand what is wrong, why did it work yesterday and not today?

matlabbe commented 7 years ago

Did you do a system update? I see you have your own Eigen installed, maybe there is a mismatch version between Eigen used by g2o binaries and the eigen installed in your /usr/local. Try build without g2o:

$ cd rtabmap/build
$ cmake -DWITH_G2O=OFF ..
$ make

or you would need to build g2o from source so it can correctly use your Eigen instead of the system one.

cheers