Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/sdk_protos_map.csv
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
arm,GetEndPosition,,get_end_position,EndPosition,endPosition,getEndPosition
arm,MoveToPosition,,move_to_position,MoveToPosition,moveToPosition,moveToPosition
arm,MoveToJointPositions,,move_to_joint_positions,MoveToJointPositions,moveToJointPositions,moveToJointPositions
arm,MoveThroughJointPositions,,,MoveThroughJointPositions,,
arm,MoveThroughJointPositions,,move_through_joint_positions,MoveThroughJointPositions,,
arm,MoveThroughJointPositionsStreamed,,move_through_joint_positions_streamed,MoveThroughJointPositionsStreamed,,
arm,GetJointPositions,,get_joint_positions,JointPositions,jointPositions,getJointPositions
arm,Get3DModels,,,Get3DModels,get3DModels,get3DModels
arm,Get3DModels,,get_3d_models,Get3DModels,get3DModels,get3DModels
## Flutter-only client-side helper, sums link lengths from getKinematics() locally; no proto/RPC and no analog in other SDKs:
arm,CalculateMaxReach,,,,calculateMaxReach,
## HACK: proto for these (and/or inherited in Go SDK), manually mapping:
Expand Down
63 changes: 26 additions & 37 deletions docs/motion-planning/move-an-arm/move-by-joint-positions.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,27 @@ Drives the arm through a sequence of joint configurations in order,
with optional per-motion velocity and acceleration limits through
`MoveOptions`.

{{< alert title="SDK availability" color="caution" >}}
`MoveThroughJointPositions` is available in the **Go SDK** and through
the proto, but is **not currently exposed by the Python SDK**. Python
callers who need the same behavior must call each waypoint with
`move_to_joint_positions` in sequence.
{{< /alert >}}

{{< tabs >}}
{{% tab name="Python" %}}

```python
from viam.components.arm import Arm, JointPositions, MoveOptions

my_arm = Arm.from_robot(machine, "my-arm")

waypoints = [
JointPositions(values=[0, -45, 90, 0, 45, 0]),
JointPositions(values=[0, 0, 90, 0, 0, 0]),
JointPositions(values=[0, 45, 0, 0, -45, 0]),
]

# Cap every joint at 15 deg/s and 30 deg/s^2.
options = MoveOptions(max_vel_degs_per_sec=15.0, max_acc_degs_per_sec2=30.0)

await my_arm.move_through_joint_positions(waypoints, options=options)
```

{{% /tab %}}
{{% tab name="Go" %}}

```go
Expand Down Expand Up @@ -147,31 +160,6 @@ if err := myArm.MoveThroughJointPositions(ctx, waypoints, options, nil); err !=
}
```

{{% /tab %}}
{{% tab name="Python" %}}

The Python SDK does not expose `MoveThroughJointPositions`. Use a loop
with `move_to_joint_positions` for the equivalent behavior:

```python
from viam.components.arm import Arm
from viam.proto.component.arm import JointPositions

my_arm = Arm.from_robot(machine, "my-arm")

waypoints = [
JointPositions(values=[0, -45, 90, 0, 45, 0]),
JointPositions(values=[0, 0, 90, 0, 0, 0]),
JointPositions(values=[0, 45, 0, 0, -45, 0]),
]

for wp in waypoints:
await my_arm.move_to_joint_positions(wp)
```

Without `MoveOptions` you cannot cap velocity or acceleration per call
from Python; the arm uses its module's default speed profile.

{{% /tab %}}
{{< /tabs >}}

Expand Down Expand Up @@ -231,12 +219,12 @@ programmatically.
## Joint-space moves compared to motion.Move

| Motion path | Use when |
| ----------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| ----------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --- |
| `arm.MoveToJointPositions` | You know the joint angles you want. |
| `arm.MoveThroughJointPositions` (Go) | You have a sequence of joint targets and want per-call velocity or acceleration caps. |
| [`arm.MoveThroughJointPositionsStreamed`](/motion-planning/move-an-arm/stream-joint-positions/) (Python, Go, C++) | You are producing the trajectory as the arm moves and cannot supply it all up front. |
| `arm.MoveThroughJointPositions` | You have a sequence of joint targets and want per-call velocity or acceleration caps. |
| `arm.MoveToPosition` | You have a Cartesian target pose but don't need obstacle avoidance. |
| `motion.Move` | You have a Cartesian target and want obstacle avoidance, constraints, and IK picked by the planner. |
| [`arm.MoveThroughJointPositionsStreamed`](/motion-planning/move-an-arm/stream-joint-positions/) (Python, Go, C++) | You are producing the trajectory as the arm moves and cannot supply it all up front. | |

Joint-space moves are the right call when you need to control the
posture of the arm precisely. They do not protect against collisions
Expand All @@ -261,8 +249,9 @@ range, update the kinematics file (see

Without `MoveOptions`, the speed profile comes from the arm module's
default. Different modules pick different defaults. If you need a
specific speed, use Go's `MoveOptions`, or break a long motion into
shorter `MoveToJointPositions` calls with sleeps between.
specific speed, pass `MoveOptions` to `MoveThroughJointPositions`, or
break a long motion into shorter `MoveToJointPositions` calls with
sleeps between.

{{< /expand >}}

Expand Down
Loading