Skip to content

RSDK-13405: Allow for motion plan requests to express a goal with leeway.#5747

Open
dgottlieb wants to merge 6 commits intoviamrobotics:mainfrom
dgottlieb:RSDK-13405
Open

RSDK-13405: Allow for motion plan requests to express a goal with leeway.#5747
dgottlieb wants to merge 6 commits intoviamrobotics:mainfrom
dgottlieb:RSDK-13405

Conversation

@dgottlieb
Copy link
Member

No description provided.

@viambot viambot added the safe to test This pull request is marked safe to test from a trusted zone label Feb 12, 2026
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Feb 12, 2026
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Feb 12, 2026
// these leeways describe a cloud where arriving at any destination within that cloud are considered
// equivalent.
//
// All of the leeways affect the algorithm independently. None of the leeways will be scaled based
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is useful enough to keep in here. I did at least want to provide a more rigorous description in the PR and scale back (or add more detail) as we like.

// goal pose. Any candidate pose with an Z inside the leeway will be considered equivalent.
Z [2]float64 `json:"z"`

// The orientation values are unitless. As above, each of the OX, OY and OZ are broken into a
Copy link
Member Author

@dgottlieb dgottlieb Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was my interpretation of an analogous treatment of orientations. No idea if this is useful at all. It's not obvious to me that this is better than simply a distance.

Also (so long as orientation.viam.dev is to be trusted). Asking for a goal of OX/OY/OZ of 0,0,1 and then saying OX can be -0.2 -> 0.2 creates a problem. In the 0.2 case, the teapot tips forward (spout tipping down a bit) compared to the goal. But in the OX: -0.2 case, while the orientation vector moves just a small bit (the teapot "tips backwards"), the spout is 180d. Facing downward on the opposite side as opposed to a little upward.

Because the spout is what matters (in the case of pouring), I think a surprise theta flip would lead to bugs. I expect this is all math we can do under the hood. But then savvy users that know about the negative flipping when constructing goal poses might get hung up on how to use OX/OY/OZ leeways.

Just surfacing my thoughts/investigation on what leeway means for orientation vectors.

@dgottlieb dgottlieb requested a review from erh February 12, 2026 17:57
@github-actions
Copy link
Contributor

Availability

Scene # viamrobotics:main dgottlieb:RSDK-13405 Percent Improvement Health
1 100% 100% 0%
2 100% 100% 0%
3 100% 100% 0%
4 100% 100% 0%
5 100% 100% 0%
6 100% 100% 0%
7 100% 100% 0%
8 100% 100% 0%
9 100% 100% 0%
10 100% 100% 0%
11 100% 100% 0%

Quality

Scene # viamrobotics:main dgottlieb:RSDK-13405 Percent Improvement Probability of Improvement Health
1 1.31±0.00 1.31±0.00 -0% 0%
2 0.94±0.01 0.90±0.00 3% 100%
3 5.95±0.29 5.99±0.15 -1% 46%
4 1.98±0.27 2.02±0.28 -2% 47%
5 8.31±1.46 9.50±2.75 -14% 35%
6 9.08±2.61 9.28±2.89 -2% 48%
7 1.95±0.38 1.95±0.38 -0% 50%
8 0.94±0.01 0.90±0.00 3% 100%
9 4.29±0.19 4.29±0.19 0% 50%
10 12.78±0.44 12.78±0.44 -0% 50%
11 0.62±0.00 0.62±0.00 0% 70%

Performance

Scene # viamrobotics:main dgottlieb:RSDK-13405 Percent Improvement Probability of Improvement Health
1 0.02±0.00 0.02±0.01 -44% 10%
2 0.03±0.00 0.03±0.00 -9% 23%
3 0.02±0.00 0.02±0.00 -4% 37%
4 0.22±0.04 0.25±0.06 -17% 31%
5 1.41±0.18 1.48±0.18 -5% 38%
6 1.57±0.27 1.72±0.47 -9% 40%
7 1.26±0.08 1.28±0.07 -2% 41%
8 0.03±0.00 0.03±0.00 -5% 36%
9 1.74±0.11 1.70±0.08 3% 63%
10 3.19±0.40 3.43±0.44 -7% 34%
11 0.52±0.04 0.62±0.01 -20% 1%

The above data was generated by running scenes defined in the motion-testing repository
The SHA1 for viamrobotics:main is: 0e931489d131bab9318e21e661bd8bd8d4c13ade
The SHA1 for dgottlieb:RSDK-13405 is: 0e931489d131bab9318e21e661bd8bd8d4c13ade

  • 11 samples were taken for each scene


// GoalCloud can describe a cloud of candidate poses that are considered equivalent to the goal
// pose for a motion plan. The default value allows no leeway in any dimension.
GoalCloud motionplan.GoalCloud `json:"goal_cloud"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be on PlanRequest, not options.
Options feels low level to me.
I almost want to put this one very goal at some point, so would rather have it closer.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made (the easiest) change to put this on each goal object. In a way that's obviously not backwards breaking. Just so you can see.

Read: it's a new member of PoseInFrame. And I filled in lines that highlight there'd be some changes to the api repo. If you think living on PoseInFrame looks good, we're basically done, I can make/roll out the mechnical API changes.

But if you want it elsewhere, we'll need to brainstorm ways to put it in a nicer spot with an appropriate (if any) amount of backwards breaking.


// Theta represents the [negative leeway, positive leeway] in an objects rotation around its
// orientation axis in the unit of degrees.
Theta [2]float64 `json:"theta"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is ok, but insufficient as we discussed today.
This one is especially bad because 0 and 360 are the same
The rest don't have that property

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was probably too distracted/too much time has passed where I lost context here. I agree 0-360 are the same. And I expect -180 and +180 are also the same (even though I try to use them to make the wrist rotate "the right way").

Was this "ok for now but we'll need to make forward-compatible changes"? Or was this "needs a change to now to avoid a future backwards compatibility problem"?

I removed the [2]float64 in favor of a single float64, but did nothing else here.

// a cup. There may be some freedom with respect to the exact orientation and theta of the
// gripper. But a scenario where a legal, but severe orientation leeway might work with a smaller
// difference in the candidate's theta, but not necessarily a larger one.
type GoalCloud struct {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i guess my big question is do we really want different min and max

i

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed them -- was easier to put them in and get validation it was onerous than to omit them and get negative acknowledgment that we didn't want more fine-grained.

@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Mar 3, 2026
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Mar 3, 2026
@dgottlieb dgottlieb requested a review from erh March 4, 2026 02:22
@erh
Copy link
Member

erh commented Mar 4, 2026

i like the api

@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test This pull request is marked safe to test from a trusted zone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants