Skip to content

Commit 1222867

Browse files
committed
Update README.md
1 parent f9096e1 commit 1222867

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

src/prpy/tsr/README.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This directory contains the python interfaces necessary to specify Task Space Re
44
Manipulation Planning" by Dmitry Berenson, Siddhartha Srinivasa, and James Kuffner. A copy of this publication can be downloaded [here](https://www.ri.cmu.edu/pub_files/2011/10/dmitry_ijrr10-1.pdf).
55

66
## TSR Overview
7-
A TSR is typically used to defined a constraint on the pose of the end-effector of a manipulator. For example consider a manipulator tasked with grabbing a bottle. The end-effector (hand) must be near the bottle, and oriented in a way that allows the fingers to grab around the bottle when closed. This set of workspace constraints on valid poses of the end-effector can be expressed as a TSR.
7+
A TSR is typically used to defined a constraint on the pose of the end-effector of a manipulator. For example consider a manipulator tasked with grabbing a glass. The end-effector (hand) must be near the glass, and oriented in a way that allows the fingers to grab around the glass when closed. This set of workspace constraints on valid poses of the end-effector can be expressed as a TSR.
88

99
A TSR is defined by three components:
1010
* T0_w - A transform from the world origin to the TSR frame w
@@ -13,7 +13,20 @@ A TSR is defined by three components:
1313

1414
The first three rows of Bw bound the allowable translation along the x,y and z axes (in meters). The last three rows bound the allowable rotation about those axes (in radians), all in w frame. Note that this asumed Roll-Pitch-Yaw (RPY) Euler angle convention.
1515

16-
## Example Usage
16+
### Example definition
1717
Lets return to our previous example of selecting a pose for the end-effector to allow a manipulator to grasp a bottle. The following code shows the python commands that allow the TSR to be defined:
18+
```python
19+
ipython> bottle = env.GetKinBody('fuze')
20+
ipython> T0_w = bottle.GetTransform() # We use the bottle's coordinate frame as the w frame
21+
ipython> Tw_e = numpy.array([[ 0., 0., 1., -total_offset],
22+
[1., 0., 0., 0.],
23+
[0., 1., 0., 0.08], # glass height
24+
[0., 0., 0., 1.]]) # This represents the pose of the end-effector relative to the glass
25+
ipython> Bw = numpy.zeros((6,2))
26+
ipython> Bw[2,:] = [0.0, 0.02] # Allow a little vertical movement
27+
ipython> Bw[5,:] = [-numpy.pi, numpy.pi] # Allow any orientation about the z-axis of the bottle
28+
ipython> robot.right_arm.SetActive() # We want to grasp with the right arm
29+
ipython> manip_idx = robot.GetActiveManipulatorIndex()
30+
ipython> grasp_tsr = prpy.tsr.TSR(T0_w = T0_w, Tw_e = Tw_e, Bw = Bw, manip = manip_idx)
1831
```
19-
```
32+

0 commit comments

Comments
 (0)