Skip to content

Commit

Permalink
Update URDF generation instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
hello-binit committed Jan 25, 2024
1 parent 7344385 commit 5854e95
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 36 deletions.
14 changes: 1 addition & 13 deletions stretch_calibration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,19 +113,7 @@ In the images below, examples of good and bad fit between the point cloud and th

## Generate a New URDF After Changing the Tool

If you change the Stretch RE1's tool attached to the wrist and want to generate a new URDF for it, you can do so with xacro files in the /stretch_ros/stretch_description/urdf/ directory. Specifically, you can edit stretch_description.xacro to include a xacro other than the default stretch_gripper.xacro.

After changing the tool xacro you will need to generate a new URDF and also update this new URDF with the previously optimized calibration parameters. To do so, follow the directions below:

1. In a terminal start roscore. This will enable the main script to proceed and terminate without pressing Ctrl-C.

`roscore`

1. Next, in a different terminal terminal run

`rosrun stretch_calibration update_urdf_after_xacro_change.sh`

This will update the uncalibrated URDF with the current xacro files and then create a calibrated URDF using the most recent calibration parameters.
See the [instructions here](../stretch_description/README.md#changing-the-tool).

## Revert to a Previous Calibration

Expand Down
38 changes: 15 additions & 23 deletions stretch_description/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,36 +35,28 @@ The exported URDF will be in your "stretch_user" directory at the following path

## Changing the Tool

If you wish to remove the default gripper and add a different tool, you will typically edit /stretch_description/urdf/stretch_description.xacro. Specifically, you will replace the following line in order to include the xacro for the new tool and then follow directions within stretch_ros/stretch_calibration to generate a new calibrated urdf file (stretch.urdf) that includes the new tool.
If you want to generate a new URDF for Stretch (e.g. after attaching a new tool to Stretch), you can:

`<xacro:include filename="stretch_gripper.xacro" />`
1. Edit the [`stretch_description.xacro`](./urdf/stretch_description.xacro) file in the Stretch Description package.

As an example we provide the xacro `stretch_dry_erase_marker.xacro` and its dependent mesh files with stretch_ros.
Include the tool you want in the `stretch_description.xacro`. By default, it will include `stretch_gripper.xacro`. Simply comment out
the old `<xacro:include ...` lines and paste in new ones for your tool. Example code for the other supported tools can be found by
looking at the files matching `stretch_description_<tool-name>.xacro`. To add your own custom tool, copy your xacro/mesh files into
the urdf/meshes folders in the Stretch Description package.

Some of the tools found in the [Stretch Tool Share](https://github.com/hello-robot/stretch_tool_share/) include URDF data. To integrate these tools into the URDF for your Stretch
1. In a terminal run

```bash
>>$ cd ~/repos
>>$ git clone https://github.com/hello-robot/stretch_tool_share
>>$ cd stretch_tool_share/<tool name>
>>$ cp stretch_description/urdf/* ~/catkin_ws/src/stretch_ros/stretch_description/urdf/
>>$ cp stretch_description/meshes/* ~/catkin_ws/src/stretch_ros/stretch_description/meshes/
```

Next add the xacro for the particular tool to `/stretch_description/urdf/stretch_description.xacro`. Then you can generate and preview the uncalibrated URDF:
```
roscore
```

```bash
>>$ cd ~/catkin_ws/src/stretch_ros/stretch_description/urdf
>>$ cp stretch.urdf stretch.urdf.bak
>>$ roscore # run in a new terminal before running the next command
>>$ rosrun stretch_calibration update_urdf_after_xacro_change.sh
```
1. Next, in a different terminal terminal run

Now visualize the new tool
```
rosrun stretch_calibration update_urdf_after_xacro_change.sh
```

```bash
>>$ roslaunch stretch_calibration simple_test_head_calibration.launch
```
This will create a calibrated URDF called `stretch.urdf` using the most recent calibration parameters. You can now visualize the new URDF with Rviz.

## License and Patents

Expand Down

0 comments on commit 5854e95

Please sign in to comment.