Skip to content

Commit dad7bc8

Browse files
committed
Update README.md
1 parent 417ad2d commit dad7bc8

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/prpy/tsr/README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ ipython> robot.right_arm.SetActive() # We want to grasp with the right arm
3030
ipython> manip_idx = robot.GetActiveManipulatorIndex()
3131
ipython> grasp_tsr = prpy.tsr.TSR(T0_w = T0_w, Tw_e = Tw_e, Bw = Bw, manip = manip_idx)
3232
```
33-
## Example: Using a TSR
33+
### Example: Using a TSR
3434
The following code shows an example of how to use a TSR to find a collision-free configuration for the manipulator that allows for a valid grasp:
3535
```python
3636
ipython> ee_sample = grasp_tsr.sample() # Compute a sample pose of the end-effector
@@ -40,3 +40,12 @@ ipython> ik = robot.right_arm.FindIKSolution(ee_sample, openravepy.IkFilterOptio
4040
```python
4141
ipython> robot.right_arm.PlanToConfiguration(ik, execute=True)
4242
```
43+
### Example: Determining if a configuration is within a TSR
44+
In the following code snippet, we show a method for determining whether or not the current pose of the manipulator meets the constraint by using the ```distance``` function defined on the TSR.
45+
```python
46+
ipython> current_ee_pose = robot.right_arm.GetEndEffectorTransform()
47+
ipython> dist_to_tsr = grasp_tsr.distance(current_ee_pose)
48+
ipython> meets_constraint = (dist_to_tsr == 0.0)
49+
```
50+
51+
## TSR Chains

0 commit comments

Comments
 (0)