Skip to content

Commit a11031f

Browse files
committed
Update README.md
1 parent b917a6c commit a11031f

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/prpy/tsr/README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ A TSR is defined by three components:
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

1616
### Example: Defining a TSR
17-
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:
17+
Lets return to our previous example of selecting a pose for the end-effector to allow a manipulator to grasp a glass. The following code shows the python commands that allow the TSR to be defined:
1818
```python
19-
ipython> bottle = env.GetKinBody('fuze')
20-
ipython> T0_w = bottle.GetTransform() # We use the bottle's coordinate frame as the w frame
19+
ipython> glass = env.GetKinBody('plastic_glass')
20+
ipython> T0_w = glass.GetTransform() # We use the glass's coordinate frame as the w frame
2121
# Now define Tw_e to represent the pose of the end-effector relative to the glass
2222
ipython> Tw_e = numpy.array([[ 0., 0., 1., -total_offset],
2323
[1., 0., 0., 0.],
2424
[0., 1., 0., 0.08], # glass height
2525
[0., 0., 0., 1.]])
2626
ipython> Bw = numpy.zeros((6,2))
2727
ipython> Bw[2,:] = [0.0, 0.02] # Allow a little vertical movement
28-
ipython> Bw[5,:] = [-numpy.pi, numpy.pi] # Allow any orientation about the z-axis of the bottle
28+
ipython> Bw[5,:] = [-numpy.pi, numpy.pi] # Allow any orientation about the z-axis of the glass
2929
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)
@@ -89,7 +89,7 @@ Similar to the TSRs, we can sample and compute distance to chains using the ```s
8989
Several of the planners in the prpy [planning pipeline](https://github.com/personalrobotics/prpy/tree/master/src/prpy/planning) have some support for using TSRs for defining constriants through the ```PlanToTSR``` method. The method accepts as a list of ```TSRChain``` objects. The ```sample_start```, ```sample_goal``` and ```constrain``` flags on the each ```TSRChain``` indicate to the planner how the chain should be used.
9090

9191
### Example: Planning to a single TSR
92-
Consider the example of grasping a bottle. Given our ```grasp_tsr``` we would now like to generate a plan that moves the robot to any configuration such that the end-effector meets the constraint defined by the tsr. The following code can be used to do this:
92+
Consider the example of grasping a glass. Given our ```grasp_tsr``` we would now like to generate a plan that moves the robot to any configuration such that the end-effector meets the constraint defined by the tsr. The following code can be used to do this:
9393
```python
9494
ipython> tsrchain = prpy.tsr.TSRChain(sample_goal=True, sample_start=False, constrain=False,
9595
TSR = grasp_tsr)
@@ -108,3 +108,10 @@ ipython> tsrchain2 = prpy.tsr.TSRChain(sample_goal=True, sample_start=False, con
108108
TSR = grasp2_tsr)
109109
ipython> traj = robot.PlanToTSR([tsrchain1, tsrchain2])
110110
```
111+
## TSR Library
112+
The prpy framework contains the ability to define and cache TSRChains that are commonly used by the robot. These pre-defined TSRChains can be accessed via the ```tsrlibrary``` defined on the robot. The following shows an example for how the TSR Library might be used:
113+
```python
114+
ipython> glass = env.GetKinBody('plastic_glass')
115+
ipython> tsrlist = robot.tsrlibrary(glass, 'grasp')
116+
ipython> traj = robot.PlanToTSR(tsrlist)
117+
```

0 commit comments

Comments
 (0)