Skip to main content

Workspace shortcuts with pixi

The rest of this site documents commands in canonical ros2 launch … / ros2 run … form. Those work everywhere — Jetson, workstation, CI.

The workspace also ships a thin alias layer in bar_ws/pixi.toml so you can shorten the most common command lines to pixi run <name>. This page documents that layer end-to-end: what each alias maps to, when to reach for it, and how to add your own.

pixi.toml lives at the workspace level (bar_ws/pixi.toml), not inside bar_ros2 or pianist_ros2. That's intentional — the file pins ROS 2 Jazzy, the colcon toolchain, every Python dep, and the activation script that auto-sources install/setup.bash. Those are workspace concerns; both submodules consume them.

Why have aliases at all

A single pixi run launch-mujoco is shorter than ros2 launch bar_bringup_lite mujoco.launch.py, but the bigger win is that every alias runs inside the pixi-managed environment — ROS 2 Jazzy, the colcon overlay, the visualiser PyPI deps, and the right RCUTILS_CONSOLE_OUTPUT_FORMAT are all sourced automatically. Calling pixi run … from a vanilla terminal works without an explicit pixi shell first.

Build / setup aliases

AliasEquivalentWhy
pixi install(the pixi install itself)Solve and materialise the conda + PyPI env into bar_ws/.pixi/. Run once per clone and after every pixi.toml change.
pixi shell(the pixi shell itself)Drop into an interactive shell with the env active. Equivalent to source install/setup.bash over a sourced ROS 2 Jazzy install.
pixi run setupvcs import --input src/bar_ros2/bar.repos srcClone the third-party mujoco_* + ethercat_driver_ros2 sources listed in bar.repos into src/.
pixi run buildcolcon build --symlink-install --packages-skip-regex 'ethercat.*|bar_bringup_prime'Build the Lite path (skips the EtherCAT-linked Prime lane that has no conda recipe).
pixi run build-allcolcon build --symlink-installSame, but includes bar_bringup_prime and ethercat_driver_ros2. Requires libethercat installed on the host.
pixi run build-pkg <name>colcon build --symlink-install --packages-select <name>Targeted rebuild of one package — fastest edit-loop while iterating.
pixi run testcolcon test --packages-skip-regex 'ethercat.*|bar_bringup_prime|mujoco_.*' --ctest-args -LE linter --event-handlers console_cohesion-Run BAR-owned tests; skips the vendored mujoco_* packages and the CMake-registered linters (which RoboStack ships at newer versions than apt-jazzy, so they'd diverge from the industrial_ci-on-bar_ros2 source of truth).
pixi run test-lintSame as test, but keeps the linters.Use when you specifically want to see uncrustify / cpplint output locally.
pixi run test-resultscolcon test-result --verbosePrint the per-package test summary after pixi run test.
pixi run cleanrm -rf build install logWipe the colcon overlay (leaves the source tree and .pixi/ env alone). Handy after a package rename.

Launch aliases — bar_ros2

Each alias just wraps a ros2 launch <pkg> <file> invocation; any extra arguments after the alias are forwarded unchanged.

AliasEquivalentSide
pixi run viewros2 launch bar_description_lite view_lite.launch.pydev — URDF inspector
pixi run launch-mujocoros2 launch bar_bringup_lite mujoco.launch.pydev — full Lite controller stack in MuJoCo
pixi run launch-realros2 launch bar_bringup_lite real.launch.pyrobot — real-hardware Lite bringup
pixi run launch-vizros2 launch bar_bringup_lite viz.launch.pyhost — live URDF + joint-state viewer (viewer:=viser|rerun)
pixi run calibrateros2 launch bar_bringup_lite calibrate.launch.pydev — calibration bringup; writes calibration.yaml on Ctrl+C
pixi run launch-policyros2 launch bar_policy lite_policy.launch.pyhost — generic tracking-family runner (task:=tracking|reach|residual)
pixi run launch-policy-tracking… lite_policy.launch.py task:=trackinghost — tracking task (back-compat shortcut)

Per-tool / CLI aliases

AliasEquivalent
pixi run bar …bar … (the bar_cli console script)
pixi run robstride-pingros2 run bar_robstride robstride_ping
pixi run robstride-discoverros2 run bar_robstride robstride_discover
pixi run mit-slider-guiros2 run bar_robstride mit_slider_gui
pixi run rerun-vizros2 run bar_bringup_lite rerun_viz
pixi run viser-vizros2 run bar_bringup_lite viser_viz

Launch aliases — pianist_ros2

Piano-task aliases wrap launches that live in the sibling pianist_ros2 repo (the alias still lives at the workspace level — pianist_ros2 only ships the launches and Python entry points).

AliasEquivalentSide
pixi run launch-mujoco-pianoros2 launch pianist_bringup mujoco.launch.pydev — composes Lite + piano scene in MuJoCo
pixi run launch-policy-pianoros2 launch pianist_policy piano_policy.launch.pyhost — piano policy runner

The USB-MIDI driver launch doesn't have a dedicated alias — invoke it as ros2 launch pianist_policy midi_keyboard_driver.launch.py (or add an alias yourself, see below).

Forwarding arguments

pixi run <alias> arg1 arg2 … forwards the trailing args to the underlying command verbatim, so launch-file overrides work the same way they do under raw ros2 launch:

pixi run launch-real enable_gamepad:=false
pixi run launch-real joy_dev:=/dev/input/js1
pixi run launch-viz viewer:=rerun
pixi run launch-policy task:=reach checkpoint_file:=$HOME/model.onnx
pixi run launch-policy-piano wandb_run_path:=entity/project/run-id

Adding a new alias

Edit bar_ws/pixi.toml's [tasks] block — that's the only file you need to touch:

[tasks]
my-thing = "ros2 launch my_pkg my_launch.py"

Then pixi run my-thing works immediately; no rebuild needed.

If the alias should live next to the launch file conceptually (e.g. it's a piano-specific helper), the convention today is to still register it at the workspace level — bar_ros2 and pianist_ros2 are pure ROS 2 source trees and don't try to expose a workspace-shell-shortcut layer of their own.

Tradeoffs vs. plain ros2 launch

When to use the aliases:

  • One-off interactive bringups where you'll type the command often.
  • Operator runbooks — pixi run launch-real reads more cleanly than the full launch path.
  • CI scripts that need the pixi-managed env (the alias inherits it automatically, no pixi shell wrapping needed).

When to reach for plain ros2 launch …:

  • Inside a sourced pixi shell — the alias adds nothing here, and the canonical form is what you'll see in launch-file docstrings and in this site.
  • When porting commands into another shell, an SSH cheatsheet, or a service unit on a machine that doesn't have pixi installed.
  • When the surface you're documenting is the launch file itself (the alias is a workspace-level shortcut, not a launch feature).