You're reading the documentation for a development version. For the latest released version, please have a look at Kilted.

Ubuntu (source Pixi)

System requirements

The current Debian-based target platforms for Rolling Ridley are:

  • Tier 1: Ubuntu Linux - Noble (24.04) 64-bit

  • Tier 3: Debian Linux - Bookworm (12) 64-bit

As defined in REP 2000.

System setup

Set locale

Make sure you have a locale which supports UTF-8. If you are in a minimal environment (such as a docker container), the locale may be something minimal like POSIX. We test with the following settings. However, it should be fine if you’re using a different UTF-8 supported locale.

$ locale  # check for UTF-8

$ sudo apt update && sudo apt install locales
$ sudo locale-gen en_US en_US.UTF-8
$ sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
$ export LANG=en_US.UTF-8

$ locale  # verify settings

Create a location for the ROS 2 installation

This location will contain both the installed binary packages, plus the ROS 2 installation itself.

Start a terminal, then create a directory to store the installation.

$ mkdir ~/ros_ws_pixi

Install prerequisites

Install pixi

ROS 2 uses conda-forge as a backend for packages, with pixi as the frontend.

Continue using the previous terminal session, and use the instructions from https://pixi.sh/latest/ to install pixi. Once pixi has been installed, close the terminal session and start it again, which will ensure pixi is on the PATH.

Install dependencies

Download the pixi configuration file in the existing terminal session:

$ cd ~/ros_ws_pixi
$ wget https://raw.githubusercontent.com/ros2/ros2/rolling/pixi.toml -O pixi.toml

Install dependencies:

$ pixi install

Build ROS 2

Source the pixi environment

This is required in every command prompt you open to set up paths to the dependencies:

$ cd ~/ros_ws_pixi
$ pixi shell

Get ROS 2 code

Now that we have the development tools we can get the ROS 2 source code.

Setup a development folder, for example ~/ros_ws_pixi/src:

$ mkdir ~/ros_ws_pixi/src
$ cd ~/ros_ws_pixi

Get the ros2.repos file which defines the repositories to clone from:

$ vcs import --input https://raw.githubusercontent.com/ros2/ros2/rolling/ros2.repos src

Build the code in the workspace

To build the workspace folder tree:

$ colcon build --merge-install --event-handlers console_direct+ --cmake-args -D LTTNGPY_DISABLED=1 --packages-skip qt_gui_cpp --packages-skip-by-dep qt_gui_cpp --packages-skip-build-finished

Note

Source installation can take a long time given the large number of packages being pulled into the workspace.

Setup environment

Start a new terminal, which will be used in the examples.

Source the pixi environment

This is required in every command prompt you open to set up paths to the dependencies:

$ cd ~/ros_ws_pixi
$ pixi shell

Source the ROS 2 environment

This is required in every command prompt you open to setup the ROS 2 workspace:

$ source ~/ros_ws_pixi/install/local_setup.bash

This will automatically set up the environment for any DDS vendors for which support was built.

Try some examples

You can run the tests using this command:

$ colcon test --merge-install

Note

--merge-install should only be used if it was also used in the build step.

Afterwards you can get a summary of the tests using this command:

$ colcon test-result

To run the examples, set up the workspace by sourcing the local_setup.bash file. Then, run a C++ talker:

$ source ~/ros_ws_pixi/install/local_setup.bash
$ ros2 run demo_nodes_cpp talker

In a separate command prompt you can do the same, but instead run a Python listener:

$ source ~/ros_ws_pixi/install/local_setup.bash
$ ros2 run demo_nodes_py listener

You should see the talker saying that it’s Publishing messages and the listener saying I heard those messages. This verifies both the C++ and Python APIs are working properly. Hooray!

Note

It is not recommended to build in the same cmd prompt that you’ve sourced the local_setup.bash.

Next steps

Continue with the tutorials and demos to configure your environment, create your own workspace and packages, and learn ROS 2 core concepts.

Stay up to date

See Maintain source checkout to periodically refresh your source installation.

  1. If you installed your workspace with colcon as instructed above, “uninstalling” could be just a matter of opening a new terminal and not sourcing the workspace’s setup file. This way, your environment will behave as though there is no Rolling install on your system.

  2. If you’re also trying to free up space, you can delete the entire workspace directory with:

    $ rm -rf ~/ros_ws_pixi