Can't execute the snap application from the course on my local installation

Hello,
I have followed the course until the end, everything works on the Rosject. But when I try to run the application from the course (from the last example with the plugs). The snap app has been built in the Rosject and downloaded from the GUI.
Here is the snapcraft.yaml:

name: ros2-talker-listener
version: '0.1'
summary: ROS 2 Talker/Listener Example
description: |
 This example launches a ROS 2 talker and listener.

confinement: strict
grade: stable
base: core22

parts:
 ros-demos:
   plugin: colcon
   source: https://github.com/ros2/demos.git
   source-branch: humble
   source-subdir: demo_nodes_cpp
   build-packages: [build-essential]
   stage-packages: [ros-humble-ros2launch, ros-humble-ros2topic]

apps:
 ros2-talker-listener:
   command: opt/ros/humble/bin/ros2 launch demo_nodes_cpp talker_listener.launch.py
   daemon: simple
   plugs: [network, network-bind]
   extensions: [ros2-humble]

apps:
 ros2topic:
   command: opt/ros/humble/bin/ros2 topic
   plugs: [network, network-bind]
   extensions: [ros2-humble]

The application can’t start and I have the following error message:
Error getting RMW implementation identifier / RMW implementation not installed (expected identifier of ‘rmw_cyclonedds_cpp’), with error message 'failed to load shared library ‘librmw_cyclonedds_cpp.so’ due to dlopen error: librmw_cyclonedds_cpp.so: cannot open shared object file: No such file or directory

My computer has a ROS2 Humble installation on Ubuntu 22.04. I have also installed rmw-cyclonedds-cpp. Does anyone have an idea how to fix this error?

That error means that you have not installed the package ros-humble-rmw-cyclonedds-cpp. Can you please check it with the command 'sudo apt install ros-humble-rmw-cyclonedds-cpp` ?

Also, take into account that one thing is to have it installed in your local system and another is to have it in the app. Can you also check that?

I’m forwarding the question to Canonical itself, so they will be better equipped to answer it

Hi @rtellez,
Thanks for you answer, I already have ros-humble-rmw-cyclonedds-cpp installed on my system (double checked with the package installation).
For the application, it’s the one from the tutorial so I don’t know. It should be in confinement: strict so from the class I understand that is should not be to dependent of my system installation.

Hello,
The reason why this is happening is probably because you are trying to use cycloneDDS instead of fast DDS with the snap. By default the snap only embeds the default DDS implementation (since it’s a dependency).
To solve this you can either use FastDDS on your host or add cycloneDDS manually (because it’s not a dependency listed in the package.xml) to the snapcraft.yaml:

parts:
 ros-demos:
   plugin: colcon
   source: https://github.com/ros2/demos.git
   source-branch: humble
   source-subdir: demo_nodes_cpp
   build-packages: [build-essential]
-   stage-packages: [ros-humble-ros2launch, ros-humble-ros2topic]
+   stage-packages: [ros-humble-ros2launch, ros-humble-ros2topic, ros-humble-rmw-cyclonedds-cpp]

Then, repackage your snap with the command snapcraft.

Let me know if that helped.

2 Likes

Thanks for your indications, it solved my issue !

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.