Skip to content

arm: make the builtin motion service optional - #55

Merged
Jiwon Shin (js6450) merged 2 commits into
mainfrom
optional-builtin-motion
Sep 24, 2026
Merged

Jiwon Shin (js6450) merged 2 commits into
mainfrom
optional-builtin-motion

Conversation

@js6450

Copy link
Copy Markdown
Collaborator

viam-server's Windows build has no motion service, so requiring builtin stops the arm constructing there at all — not just MoveToPosition, but the whole component, and with it the gripper and calibration sensor that depend on it. The Windows binary from #50 therefore can't be used.

builtin becomes an optional dependency, so RDK passes it whenever it exists and nothing changes on platforms that have one. A motion service named explicitly in the config stays required — asking for a specific one and silently not getting it would be worse than failing. When none is available, the constructor logs it once and MoveToPosition returns an error rather than dereferencing nil.

Tested

  • go test ./... passes (12 packages). TestHardwareArmMoveToPositionSendsGoalCloud covers the unchanged path: with a motion service injected, MoveToPosition still works.
  • Adds TestHardwareArmMoveToPositionRequiresMotionService, mirroring the simulated arm's guard test. Removing the guard makes it fail.
  • On macOS with a motion service present, MoveToPosition still plans and executes: commanded a 20 mm move on an SO-101 follower arm and it reached the target to within a millimetre, matching the same command on the released 0.9.9 build immediately before the swap.
  • Running on Windows 11 (viam-server 1.9.0) against an SO-101 leader/follower pair for a full day: both arms, grippers, calibration sensors, the discovery service and teleop all construct and run, logging builtin motion service unavailable, MoveToPosition disabled. Teleoperation, motion recording and playback all work.

The SO-101: Teleop and Motion Capture course we're launching uses this module, and this change is one of the pieces needed for Windows learners to take it.

🤖 Generated with Claude Code

viam-server's Windows build has no motion service, so requiring "builtin"
stopped the arm from constructing at all there -- not just MoveToPosition,
but the whole component, and with it the gripper and calibration sensor that
depend on it.

"builtin" is now an optional dependency, so RDK passes it whenever it exists
and nothing changes on platforms that have one. A motion service named in the
config stays required, since asking for a specific one and silently not
getting it would be worse than failing. When no motion service is available
the constructor says so once, and MoveToPosition returns an error instead of
dereferencing nil.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

@HipsterBrown Nick Hehr (HipsterBrown) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One update to that log line then it should be good to ship.

Comment thread components/arm/arm.go Outdated
ms, err = motion.FromProvider(deps, "builtin")
if err != nil {
return nil, err
logger.Info("builtin motion service unavailable, MoveToPosition disabled")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should be a warning rather than Info

Review feedback: without a motion service MoveToPosition is disabled, which is
a reduced capability worth surfacing, not routine information.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@js6450
Jiwon Shin (js6450) merged commit 859e510 into main Sep 24, 2026
2 checks passed
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.

2 participants