jetson-containers icon indicating copy to clipboard operation
jetson-containers copied to clipboard

ROS2 Galactic Container with Python3.8

Open fas2037 opened this issue 3 years ago • 5 comments

When installing ROS2 Galactic natively it uses Python3.8. The container uses Python3.6 and therefore libraries depending on Python3.8, which could be uses in a native ROS2 Galactic environment, can't be used inside of the docker.

fas2037 avatar Nov 01 '21 19:11 fas2037

@fas2037 in order to get GPU acceleration, the ROS2 containers from this repo are based on l4t-base container, which uses an Ubuntu 18.04 filesystem (and 18.04 comes with Python 3.6). It using l4t-base and 18.04 are the reason that ROS2 Foxy/Galactic are built from source as opposed to being installed from the pre-built debian packages from the ROS apt repo.

If you don't require GPU acceleration, then you can just use the normal ROS galactic container from OSRF, which is based on 20.04 / Python 3.8 and their pre-built debian packages.

dusty-nv avatar Nov 01 '21 20:11 dusty-nv

Okay, but as the GPU acceleration depends on Python3.6 it is not possible to run programs with GPU acceleration and Python3.8 libs, right?

fas2037 avatar Nov 02 '21 07:11 fas2037

GPU acceleration depends on Python3.6 it is not possible to run programs with GPU acceleration and Python3.8 libs

GPU acceleration itself doesn't depend on Python 3.6 - GPU acceleration from within containers depends on using a container derived from l4t-base. And l4t-base is based on Ubuntu 18.04, which uses Python 3.6 by default. So by default, it is using Python 3.6.

That isn't to say that you couldn't build the container to use Python 3.8 instead. You can try changing my ROS Galactic dockerfile to install/use Python 3.8 instead:

https://github.com/dusty-nv/jetson-containers/blob/master/Dockerfile.ros.galactic

You would want to do this before ROS2 is built in the dockerfile, because you want ROS2 to get built against the version of Python that you installed.

dusty-nv avatar Nov 02 '21 19:11 dusty-nv

@fas2037 did you try/succeed building the ros-galactic container with Python 3.8? I am looking at the same issue.

Thank you!

chrmel avatar Feb 03 '22 17:02 chrmel

So what I do is building the usual ros:galactic with python3.8 for arm64 using buildx

fas2037 avatar Feb 09 '22 22:02 fas2037