This package provides robot description and mesh files for Stretch 4, as well as code for manipulating the kinematic description (e.g. adding virtual joints) and exporting for use in other programs (e.g. ROS2, pinocchio). The repository for Stretch 3 and earlier hardware versions can be found in stretch_urdf. This package can be installed by:
python3 -m pip install -U hello-robot-stretch4-urdf
The URDF and meshes are installed to your Python site directory. You can load them dynamically using:
from stretch4_urdf import get_urdf
print(get_urdf())
A single composable xacro combines a robot's base model with its attached tool. Util functions will handle processing the xacro file and return the URDF for the robot's current configuration:
from stretch4_urdf import get_urdf_from_robot_params
urdf_string = get_urdf_from_robot_params() # store the urdf contents in a str variable
urdf_filepath = get_urdf_from_robot_params(out_dir="/tmp") # save the urdf to a file in the /tmp directory
The package follows a strict directory strucutre:
> {model}_{batch}
> meshes
visual and collision mesh STL files
> xacro
stretch_main.xacro
> {model}_tools
> {tool_name}
> meshes
visual and collision mesh STL files
{tool_name}.urdf
The URDF and meshes from the CAD model are added to the {model}_{batch} base directory and meshes folder. From there, process_new_robot_model.py creates the stretch_main.xacro file and necessary collision meshes for the batch. See the urdf_conventions.md for the specifics of this processing step.
A directory is created for each new tool, with the urdf in the base directory and a folder for meshes. process_new_tool.py is then used to add the necessary edits to the urdf and generate collision meshes.
The following files provide deeper documentation on various parts of the system:
| Primer | Description |
|---|---|
| Batches | Explains URDF batch organization, compiling the URDF dynamically, and how to add new batch models. |
| End Effectors | Outlines the available end effector tools and provides instructions on how to add new tools to the robot. |
| URDF Conventions | Outlines which conventions are used in the Stretch 4 URDF. |




