Skip to content

Add motion plan JSON parser (parsePlan)#838

Draft
Marcus (sucrammal) wants to merge 1 commit into
mainfrom
motion-plan-replayer-1a-parse
Draft

Add motion plan JSON parser (parsePlan)#838
Marcus (sucrammal) wants to merge 1 commit into
mainfrom
motion-plan-replayer-1a-parse

Conversation

@sucrammal

@sucrammal Marcus (sucrammal) commented Jul 10, 2026

Copy link
Copy Markdown
Member

The Motion Plan Replayer needs raw plan JSON turned into a typed, validated structure before anything can be rendered. Adds parsePlan, which parses a plan's concatenated JSON objects into a ParsedPlan (frames, parents, trajectory, goals) with zod validation and a typed PlanParseError.

Changes

  • Frontend: Adds parse-plan.ts — zod schemas + brace-matching splitter for multi-object plan JSON; exports parsePlan, ParsedPlan, RawFrame, PlanParseError
  • Tests: Adds parse-plan.spec.ts covering valid plans, malformed JSON, and missing fields

Stack

Links

APP-9316

Testing

  • Run npx vitest run src/lib/plugins/MotionPlanReplayer/tests/parse-plan.spec.ts
  • Confirm valid multi-object plan JSON parses into a ParsedPlan; malformed input throws PlanParseError with a readable message

Stack created with GitHub Stacks CLIGive Feedback 💬

@changeset-bot

changeset-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 29ca7cc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@viamrobotics/motion-tools Patch

Not sure what this means? Click here to learn what changesets are.

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

@github-actions

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://viamrobotics.github.io/visualization/pr-preview/pr-838/

Built to branch gh-pages at 2026-07-10 18:55 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

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