Skip to content

Commit

Permalink
Adding documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucaweihs committed Jun 25, 2021
1 parent 6966a37 commit 511fedf
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
19 changes: 19 additions & 0 deletions unity/Assets/Scripts/ArmAgentController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,25 @@ protected IK_Robot_Arm_Controller getArm() {
return arm;
}


/*
This function is identical to `MoveArm` except that rather than
giving a target position you instead give an "offset" w.r.t.
the arm's (i.e. wrist's) current location.
Thus if you want to increase the
arms x position (in world coordinates) by 0.1m you should
pass in `offset=Vector3(0.1f, 0f, 0f)` and `coordinateSpace="world"`.
If you wanted to move the arm 0.1m to the "right" from the agent's
perspective then you would pass in the same offset but set
`coordinateSpace="armBase"`. Note that this last movement is **not**
the same as passing `position=Vector3(0.1f, 0f, 0f)` to the `MoveArm`
action with `coordinateSpace="wrist"` as, if the wrist has been rotated,
right need not mean the same thing to the arm base as it does to the wrist.
Finally note that when `coordinateSpace="wrist"` then both `MoveArm` and
`MoveArmRelative` are identical.
*/
public void MoveArmRelative(
Vector3 offset,
float speed = 1,
Expand Down
5 changes: 5 additions & 0 deletions unity/Assets/Scripts/IK_Robot_Arm_Controller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,11 @@ protected IEnumerator resetArmTargetPositionAsLastStep(IEnumerator steps) {
armTarget.position = handCameraTransform.transform.position;
}


/*
See the documentation of the `MoveArmRelative` function
in the ArmAgentController.
*/
public void moveArmRelative(
PhysicsRemoteFPSAgentController controller,
Vector3 offset,
Expand Down

0 comments on commit 511fedf

Please sign in to comment.