Skip to content

use motion service if available to dry run plans for arm#73

Closed
mattmacf98 wants to merge 1 commit into
mainfrom
APP-15609-show-ui-error-for-move-to-position
Closed

use motion service if available to dry run plans for arm#73
mattmacf98 wants to merge 1 commit into
mainfrom
APP-15609-show-ui-error-for-move-to-position

Conversation

@mattmacf98
Copy link
Copy Markdown
Member

@mattmacf98 mattmacf98 commented May 19, 2026

Description

as part of https://viam.atlassian.net/browse/APP-15609 we want to show limits in the arm control UI for move to position. This PR achieves this by using a motion service (if available) to execute the doPlan doCommand to check if a plan is feasible without actual moving the arm.

If the arm is not in the frame system (i.e. cannot be used my motion service) we swallow the error and default to the existing behavior of only showing the error on user execute.

NOTE: relying on a motion service to do this validation is a little hacky, so I am fine if we just don't do this until we get an actual api on the arm to verify positions

Testing

  • ran locally and tested with builtin motion service, custom motion service and no frame arm
moveToPositiondemo.mp4

@mattmacf98 mattmacf98 requested a review from micheal-parks May 19, 2026 20:36
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 19, 2026

⚠️ No Changeset found

Latest commit: 00acad5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@mattmacf98 mattmacf98 requested a review from DTCurrie May 19, 2026 20:36
() => resourceName
)

const resourceNames = useResourceNames(() => partID)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this is kinda awkward to re-get resourcenames, but I need it figure out which motion service we need

moveToPosMutation.mutate([position], {})
}

const validatePlan = (position: Pose) =>
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I will make sure these look the same in arm.svelete and move-to-position-widget.svelte if we choose this approach

Execute
</Button>
<ErrorDisplay {lastError} />
<ErrorDisplay lastError={displayError} />
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

we can only validate a pose is valid all together (so does not make sense to have a per row error)

[MOTION_DO_PLAN_COMMAND]: buildPlanMoveRequestJson(motionServiceName, componentName, pose),
})
} catch (error) {
if (error instanceof Error && error.message.includes('not found in robot frame system')) {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this is a pretty iffy swallow, but I needed this or else this approach would error for any arm not in the frame system

@mattmacf98
Copy link
Copy Markdown
Member Author

we are not going to do this

@mattmacf98 mattmacf98 closed this May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant