orocos/rtt_ros2_integration

Setcap/soem with rtt_ros2

Opened this issue · 0 comments

Dear all,
I was working to compile the soem master
I found that once you grant permissions to the deployer executable to use the raw packages (running the setcap.sh) i have problems if finding shared libraries.
to describe the issue, I will note down the steps.

first I grant the permissions to the deployer

sudo setcap cap_net_raw+ep `which deployer-$OROCOS_TARGET`

Then, I try in the deployer shell the following commands.

Deployer [S]> import("rtt_ros2")
 = true                

Deployer [S]> import("rtt_ros2_node")
17.346 [ ERROR  ][ComponentLoader::import(path_list)] could not load library '/home/gborghesan/orocos/foxy/lib/orocos/gnulinux/rtt_ros2_node/plugins/librtt_ros2_node_service-gnulinux.so': liblibstatistics_collector.so: cannot open shared object file: No such file or directory
17.347 [ ERROR  ][ComponentLoader::import(path_list)] Some found plugins could not be loaded !
17.348 [ ERROR  ][Logger] Exception raised while executing an operation : Some found plugins could not be loaded !
17.348 [ ERROR  ][Logger] in Deployer: unhandled exception in sent operation.
The command 'import("rtt_ros2_node")' caused a std::exception: 'Unable to complete the operation call. The called operation has thrown an exception' and could not be completed.
Deployer [X]> 

The file liblibstatistics_collector.so is in /opt/ros/foxy/lib.
A similar issue I got also with ROS1 integration, and i solved adding the path of ros shared libraries to ldconfig. using the same approach, I execute the following

cd /etc/ld.so.conf.d/
sudo touch ros2.conf
sudo sh -c 'echo "/opt/ros/foxy/lib/" > ros2.conf'
sudo ldconfig

Again in the deployer: using the same commands as before, I get

Deployer [S]> import("rtt_ros2")
 = true                

Deployer [S]> import("rtt_ros2_node")
7.054 [ ERROR  ][ComponentLoader::import(path_list)] failed to initialize rcl init options: failed to find shared library of rmw implementation. Searched rmw_fastrtps_cpp, at /tmp/binarydeb/ros-foxy-rmw-implementation-1.0.1/src/functions.cpp:54, at /tmp/binarydeb/ros-foxy-rcl-1.1.10/src/rcl/init_options.c:61
7.054 [ ERROR  ][Logger] Exception raised while executing an operation : Some found plugins could not be loaded !
7.054 [ ERROR  ][Logger] in Deployer: unhandled exception in sent operation.
The command 'import("rtt_ros2_node")' caused a std::exception: 'Unable to complete the operation call. The called operation has thrown an exception' and could not be completed.
Deployer [X]> 

The file librmw_fastrtps_cpp.so is in the same path. but it cannot be found.
The workaround (I think that it works, but not really tested) is to launch as sudo

sudo su
source /home/gborghesan/.bashrc
deployer

Do you have any insight on this?
I think this is related with
ros2/rcpputils#40