Skip to content

Motion planning docs: direct joint-space path first, cBiRRT as fallback#5197

Merged
btshrewsbury-viam merged 4 commits into
mainfrom
docs/motion-planning-happy-path
Jul 14, 2026
Merged

Motion planning docs: direct joint-space path first, cBiRRT as fallback#5197
btshrewsbury-viam merged 4 commits into
mainfrom
docs/motion-planning-happy-path

Conversation

@btshrewsbury-viam

Copy link
Copy Markdown
Collaborator

What

Corrects the motion planning docs to describe the actual happy path: the planner tries a straight line through joint space to an IK solution first, and runs cBiRRT only as a fallback. Olivia Miller flagged that How planning works and /reference/services/motion/algorithms/ both presented cBiRRT as the primary algorithm.

Verified against the RDK at the v1.0.0 release tag (motionplan/armplanning/):

  • planSingleGoalinitRRTSolutionsgetSolutions: IK generates up to 100 solutions, scored by joint-space travel (plus a mid-range joint bias). Each solution gets a straight-line joint-space CheckPath. The cheapest solution within 3× (defaultOptimalityMultiple) of the best cost that passes is returned immediately; cBiRRT runs only when none does, seeded with the surviving solutions.
  • planToDirectJoints: explicit joint goals get the same straight-line check first.
  • generateWaypoints: a LinearConstraint subdivides the motion into Cartesian steps; tolerances below 10 mm/deg disable cBiRRT entirely.
  • Smoothing (10/3/1 passes) applies only to cBiRRT output.

Changes

  • docs/motion-planning/how-planning-works.md — restructured: "First attempt: a straight line in joint space" now leads, cBiRRT is framed as the fallback, and a paragraph covers how linear constraints keep planning in the direct stage.
  • docs/motion-planning/reference/algorithms.md — describes the two-stage strategy (stage table, cBiRRT role marked as fallback, direct-path cost gate added to defaults); absorbs the deleted legacy page's aliases.
  • docs/reference/services/motion/algorithms.mddeleted. It described an RRT*-Connect/CBiRRT hybrid and TP-space base planning, neither of which exists at RDK v1.0.0 (git grep finds no RRT* or tpspace source; the builtin service returns "not supported" for MoveOnMap/MoveOnGlobe). Its URL and /operate/ alias now redirect to the current algorithms page (verified in the built public/ output). This also resolves the pre-existing alias collision: the new page already claimed /reference/services/motion/algorithms/ as an alias while the legacy file occupied it.
  • docs/motion-planning/quickstarts/first-arm.md — the obstacle-free quickstart motion takes the direct path, so the "What happened" list no longer claims cBiRRT ran.
  • docs/motion-planning/reference/motion-service.md — smoothing default scoped to cBiRRT fallback paths.
  • docs/reference/services/motion/_index.md — algorithms link retargeted to /motion-planning/reference/algorithms/.

Absorbs #5149

The first two commits are the pose-clouds linear-constraint fixes from #5149, which is closed in favor of this PR.

Known artifact

The generated MoveOnGlobe API note still links to /reference/services/motion/algorithms/ for base-planning latency; that link now redirects to the arm algorithms page. The note comes from generated content and is stale regardless (builtin no longer implements MoveOnGlobe); fixing it belongs in the upstream generator.

Verification

  • Planning flow verified against rdk tag v1.0.0 (plan_manager.go, node.go, planner_options.go, smooth.go); independently confirmed by a second review pass over the same tag.
  • Gates: prettier, markdownlint, vale (0 errors), and make build-prod all pass; alias redirects for both legacy URLs confirmed in build output.

🤖 Generated with Claude Code

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.
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.
The motion planning pages presented cBiRRT as the primary algorithm.
In the RDK (verified at v1.0.0), cBiRRT is the fallback: the planner
first generates IK solutions, ranks them by joint travel, and returns
the straight-line joint-space path to a low-cost solution when that
path passes collision and constraint checks. cBiRRT runs only when no
reasonable solution is directly reachable.

- how-planning-works.md: lead with the direct-path stage, frame cBiRRT
  as the fallback, and document how linear constraints keep planning in
  the direct stage (tolerances below 10 mm/deg disable the fallback).
- motion-planning/reference/algorithms.md: describe the two-stage
  strategy; absorb the aliases of the deleted legacy page.
- Delete reference/services/motion/algorithms.md: it described an
  RRT*-Connect/CBiRRT hybrid and TP-space base planning that no longer
  exist in the RDK; its URL now redirects to the current algorithms
  page.
- first-arm.md: the obstacle-free quickstart motion takes the direct
  path, not cBiRRT.
- motion-service.md: scope the smoothing default to cBiRRT fallback
  paths.
@netlify

netlify Bot commented Jul 14, 2026

Copy link
Copy Markdown

Deploy Preview for viam-docs ready!

Name Link
🔨 Latest commit a7362e3
🔍 Latest deploy log https://app.netlify.com/projects/viam-docs/deploys/6a566b7d864d1600084fa07d
😎 Deploy Preview https://deploy-preview-5197--viam-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 39 (🔴 down 1 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 92 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@viambot viambot added the safe to build This pull request is marked safe to build from a trusted zone label Jul 14, 2026
The PR htmltest job builds with config_local.toml, which sets
disableAliases = true, so the alias left behind for the deleted
/reference/services/motion/algorithms/ page emits no file in that
build and the generated MoveOnGlobe note's link dangled. Point the
link at the real page, /motion-planning/reference/algorithms/, in
both the generated include and its override source so regeneration
preserves it.
@btshrewsbury-viam
btshrewsbury-viam merged commit fc9ca48 into main Jul 14, 2026
13 checks passed
@btshrewsbury-viam
btshrewsbury-viam deleted the docs/motion-planning-happy-path branch July 14, 2026 20:26
@github-actions

Copy link
Copy Markdown

🔎💬 Inkeep AI search and chat service is syncing content for source 'Viam Docs'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants