Fix pose cloud example to use a linear constraint#5149
Closed
btshrewsbury-viam wants to merge 2 commits into
Closed
Fix pose cloud example to use a linear constraint#5149btshrewsbury-viam wants to merge 2 commits into
btshrewsbury-viam wants to merge 2 commits into
Conversation
The code example on the pose-clouds page kept the cup upright with an OrientationConstraint, which only bounds the pointing direction at the goal. The canonical pouring demo (viam-pouring-demo, PR #54) uses a LinearConstraint with both LineToleranceMm and OrientationToleranceDegs, moving the cup along a straight, level path so it does not spill. This matches dgottlieb's review note on #5098 that the orientation-only approach may not reliably prevent spills. Switch the example and its surrounding prose to the linear constraint. The place-a-cup-on-the-table scenario, pose cloud, and figures are unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
✅ Deploy Preview for viam-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
The figure shows the gripper holding the cup from the side, with the tool pointing horizontally, but the code used OZ:-1 (a top-down grasp). Set the goal orientation to OX:1 so the code matches the figure. With a horizontal grasp, Theta:180 would roll the cup about a horizontal axis and tip it. Relax OX and OY instead, so the planner can approach from any side (the cup may rest at any rotation about vertical), with a small OZ leeway to keep the approach horizontal and the cup upright. This matches the pouring demo and exercises the OX/OY/OZ rows of the tolerance table. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Hey btshrewsbury-viam — CI is green and no reviewer is assigned yet. Could you request one when you have a chance? Auto-comment from overwatch. Will not re-nudge for 7 days. |
Collaborator
Author
|
Closing in favor of #5197, which carries both commits from this PR (with cleaned commit messages so the CLA check passes) plus the motion-planning happy-path correction. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What
Two fixes to the code example on Relax a goal with a pose cloud, so it matches both the figure and the canonical pouring demo:
OrientationConstraint→LinearConstraint{LineToleranceMm: 5, OrientationToleranceDegs: 5}(a straight, level path, not just level at the goal).OZ: -1(a top-down grasp), but the figure shows the gripper holding the cup from the side. Set it toOX: 1(tool points horizontally) to match the figure.Why
On the PR that added the page (#5098), Dan Gottlieb (@dgottlieb) was skeptical the orientation-only approach reliably keeps the cup from spilling and pointed at the viam-pouring-demo (
pour/motion.go,pour/vinocart.go) as the shape a user should write. That demo uses aLinearConstraintand grasps the cup from the side withOX/OYleeway.The two changes interact: with a side grasp (
OX: 1, tool horizontal), the oldTheta: 180would roll the cup about a horizontal axis and tip it. So the pose cloud now relaxesOX/OYinstead (approach from any side ≈ any rotation about vertical) with a smallOZto keep the approach horizontal and the cup upright — the demo's pattern. This also makes the example exercise theOX/OY/OZrows of the page's tolerance table and lines up with the page's existing orientation-normalization callout (set a non-zeroOXon the goal so the leeway is measured from the intended grasp). The RDKPoseClouddoc comment confirms the physics: a large orientation leeway with a large theta lets "the cup start to tip and spill."Changes
All in
docs/motion-planning/move-an-arm/pose-clouds.md:{OZ: -1}→{OX: 1, OZ: 0, Theta: 180}; pose cloud{X, Y, Z, Theta: 180}→{X: 75, Y: 75, Z: 0, OX: 1, OY: 1, OZ: 0.1}; constraint →LinearConstraint.Verification
rdk/motionplan/constraint.go:42-45andrdk/referenceframe/pose_cloud.go:17-72.viam-pouring-demo#54.vale(0/0/0), andmake build-prodall pass.🤖 Generated with Claude Code