-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Install ros2 on Ubuntu with pixi #5833
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ahcorde
wants to merge
1
commit into
rolling
Choose a base branch
from
ahcorde/rolling/pixi_ubuntu
base: rolling
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
194 changes: 194 additions & 0 deletions
194
source/Installation/Alternatives/Ubuntu-Development-Setup-Pixi.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,194 @@ | ||
| Ubuntu (source Pixi) | ||
| ==================== | ||
|
|
||
| .. contents:: Table of Contents | ||
| :depth: 2 | ||
| :local: | ||
|
|
||
|
|
||
| System requirements | ||
| ------------------- | ||
| The current Debian-based target platforms for {DISTRO_TITLE_FULL} are: | ||
|
|
||
| - Tier 1: Ubuntu Linux - Noble (24.04) 64-bit | ||
| - Tier 3: Debian Linux - Bookworm (12) 64-bit | ||
|
|
||
| As defined in `REP 2000 <https://www.ros.org/reps/rep-2000.html>`_. | ||
|
|
||
| System setup | ||
| ------------ | ||
|
|
||
| Set locale | ||
| ^^^^^^^^^^ | ||
|
|
||
| .. include:: ../_Ubuntu-Set-Locale.rst | ||
|
|
||
| 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. | ||
|
|
||
| .. code-block:: console | ||
|
|
||
| $ mkdir ~/ros_ws_pixi | ||
|
|
||
| Install prerequisites | ||
| --------------------- | ||
|
|
||
| Install pixi | ||
| ^^^^^^^^^^^^ | ||
|
|
||
| ROS 2 uses `conda-forge <https://conda-forge.org/>`__ as a backend for packages, with `pixi <https://pixi.sh/latest/>`__ 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: | ||
|
|
||
| .. code-block:: console | ||
|
|
||
| $ cd ~/ros_ws_pixi | ||
| $ wget https://raw.githubusercontent.com/ros2/ros2/refs/heads/ahcorde/rolling/pixi_linux/pixi_linux.toml -O pixi.toml | ||
|
|
||
| Install dependencies: | ||
|
|
||
| .. code-block:: console | ||
|
|
||
| $ 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: | ||
|
|
||
| .. code-block:: console | ||
|
|
||
| $ 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``: | ||
|
|
||
|
|
||
| .. code-block:: console | ||
|
|
||
| $ mkdir ~/ros_ws_pixi/src | ||
| $ cd ~/ros_ws_pixi | ||
|
|
||
| Get the ``ros2.repos`` file which defines the repositories to clone from: | ||
|
|
||
| .. code-block:: console | ||
|
|
||
| $ vcs import --input https://raw.githubusercontent.com/ros2/ros2/{REPOS_FILE_BRANCH}/ros2.repos src | ||
|
|
||
| Build the code in the workspace | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
|
||
| To build the workspace folder tree: | ||
|
|
||
| .. code-block:: console | ||
|
|
||
| $ 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: | ||
|
|
||
| .. code-block:: console | ||
|
|
||
| $ 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: | ||
|
|
||
| .. code-block:: console | ||
|
|
||
| $ source ~/ros_ws_pixi/install/local_setup.bash | ||
|
|
||
| This will automatically set up the environment for any DDS vendors that support was built for. | ||
|
|
||
| Try some examples | ||
| ----------------- | ||
|
|
||
| You can run the tests using this command: | ||
|
|
||
| .. code-block:: console | ||
|
|
||
| $ 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: | ||
|
|
||
| .. code-block:: console | ||
|
|
||
| $ colcon test-result | ||
|
|
||
| To run the examples, set up the workspace by sourcing the ``local_setup.bash`` file. | ||
| Then, run a C++ ``talker``\ : | ||
|
|
||
| .. code-block:: console | ||
|
|
||
| $ source 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``\ : | ||
|
|
||
| .. code-block:: console | ||
|
|
||
| $ source 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 :doc:`tutorials and demos <../../Tutorials>` to configure your environment, create your own workspace and packages, and learn ROS 2 core concepts. | ||
|
|
||
| Stay up to date | ||
| --------------- | ||
|
|
||
| See :doc:`../Maintaining-a-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 {DISTRO_TITLE} install on your system. | ||
|
|
||
| 2. If you're also trying to free up space, you can delete the entire workspace directory with: | ||
|
|
||
| .. code-block:: console | ||
|
|
||
| $ rm -rf ~/ros_ws_pixi | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be replaced into rolling branch after ros2/ros2#1721 is merged?