Login  Register

Problem while running RTAB-Map installed from ROS

classic Classic list List threaded Threaded
6 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Problem while running RTAB-Map installed from ROS

g.bartoli
85 posts
Hi Mathieu,
I have a fresh Ubuntu 16.04 + ROS Kinetic install with all updates.
I have to make some tests with stereo odometry using data from a Duo3D camera so I installed RTAB-Map from the standard ROS package with
sudo apt-get install ros-kinetic-rtabmap-ros
then I created a simple launch file just to test if everything is working (no other nodes are running):
<launch>
    <node pkg="rtabmap_ros" type="stereo_odometry" name="stereo_odometry" output="screen"/>
<launch>
However, when I launch it, I receive the following error:
/opt/ros/kinetic/lib/rtabmap_ros/stereo_odometry: error while loading shared libraries: librtabmap_core.so.0.11: cannot open shared object file: No such file or directory
failed to start local process: /opt/ros/kinetic/lib/rtabmap_ros/stereo_odometry __name:=stereo_odometry __log:=/home/agrirobot/.ros/log/33572a9a-473b-11e6-9c2d-0001c0182df6/stereo_odometry-6.log
local launch of rtabmap_ros/stereo_odometry failed
[stereo_odometry-6] process has died [pid -1, exit code 127, cmd /opt/ros/kinetic/lib/rtabmap_ros/stereo_odometry __name:=stereo_odometry __log:=/home/agrirobot/.ros/log/33572a9a-473b-11e6-9c2d-0001c0182df6/stereo_odometry-6.log].
log file: /home/agrirobot/.ros/log/33572a9a-473b-11e6-9c2d-0001c0182df6/stereo_odometry-6*.log
It seems it cannot find the rtabmap library... Wasn't it supposed to be installed together with the ROS package?

Thanks,
Guido
~Guido
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Problem while running RTAB-Map installed from ROS

g.bartoli
85 posts
This post was updated on Jul 11, 2016; 8:08am.
As a side note, running rtabmap standalone from terminal works, it just give some warnings, but I think they are not related with the other problem:
~$ rtabmap
[ INFO] (2016-07-11 10:07:33.509) PreferencesDialog.cpp:1841::writeSettings() modified RGBD/ProximityAngle = 45.0->45
[ INFO] (2016-07-11 10:07:33.509) PreferencesDialog.cpp:1841::writeSettings() modified Rtabmap/LoopRatio = 0.0->0
[ INFO] (2016-07-11 10:07:33.509) PreferencesDialog.cpp:1841::writeSettings() modified Rtabmap/TimeThr = 0.0->0
[ INFO] (2016-07-11 10:07:33.509) PreferencesDialog.cpp:1841::writeSettings() modified Vis/MaxDepth = 0.0->0
[ INFO] (2016-07-11 10:07:33.509) PreferencesDialog.cpp:1841::writeSettings() modified Vis/MinDepth = 0.0->0
[ INFO] (2016-07-11 10:07:33.509) PreferencesDialog.cpp:1841::writeSettings() modified Vis/PnPReprojError = 2.0->2
QMutex: destroying locked mutex
~Guido
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Problem while running RTAB-Map installed from ROS

matlabbe
Administrator
4446 posts
Hi Guido,

This error happens when the linker cannot find the library on runtime in the standard paths. The rtabmap library uses multi-arch installation, so it would be installed in /opt/ros/kinetic/lib/x86_64-linux-gnu instead of /opt/ros/kinetic/lib.

For some reasons, the library paths may not be correctly set on a fresh install. Make sure to source the setup.bash in your catkin devel workspace, it sometimes add lib/x86_64-linux-gnu to LD_LIBRARY_PATH environment variable. If not automatically added, you can add it manually (or add this line at the end of your "~/.bashrc"):
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/ros/kinetic/lib/x86_64-linux-gnu

For the rtabmap standalone, these are info logs, not warnings. However, they should not appear normally: there is a minor bug that makes think 45.0 is different than 45 (they are compared as string, not as double).

cheers
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Problem while running RTAB-Map installed from ROS

g.bartoli
85 posts
I have these files in the folder you mentioned:
$ ls /opt/ros/kinetic/lib/x86_64-linux-gnu/
librtabmap_core.so         librtabmap_gui.so         librtabmap_utilite.so         rtabmap-0.11
librtabmap_core.so.0.11    librtabmap_gui.so.0.11    librtabmap_utilite.so.0.11
librtabmap_core.so.0.11.7  librtabmap_gui.so.0.11.7  librtabmap_utilite.so.0.11.7
And these are the last two lines of my ~/.bash.rc
source /opt/ros/kinetic/setup.bash
source ~/catkin_ws/devel/setup.bash
But the real problem was LD_LIBRARY_PATH, as you suggested:
$ echo $LD_LIBRARY_PATH 
/home/guido/catkin_ws/devel/lib:/opt/ros/kinetic/lib
I appended the 'export' line to .bashrc and now it works!

Thanks for your precious suggestions, as always.
~Guido
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Problem while running RTAB-Map installed from ROS

g.bartoli
85 posts
This post was updated on Jul 12, 2016; 7:06am.
PS: shouldn't this workaround be included in the official installation guide of RTAB-Map?
~Guido
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Problem while running RTAB-Map installed from ROS

matlabbe
Administrator
4446 posts
Yes, now it is! I added an issue to avoid this extra step though.

cheers