Getting Started
You can install RoboStack packages using either Pixi, Micromamba, or conda. We recommend using Pixi for any new installations.
Install Pixi
Section titled “Install Pixi”To install pixi you can run the following command in your terminal:
curl -fsSL https://pixi.sh/install.sh | bash
# And restart the terminalwinget install prefix-dev.pixi
# And restart the terminalSetup a workspace
Section titled “Setup a workspace”Initialize a new project and navigate to the project directory.
pixi init ros_ws --channel https://prefix.dev/robostack-lyricalcd ros_wsWhat did just happen?
The pixi init command created a new directory called ros_ws and initialized a new workspace in it. It also created a pixi.toml file which contains the configuration for your workspace.
The pixi.toml looks something like this:
[workspace]name = "ros_ws"platforms = ["linux-64"] # Your platformchannels = ["https://prefix.dev/robostack-lyrical"] # The channel to use for the workspaceNow you can add the packages you need to your workspace:
pixi add ros-lyrical-desktopWhat did just happen?
This adds the ros-lyrical-desktop package to the pixi.toml and installs it directly.
It also created a pixi.lock lockfile which contains the exact versions of the packages that were installed.
Pixi adds dependencies with pinned version specifiers like >=1.2.3,<2.0.0 which means that the lower bound is set to the version it installed but the upper bound is based on the next major version.
This is to ensure that you get the latest compatible version of the package the next time you run pixi update.
Then test the installation by running:
pixi run ros2# ORpixi run rviz2And try the talker and listener example:
pixi run ros2 run demo_nodes_cpp talkerpixi run ros2 run demo_nodes_cpp listenerWhat did just happen?
pixi run activates the environment and runs the command you specified.
You can also use pixi shell to open a new shell with the environment activated.
Developing local ROS packages
Section titled “Developing local ROS packages”To develop ROS packages we’ll need to add some development tools to the environment. You can do this by running:
pixi add ros-dev-toolsThen to try this on a basic ROS package, you can create a new ROS package in the workspace and build it:
pixi run ros2 pkg create --build-type ament_cmake --node-name my_node my_packagepixi run ros2 pkg create --build-type ament_python --node-name my_python_node my_python_packagepixi run colcon buildAdd the install/setup.bash script to the activation scripts in your pixi.toml so that the ROS environment is automatically activated when you enter the workspace environment:
[target.unix.activation]scripts = ["install/setup.bash"][target.win.activation]scripts = ["install/setup.bat"]After creating and building the new packages you can run the nodes in the packages:
pixi run ros2 run my_package my_package_nodepixi run ros2 run my_python_package my_python_package_nodeMulti ROS distro workspaces
Section titled “Multi ROS distro workspaces”This workspace supports multiple ROS distros in the same workspace on multiple platforms.
You can replace the previous pixi.toml or use pixi init to create a new workspace and then add the following content to the pixi.toml file:
[workspace]name = "ros_ws"description = "Development environment for RoboStack ROS packages"channels = ["https://prefix.dev/conda-forge"]platforms = ["linux-64", "win-64", "osx-64", "osx-arm64", "linux-aarch64"]
# This will automatically activate the ros workspace on activation[target.win.activation]scripts = ["install/setup.bat"]
[target.unix.activation]# For activation scripts, we use bash for Unix-like systemsscripts = ["install/setup.bash"]
# To build you can use - `pixi run -e <ros distro> build <Any other temporary args>`[feature.build.target.win-64.tasks]build = "colcon build --merge-install --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DPython_FIND_VIRTUALENV=ONLY -DPython3_FIND_VIRTUALENV=ONLY"
[feature.build.target.unix.tasks]build = "colcon build --symlink-install --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DPython_FIND_VIRTUALENV=ONLY -DPython3_FIND_VIRTUALENV=ONLY"
# Dependencies used by all environments[dependencies]python = "*"# Build toolscompilers = "*"cmake = "*"pkg-config = "*"make = "*"ninja = "*"# ROS specific toolsrosdep = "*"colcon-common-extensions = "*"
[target.linux.dependencies]libgl-devel = "*"
# Define all the different ROS environments# Each environment corresponds to a different ROS distribution# and can be activated using the `pixi run/shell -e <environment>` command.[environments]noetic = { features = ["noetic", "build"] }humble = { features = ["humble", "build"] }jazzy = { features = ["jazzy", "build"] }kilted = { features = ["kilted", "build"] }lyrical = { features = ["lyrical", "build"] }rolling = { features = ["rolling", "build"] }
### ROS Noetic ####[feature.noetic]channels = ["https://prefix.dev/robostack-noetic"]
[feature.noetic.dependencies]ros-noetic-desktop = "*"catkin_tools = "*"
### ROS Humble ####[feature.humble]channels = ["https://prefix.dev/robostack-humble"]
[feature.humble.dependencies]ros-humble-desktop = "*"
### ROS Jazzy ####[feature.jazzy]channels = ["https://prefix.dev/robostack-jazzy"]
[feature.jazzy.dependencies]ros-jazzy-desktop = "*"
### ROS Kilted ####[feature.kilted]channels = ["https://prefix.dev/robostack-kilted"]
[feature.kilted.dependencies]ros-kilted-desktop = "*"
### ROS Lyrical ####[feature.lyrical]channels = ["https://prefix.dev/robostack-lyrical"]
[feature.lyrical.dependencies]ros-lyrical-desktop = "*"
### ROS Rolling ####[feature.rolling]channels = ["https://prefix.dev/robostack-rolling"]
[feature.rolling.dependencies]ros-rolling-desktop = "*"# Save and exit pixi.tomlpixi install# You can now start an environment with your desired robostack distribution using one of the below commands (either executed from within the project directory or by appending `--manifest-path` and pointing to your project directory):
# ROS noeticpixi shell -e noetic
# ROS humblepixi shell -e humble
# ROS jazzypixi shell -e jazzy
# ROS kiltedpixi shell -e kilted
# ROS lyricalpixi shell -e lyrical
# ROS rollingpixi shell -e rolling