Trying out ROS2 Jazzy Jalisco in 10 mins

RoboFoundry
5 min readNov 17, 2024

--

It has been a while since I last published an article, just getting back in the saddle again. Lot of things have happened since then including release of new ROS2 LTV distro Jazzy Jalisco. Since this is the latest long term distribution, it will be supported until 2029 per this release list. Now it’s time for us to slowly learn how to say goodbye to our trusty Humble release as we did to Foxy earlier.

I currently have Ubuntu 22.04 Jammy which was paired with ROS2 Humble for binary distributions. Since Jazzy now requires Ubuntu 24.04 Noble for the binary distributions, I figured I’ll go to the docker container route this time around to try it out quickly. Last time I did the Ubuntu + Humble upgrade it was not pretty and lot of things broke. Not due to Ubuntu but Gazebo transition was happening and Nvidia drivers always have hiccups with new Ubuntu distros until things settle down. So I’m going to delay the upgrade until I have some peaceful time to plan it out and provide some additional time to allow for any issues.

With that context let me describe what I did to try out the ROS2 Jazzy in just few mins. I’ll give you two different options — one with standard docker container using container images distributed for Jazzy and second with another tool that you may or may not have heard of but that was even more easier than first approach.

Before we get into it, I would recommend you install couple of these pre-requisites if you haven’t already, it will make your life a lot easier.

Using Standard Docker and Jazzy Images

  1. Create a directory where you want to create the docker file and create a new file named docker-compose.yml and copy/paste the content below into that file, additional details here. Essentially, this docker compose file is configured to launch two containers from same jazzy desktop image — one is publisher and another a subscriber [talker/listener].
version: '2'

services:
talker:
image: osrf/ros:jazzy-desktop
command: ros2 run demo_nodes_cpp talker
listener:
image: osrf/ros:jazzy-desktop
command: ros2 run demo_nodes_cpp listener
depends_on:
- talker

2. At this point you can launch bash shell [I typically do it from my VSCode window] and switch to the directory where you just created the docker-compose file. You need to be in this directory when you launch the docker compose. Enter following command

## start both containers 
docker compose up

## you will see output like this
[+] Running 2/0
✔ Container talker_listner-talker-1 Created 0.0s
✔ Container talker_listner-listener-1 Created

## followed by message echos like these
talker-1 | [INFO] [1731806305.940600400] [talker]: Publishing: 'Hello World: 1'
listener-1 | [INFO] [1731806305.941593872] [listener]: I heard: [Hello World: 1]
talker-1 | [INFO] [1731806306.940508715] [talker]: Publishing: 'Hello World: 2'
listener-1 | [INFO] [1731806306.940794648] [listener]: I heard: [Hello World: 2]
talker-1 | [INFO] [1731806307.940486471] [talker]: Publishing: 'Hello World: 3'
listener-1 | [INFO] [1731806307.941068986] [listener]: I heard: [Hello World: 3]
talker-1 | [INFO] [1731806308.940476502] [talker]: Publishing: 'Hello World: 4'
listener-1 | [INFO] [1731806308.940778716] [listener]: I heard: [Hello World: 4]

This will fetch the image and launch two containers and if everything went well you will see the talker and listener echoing the message numbers they are going through.

That’s pretty much it in a nutshell. Now if you want to connect to the running containers you can note down the names of container above like talker_listner-talker-1 and talker_listener-listener-1 and use standard docker commands to connect to it from a new bash shell like this.

## connect to talker in a separate bash
docker exec -it talker_listner-talker-1 /bin/bash

## connect to listener in a separate bash
docker exec -it talker_listner-listener-1 /bin/bash

And then you can run all standard ros2 commands after you have sourced it. Something like this

# source ros2 
source /opt/ros/jazzy/setup.bash

# basic ros2 to command to make sure things are recognized
ros2

# ros2 command to list topics
ros2 topic list

Using Rocker

Now that we have looked at how to do it from standard docker commands, let’s try it with another ROS specific tool called Rocker. This tool is specifically meant for doing lot of standard things a typical ROS developer will need to do if they were doing open source development and testing. One of the cool thing it does is — it allows you to launch GUI tools like RViz from inside the container without any special tricks that you may have to do if you were to do it with standard docker. I have tried using standard docker for those things in past but honestly it’s a pain and I cannot remember all the parameters I need to pass to make all that work. On the ohter hand, doing the same thing using Rocker was a breeze so I’m going to stick to that and I’d recommend that to you as well. Additional details on Rocker can be found on their github repo.

Here are the steps [assuming you already did the pre-requisites].

  1. Install Rocker [using debian]
## Install rocker [using debian]
sudo apt-get install python3-rocker

2. Run rocker with Jazzy image

## running jazzy and launching rviz [may need to restart docker in case updates were done]

rocker --nvidia --x11 osrf/ros:jazzy-desktop rviz2

It is as simple as it gets and when the command completes downloading the image and running, you’ll see the familiar GUI window for RViz popup that is running on ROS2 Jazzy.

Some Issues

  1. I got an error with following message while running standard docker commands:
Error response from daemon: failed to create task for container: failed to 
create shim task: OCI runtime create failed: unable to retrieve OCI runtime
error (open /run/containerd/io.containerd.runtime.v2.task/moby/5ea8e5300cc921143ad001ac7a92e5a058ff4655abb47c79b7a1fd9b6ba84329/log.json:
no such file or directory): exec: "nvidia-container-runtime": executable file not found in $PATH: unknown

The above error was fixed by running following command, I believe my Nvidia container environment was broken and needed a reinstall.

sudo apt install nvidia-container-runtime

2. I also ran into another error while running Rocker with error message

docker: Error response from daemon: could not select device driver "" with 
capabilities: [[gpu]]. AFTER installing nvidia-docker2

This was mainly resolved by restarting the docker service as things were not in good shape after Rocker was installed.

sudo systemctl restart docker

That’s it. Enjoy!!!

References

--

--

No responses yet