You're reading the documentation for a development version. For the latest released version, please have a look at Kilted.
Developers Guide
This package can be built “normally” in a colcon workspace on any compatible system. However, this package includes two self-contained workflows that enable developers to work in a completely isolated system environment. This ensures consistency with the supported workflows, and obviates the need to install any specific ROS, apt, or pip dependencies locally.
Pixi Development Workflow
A pixi and robostack workflow is also provided. The workflow uses the pixi-build-ros backend, and installs all dependencies (including ROS) in an isolated virtual environment. The workflow is currently only compatible with Jazzy.
To run, ensure pixi is installed. Then from the repo root:
# Install the environment
pixi install --frozen
# Setup the build environment
pixi run setup-colcon
# Build the package
pixi run build
# Run tests
pixi run test
pixi also provides an interactive shell that sources the installed package environment.
# Launch an interactive shell environment and run things as usual
pixi shell
# Build things as normal
colcon build
# And source and launch the test application
source install/setup.bash
ros2 launch mujoco_ros2_control_demos demo.launch.py
For more information on pixi and ROS refer to the documentation or this excellent blog post.
Docker Development Workflow
This project includes a docker-compose.yml and docker/Dockerfile for development and testing in an isolated environment.
Note
You may need to give docker access to xhost with xhost +local:docker to ensure the container has access to the host UI.
docker compose build
The service can be started with:
# Start the service in one shell (or start detached)
docker compose up
# Connect to it in another
docker compose exec dev bash
This will launch a container with the source code mounted in a colcon workspace. From there the source can be modified, built, tested, or otherwise used as normal. For example, launch the included test scene with:
# Evaluate using the included mujoco simulate application
/opt/ros/${ROS_DISTRO}/opt/mujoco_vendor/bin/simulate ${ROS_WS}/src/mujoco_ros2_control/mujoco_ros2_control_demos/demo_resources/scene.xml
# Or launch the test ROS control interface
ros2 launch mujoco_ros2_control_demos demo.launch.py
Note
Rendering contexts in containers can be tricky.
Users may need to tweak the compose file to support their specific host OS or GPUs. For more information refer to the comments in the compose file.