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

URDF Calibration

The Stretch URDF can be dynamically calibrated at load time by applying static calibration values to the joint origins. This ensures that the robot's physical dimensions (as measured during calibration) are reflected in the URDF used for visualization, planning, and kinematics.

How it Works

When a calibrated URDF is requested (e.g., via get_urdf_calibrated() or get_urdf_from_robot_params(apply_calibration=True)), the system looks for the stretch_calibration_values.yaml file within the stretch_user directory. If available, the nominal urdf joint origins are replaced by the saved values. These values represent the static offsets of the joint origins. They are typically generated by systems like the Stretch factory calibration or user-run calibration scripts (e.g., camera-to-body calibration).

List of Existing Calibration Procedures

The stretch_calibration_values.yaml file is used to store static offsets for any joint in the URDF. Currently, the following procedures are known to create or update this file:

Joint Calibrated
Calibration Script
Repository
Parent Link
Child Link

base_ref

ros_find_floor_calibration

stretch4_dual_lidar_calibration

base_footprint

base_link

Application Mechanism

The get_urdf_calibrated function performs the following steps:

  1. Loads the nominal URDF (generated from the Xacro for the specific model, batch, and tool).

  2. Parses the stretch_calibration_values.yaml file.

  3. For every joint defined in the URDF, it checks if there is a matching entry in the YAML under robot_calibration.joints.

  4. If a match is found, it replaces the <origin> element's xyz and rpy attributes with the values from the YAML.

YAML Structure

The stretch_calibration_values.yaml file follows this structure:

Adding Calibrations

Users can add their own calibration entries to stretch_calibration_values.yaml. If you have measured an offset for a joint, you can manually add it to the calibration file, or programmatically add calibrations using the exported record_joint_calibration utility function. The calibration will be automatically applied to the URDF when it is loaded through util functions (e.g. get_urdf_from_robot_params, get_urdf_calibrated).

NOTE The values provided in the calibration YAML are absolute origin values for the joint, not deltas. The system replaces the nominal <origin> attributes in the URDF with these exact values.

Using Calibrated URDFs Example

To load a calibrated URDF in your Python scripts, use the get_urdf_from_robot_params utility. By default, apply_calibration is set to True:

If you are not running on a robot or want to provide parameters explicitly, use get_urdf_calibrated:

Last updated

Was this helpful?