Hello guys, I have a Jetson nano that it going to be installed on a drone. We’re trying to set it up now and can use some advice.
One of our requirements is to use ROS2 (foxy or humble). For that purpose we installed an Ubuntu 20.04 image that we took from here:
Supposedly it comes with TensorRT, which is another package we need to use. However, when trying to import tensorrt in Python 3.8, it says ‘no module named tensorrt’. I checked the output of dpkg -l | grep nvinfer and saw that pyhton3-libnvinfer is not installed, so I tried to install it with sudo apt install python3-libnvinfer, but it fails with the following error:
python3-libnvinfer : Depends: python3 (< 3.7) but 3.8.2-0ubuntu2 is to be installed
I installed Python 3.6 and tried again, but the result was the same. I tried to install it from one of the wheels from the TensorRT TAR installation, but that failed because the platform was wrong. So I don’t really know how to proceed from here.
Is there a way I can have both tensorrt and ROS2 on the nano? I saw someone talking about a docker image for ROS foxy that you can use on Ubuntu 18.04, but I never used docker before so I don’t know how difficult it will be to set up, that’s why I’m curious if there are any other alternatives (even a different board that has an official 20.04 image would be great).
Hi @natanel, the officially-supported JetPack 4.x release for Jetson Nano is on Ubuntu 18.04, and it already comes with TensorRT.
As you pointed out, you can run ROS2 Foxy in a container, including support for CUDA and TensorRT. You can get pre-built container images for Foxy from https://github.com/dusty-nv/jetson-containers
If you also want PyTorch, I have variants of the Foxy container images that have PyTorch in them too. You can get them from DockerHub like the other images.
Hey, thank you for the quick reply!
Yes I think I’m gonna try that, it’s a good opportunity to learn how to use docker :). One question though, the container with Humble should work the same way right? because I need the rosbag2-py API and from what I understood it doesn’t exist in Foxy yet.
For example, if cat /etc/nv_tegra_release shows you are running L4T R32.7.1, then you can use dustynv/ros:foxy-pytorch-l4t-r32.7.1. You could start that container like:
cd jetson-containers
scripts/docker_run.sh -c dustynv/ros:foxy-pytorch-l4t-r32.7.1
Hey, thank you for the notification, I actually ended up installing the Galactic image instead since that version has the rosbag2 Python API, and it’s working great :)
One quick question though, I noticed that rqt_bag is missing, even though as far as I know it is available for galactic, do you know if there is any way to add it?
In this example, the jetbot_ros container is using the Foxy container as it’s base container, and in the jetbot_ros dockerfile we are building/installing additional ROS packages that are needed (in this instance, gazebo plugins)