For the complete documentation index, see llms.txt. This page is also available as Markdown.

Setting up Stretch Simulation

You should go through all the sections in this setup guide to run this package correctly.

NOTE: If you are running on a Stretch robot, you can skip to Setting up Mujoco

NOTE: If you are on Linux or Windows, you can use the Docker setup to get started using Docker with hardware acceleration.

Estimated install time: ~1-2hrs.

Prerequisites

  • Ubuntu 24.04 host system

  • Nvidia GPU with CUDA >=12.6 drivers installed

  • Minimum 16GB RAM (32GB recommended)

Install ROS2 Jazzy (10 minutes)

NOTE: Please do not run this step if you are running on a Stretch robot.

The commands below are taken from this guide: https://docs.ros.org/en/jazzy/index.html

sudo apt install software-properties-common
sudo add-apt-repository universe

sudo apt update && sudo apt install curl -y
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null

sudo apt update

sudo apt install ros-jazzy-desktop ros-jazzy-rmw-zenoh-cpp ros-dev-tools python3-pip

source /opt/ros/jazzy/setup.bash

Setting up ament_ws (1 hour)

NOTE: Please do not run this step if you are running on a Stretch robot.

If you are not running this package on a robot NUC (which is not recommended), you will need to set up a ROS2 environment similar to the environment that ships with Stretch.

Please run these commands to install the environment. This will delete the existing ~/ament_ws directory, so please proceed with caution.

First you should install NodeJS>=21.x and npm if you don't already have them:

Note: If you run into a colcon build error: "fatal error: numpy/ndarrayobject.h: No such file or directory", run sudo ln -s ~/.local/lib/python3.10/site-packages/numpy/core/ /usr/include/numpy to resolve it.

A successful ament_ws setup will look like this:

Setting up URDF (15 minutes)

Run the commands below or follow the instruction in the stretch_description #updating-the-urdf README file to set up the URDF meshes.

A successful URDF update will look like this:

Setting up Mujoco (15 minutes)

This ROS 2 package includes nodes and launch files that use the stretch4_mujoco repo to interface with Mujoco.

Run the following, after having done the previous ament_ws setup steps, to start interacting with Stretch in Mujoco using ROS 2:

Setting up Stretch Web Teleop

Make sure you've already completed everything under Setting up ament_ws above.

Run the following commands to get IK for the gripper working:

Last updated

Was this helpful?