Keep reinstalling rtabmap and rtabmap_ros

Somehow I find rtabmap have to be keep reinstalling[1]

When does this happen

I can't do rosluanch rtabmap_ros rtabmap.launch

Error code:

[rtabmap.launch] is neither a launch file in package [rtabmap_ros] nor is [rtabmap_ros] a launch file name
The traceback for the exception was written to the log file

And

cd catkin_ws
catkin_make
make[2]: *** No rule to make target '/opt/ros/kinetic/lib/libg2o_core.so', needed by '/home/william/catkin_ws/devel/lib/rtabmap_ros/imu_to_tf'.  Stop.
make[2]: *** Waiting for unfinished jobs....
[  1%] Building CXX object rtabmap_ros/CMakeFiles/rtabmap_pointcloud_to_depthimage.dir/src/PointCloudToDepthImageNode.cpp.o
make[2]: *** No rule to make target '/opt/ros/kinetic/lib/libg2o_core.so', needed by '/home/william/catkin_ws/devel/lib/rtabmap_ros/rgbdicp_odometry'.  Stop.
make[2]: *** Waiting for unfinished jobs....
make[2]: *** No rule to make target '/opt/ros/kinetic/lib/libg2o_core.so', needed by '/home/william/catkin_ws/devel/lib/rtabmap_ros/rgbd_relay'.  Stop.
make[2]: *** Waiting for unfinished jobs....
make[2]: *** No rule to make target '/opt/ros/kinetic/lib/libg2o_core.so', needed by '/home/william/catkin_ws/devel/lib/rtabmap_ros/pointcloud_to_depthimage'.  Stop.
make[2]: *** Waiting for unfinished jobs....
[  2%] Building CXX object rtabmap_ros/CMakeFiles/rtabmap_imu_to_tf.dir/src/ImuToTFNode.cpp.o
[  2%] Building CXX object rtabmap_ros/CMakeFiles/rtabmap_rgbdicp_odometry.dir/src/RGBDICPOdometryNode.cpp.o
[  2%] Building CXX object rtabmap_ros/CMakeFiles/rtabmap_rgbd_relay.dir/src/RGBDRelayNode.cpp.o
CMakeFiles/Makefile2:3055: recipe for target 'rtabmap_ros/CMakeFiles/rtabmap_imu_to_tf.dir/all' failed
make[1]: *** [rtabmap_ros/CMakeFiles/rtabmap_imu_to_tf.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:4244: recipe for target 'rtabmap_ros/CMakeFiles/rtabmap_rgbd_relay.dir/all' failed
make[1]: *** [rtabmap_ros/CMakeFiles/rtabmap_rgbd_relay.dir/all] Error 2
CMakeFiles/Makefile2:752: recipe for target 'rtabmap_ros/CMakeFiles/rtabmap_pointcloud_to_depthimage.dir/all' failed
make[1]: *** [rtabmap_ros/CMakeFiles/rtabmap_pointcloud_to_depthimage.dir/all] Error 2
CMakeFiles/Makefile2:3587: recipe for target 'rtabmap_ros/CMakeFiles/rtabmap_rgbdicp_odometry.dir/all' failed
make[1]: *** [rtabmap_ros/CMakeFiles/rtabmap_rgbdicp_odometry.dir/all] Error 2
Makefile:116: recipe for target 'all' failed

I have totally no idea why this would happen to g2o?

How did I solve[2]

cd ~/rtabmap/build
rm -rf *
cmake -DCMAKE_INSTALL_PREFIX=~/catkin_ws/devel .. 
make -j4
sudo make install
cd ~/catkin_ws
catkin_make

References:

[1] Keep reinstalling rtabmap because of missing libfreenect.so every day · Issue #424 · introlab/rtabmap
[2] introlab/rtabmap_ros: RTAB-Map's ROS package.

原文地址:https://www.cnblogs.com/linweilin/p/11422512.html