ROS2 Foxy Permission Error on package build

I very new to ROS2. I successfully installed “Ubuntu 20.4” and ROS2 Foxy on a Nano. Was able to setup the ro2_ws workspace with the necessary subfolders. However when I tried to build my first package I got a permission error. I’ve been working through a tutorial and typed in “ros2 pkg create my_py_pkg --build-type ament_python --dependencies rcply”. It appeared to be “building” the package but then I got the following error [Errno 13] permission denied ‘./my_py_pkg’. Thought I needed to assign read/write permissions to the folder using “chmod” but that resulted in “no such directory or file”.
Any guidance on how to correct this would be greatly appreciated.

Hi @briansandy37, I’m not familiar with running ROS2 Foxy directly on top of Ubuntu 20.04, as JetPack comes with Ubuntu 18.04 and I use these containers to build Foxy from source for 18.04 (so that it can still use CUDA/ect). Hence I’ve not encountered this error before, but on the surface it wouldn’t seem specific to the Nano.

Perhaps others from the community may be able to help, or if you haven’t already I recommend also posting to the ROS Discourse forums too.

Hi Dusty, I agree I wouldn’t think it would be unique to the Nano. I have to admit, I’m not familiar with using “containers”. By chance is there a guide or tutorial that walks through the process?
Thank you very much!

Hi Brian, here is a quick getting-started guide to running a basic container:

To run one of the ROS2 Foxy containers, you should be able to do something like:

sudo docker run -it --rm \
    --net=host \
    --runtime nvidia \

Note that the L4T version tag in the container name above should be the same as the version of JetPack-L4T you are running (which you can check with cat /etc/nv_tegra_release. So for example, if you are on L4T R32.5.0, you would run the dustynv/ros:foxy-ros-base-l4t-r32.5.0 container instead.

Also, if you want to mount a directory into the container (i.e. for storing your ros2 workspace), you can add a flag like --volume /path/outside/container:/path/inside/container By default changes you make inside the container aren’t persistent after the container is shut-down, so you can use these mounts to store your data.

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