Metadata-Version: 2.4
Name: hello-robot-stretch4-urdf
Version: 2026.5.14
Summary: Stretch 4 URDF
Author-email: "Hello Robot Inc." <support@hello-robot.com>
Project-URL: Repository, https://github.com/hello-robot/stretch4_urdf
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: click>=8.3.1
Requires-Dist: coacd>=1.0.7
Requires-Dist: numpy-stl>=3.2.0
Requires-Dist: urdf-parser-py>=0.0.4
Requires-Dist: yourdfpy>=0.0.58
Requires-Dist: numpy
Requires-Dist: pyyaml
Requires-Dist: open3d
Requires-Dist: trimesh
Requires-Dist: scikit-learn
Requires-Dist: xacrodoc
Dynamic: license-file

# Overview

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](https://github.com/hello-robot/stretch_urdf). This package can be installed by:

```
python3 -m pip install -U hello-robot-stretch4-urdf
```

<p align="center">
    <img src="img/stretch4_robot_model.png" alt="Stretch 4 robot model" width="50%">
</p>

<p align="center">
  <img src="img/stretch4_head.png" alt="TF frames of Stretch 4's head" width="49%">
  <img src="img/stretch4_base.png" alt="TF frames of Stretch 4's base" width="49%">
  <br>
  <img src="img/stretch4_arm.png" alt="TF frames of Stretch 4's arm" width="49%">
  <img src="img/stretch4_gripper.png" alt="TF frames of Stretch 4's gripper" width="49%">
</p>

## Details

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
```

## Bringing in URDF's from CAD

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.

## Documentation

The following files provide deeper documentation on various parts of the system:

| Primer | Description |
| :--- | :--- |
| [Batches](stretch4_urdf/batches.md) | Explains URDF batch organization, compiling the URDF dynamically, and how to add new batch models. |
| [End Effectors](stretch4_urdf/SE4_tools/end_effectors.md) | Outlines the available end effector tools and provides instructions on how to add new tools to the robot. |
| [URDF Conventions](./urdf_conventions.md) | Outlines which conventions are used in the Stretch 4 URDF. |
