ROS FAQ & Troubleshooting
This page reference ROS and ROS 2 snap common questions and troubleshooting:
Frequently Asked Questions
If you cannot find an answer to your question here, feel free to ask it on the snapcraft forum.
- I cannot snap my application. What should I check?
- Snapcraft uses the familiar ROS tools (
rosdep
/catkin
/colcon
etc). Which means that your application must follow the ROS directives for proper packaging, such as declaring all the necessary dependencies in the package.xml files or the install rules in yourCMake
file. Make sure that these are in good order before attempting to create a snap.
- Snapcraft uses the familiar ROS tools (
- Which base should I use,
Core18
orCore20
?- You should use the base that corresponds to your ROS version. That is,
Core18
for ROS Melodic andCore20
for ROS Noetic and ROS2 Foxy.
- You should use the base that corresponds to your ROS version. That is,
- For ROS1, do I have to expose
roscore
from my snap?- Exposing a
roslaunch
command from your snap will automatically launch aroscore
if needed. The only reason to expose explicitly the roscore would be if you plan to start theroscore
explicitly from your snap.
- Exposing a
- Where should my snapcraft.yaml file live?
- Within the package:
- In
Core20
the snap/ directory should be located at the root of the package (next to your package.xml file) - In
Core18
the snap/ directory should be located either one folder behind your package root or at the root of your workspace
- In
- Outside the package:
- Using a
rosinstall
file to download the sources. - Using a single git repository holding the sources.
- Using a
- Within the package:
Troubleshooting
-
Rosrun
androslaunch
are not available in my snap.- If this happens, it means that your ROS project does not define a runtime dependency on either
rosrun
norroslaunch
at any place. You can fix this by either properly declaring the dependency in the appropriate ROS package.xml file. Another option is to declare either (or both) ROS packages asstage-packages
in your snapcraft.yaml. The ROS packages forrosrun
androslaunch
respectively are:ros-${ROS-DISTRO}-rosbash
andros-${ROS-DISTRO}-roslaunch
.
- If this happens, it means that your ROS project does not define a runtime dependency on either
- With
Core18
Catkin plugin creates an external link that prevents the security checks to pass.- Please see: Catkin generating an external link.
- Executing ROS python code is missing python dependencies.
- The path to the libraries
lapack
andblas
is by default not included in the library path. Thus, it must be extended manually.environment: "LD_LIBRARY_PATH": "$LD_LIBRARY_PATH:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/blas:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/lapack"
- The path to the libraries
- When building your snap, you might see this warning: “This part is missing libraries that cannot be satisfied with any available stage-packages known to snapcraft”.
- Some libraries are build-time only dependencies, but are still reported as run-time dependencies by
snapcraft
. This warning is a false positive and will be fixed soon in snapcraft. When snappingros2-demo
you might encounter:This part is missing libraries that cannot be satisfied with any available stage-packages known to snapcraft: # false-positive, none of the following are necessary at run-time libnddsc.so libnddscore.so libnddscpp.so librosidl_typesupport_connext_c.so librosidl_typesupport_connext_cpp.so librticonnextmsgcpp.so
- Some libraries are build-time only dependencies, but are still reported as run-time dependencies by
- Strictly confined ROS 2 snaps shows an access error regarding shared memory.
If you see something similar to:
ROS 2 communication library is trying to use the shared memory mechanism. ROS2 shared memory is not yet working with[RTPS_TRANSPORT_SHM Error] Failed to create segment 86bb3c83d0835208: Permission denied -> Function compute_per_allocation_extra_size [RTPS_MSG_OUT Error] Permission denied -> Function init
snap
. But don’t worry, even if you see this error, the messages are going to be transmitted (just not through shared memory).
Last updated a month ago.