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

Rcl init failed to find shared library of rmw implementation

asked 2019-06-13 12:11:56 -0500

ananya.muddu gravatar image

updated 2019-06-14 04:05:15 -0500

Hi,

I installed ROS2 Dashing via the Debian package (desktop). The demo listener crashes after failing to find the Fast RTPS library (default RMW).

$ ros2 run demo_nodes_cpp listener
terminate called after throwing an instance of 'rclcpp::exceptions::RCLError'
what():  failed to initialized rcl init options: failed to find shared library of rmw implementation.   Searched rmw_fastrtps_cpp, at /tmp/binarydeb/ros-dashing-rmw-implementation-0.7.1/src/functions.cpp:130, at /tmp/binarydeb/ros-dashing-rcl-0.7.4/src/rcl/init_options.c:55
$ locate librmw_fastrtps_cpp.so 
/opt/ros/dashing/lib/librmw_fastrtps_cpp.so
$ env | grep ROS
ROS_VERSION=2
ROS_PYTHON_VERSION=3
ROS_DISTRO=dashing
$ ldconfig -p | grep libfastrtps
libfastrtps.so.1 (libc6,x86-64) => /opt/ros/dashing/lib/libfastrtps.so.1
libfastrtps.so (libc6,x86-64) => /opt/ros/dashing/lib/libfastrtps.so
$ echo $LD_LIBRARY_PATH 
/home/fireman/ros2_examples_ws/install/examples_rclcpp_minimal_composition/lib:/opt/ros/dashing/opt/yaml_cpp_vendor/lib:/opt/ros/dashing/opt/rviz_ogre_vendor/lib:/usr/lib:/opt/ros/dashing/lib

My Linux distribution is Ubuntu 18.04.

edit retag flag offensive close merge delete

Comments

On ubuntu that should search LD_LIBRARY_PATH. What is the output of echo $LD_LIBRARY_PATH? Was that variable modified after sourcing /opt/ros/dashing/setup.bash?

sloretz gravatar image sloretz  ( 2019-06-13 14:32:50 -0500 )edit

@sloretz: Thanks! I have edited the question to include LD_LIBRARY_PATH and the ldconfig cache. No problems there.

ananya.muddu gravatar image ananya.muddu  ( 2019-06-14 02:42:17 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-11-23 04:42:33 -0500

I was bitten by this issue as well.

Make sure LD_LIBRARY_PATH is set. This is important, even if the librmw_fastrtps_cpp.so file exists in /usr/lib, since the RMW code will explicitly look for LD_LIBRARY_PATH.

See also this interesting issue: https://github.com/ros2/rcpputils/iss...

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2019-06-13 12:11:56 -0500

Seen: 2,562 times

Last updated: Nov 23 '20