UV on ROS 2: Five failure modes revealed in real robot stacks
Real robot stacks hit five reproducible failure modes with uv-managed venvs in ROS 2. Here's what broke and how to fix it.
A recent field report on using uv (a fast Python package manager) with ROS 2 Jazzy on Ubuntu 24.04 reveals both promise and pitfalls for workspace-level virtual environments in robotics development. The team successfully migrated a real robot stack to a uv-managed venv while retaining colcon, ros2 run, and ros2 launch, achieving lockfile reproducibility and custom wheel indexes for dependencies like torch==2.6.0+cu124.
However, the journey uncovered five reproducible failure modes, ranging from dual environment setup requirements to incompatibilities with system-built C extensions. While four have documented workarounds, the fifth—colcon's --symlink-install mode failing to respect venv activation—remains unresolved. The report proposes minimal opt-in changes to colcon/ament to address these issues without disrupting existing workflows.
- UV-managed venvs work with stock apt ROS 2 Jazzy but hit 5 reproducible failure modes verified on Ubuntu 24.04
- Four failures have workarounds (e.g., pinning numpy<2, touch .venv/COLCON_IGNORE), but colcon --symlink-install bypasses venv activation
- Proposed minimal colcon/ament changes are opt-in with no behavior changes for non-venv workspaces
Why It Matters
Solving these uv/ROS 2 integration issues could streamline Python dependency management for robotics developers using real-time inference stacks.