Skip to content

RSDK-14748: build and serve the typed KinematicModel from referenceframe - #6637

Closed
JohnN193 wants to merge 4 commits into
viamrobotics:mainfrom
JohnN193:RSDK-14748-typed-model
Closed

JohnN193 wants to merge 4 commits into
viamrobotics:mainfrom
JohnN193:RSDK-14748-typed-model

Conversation

@JohnN193

@JohnN193 JohnN193 commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

First rdk piece of RSDK-14233, the Enhanced Arm Kinematics API, for ticket RSDK-14748. Builds on the api change in viamrobotics/api#899, sits on top of #6644, and replaces the referenceframe part of the prototype in #6494.

Changes

  • ModelToProto and ModelFromProto convert a model to and from commonpb.KinematicModel, with ModelConfigToProto and ModelConfigFromProto underneath for the configuration alone. Links keep whichever orientation representation the file used. DH parameters expand into the joint and link each one stands for, named the way ParseConfig already names them.
  • The message carries the limits the model enforces, read from its frames, so an override made with NewModelWithLimitOverrides or an input_range_override shows up on the wire. A revolute joint with no position bound goes out as JOINT_TYPE_CONTINUOUS and comes back as the unbounded revolute joint the URDF reader has always built.
  • A mesh keeps its bytes, its content type and the path it was read from in original_file_source_path_diagnostic.
  • A link's collision geometries all reach the message, and the wire carries the same labels the Go model gives them, <link>_collision_<i> for several unlabelled ones. The frames and LinkConfig side of that is RSDK-14771: carry several collision geometries per link #6644 for RSDK-14771, which needs nothing from the new api and lands first. This branch carries the same commit until then, and only the list handling in model_proto.go stays here after a merge from main.
  • SimpleModel holds visual geometries per link as spatialmath.GeometryConfig and the component properties as a plain KinematicProperties struct, with accessors. No proto type on the model, the converters in model_proto.go are the only place the message appears. Nothing in RDK reads them, they ride the message for viewers and SDKs, and they survive a limit override.
  • KinematicModelToProtobuf fills model. The deprecated bytes keep replaying the file the model was read from, and a model that never had a file, one built from a configuration in code or read from the message, gets them written as an SVA file so old clients still have something to parse. KinematicModelFromProtobuf prefers model and falls back to the bytes.

Notes

  • A client that predates model sees no change in what it gets, since the bytes still replay the file. The scope's line that the bytes are derived from the model is read here as precedence for readers. Always deriving them from the model is a one line change if reviewers want it, with the side effect that a URDF backed component would hand old clients SVA JSON instead of the URDF and the mesh map.
  • Converting a model built from frames with no configuration is RSDK-14772 and follows this PR.
  • go.mod points go.viam.com/api at a build of the api branch. RSDK-14233: add KinematicModel to GetKinematics and FrameSystemConfig api#899 merged and tagged as v0.1.592, then Revert navigation API rework and kinematic model protos api#927 reverted it together with the Navigation API rework. Restore navigation API rework and kinematic model protos api#929 restored both as v0.1.597, so the proto is back on main, but so is the navigation rework, which rdk's navigation service does not compile against until Refactor navigation service #6643 lands. The replace comes off and api moves to v0.1.597 right after that merge, before review. rdk itself builds and tests fine against the replace on CI. Lint flags the replace, and TestAppTemplateCompiles in cli and the motion benchmarks fail because both build rdk as a dependency of another module, which resolves go.viam.com/api from the proxy at the released version where the new messages do not exist. Those clear once api tags.
  • Code that still reads or writes the deprecated fields carries a staticcheck annotation, since those fields are served for the length of the deprecation window.
  • TestParseJSONFile fails for xarm6 on main at 2176b91 without any of these changes.

Testing

  • Every checked in kinematics file, SVA, DH and URDF, round trips through the message with the same limits, forward kinematics and geometry at random inputs.
  • A response with both encodings, with only the model and with only the bytes all parse to the same model. A model built from a configuration in code serves both. A model built from frames serves what it did before.
  • An overridden limit reaches the message while the bytes still replay the file. Continuous joints, mesh paths, visual geometry and properties each round trip.
  • go build ./..., go test over referenceframe, spatialmath, the arm, gantry and gripper components and the frame system service, and golangci-lint run ./... locally with the api replace in place.

🤖 Generated with Claude Code

ModelToProto and ModelFromProto convert a model to and from
commonpb.KinematicModel, with the configuration level pair underneath. DH
parameters expand into links and joints, orientations keep the representation
the file used, and the message carries the limits the model enforces rather
than the ones its file declared. SimpleModel holds visual geometries and
properties for the message, since the SVA schema has no place for them.

GetKinematics fills model and keeps replaying the file for the deprecated
bytes, writing an SVA file from the model only when there is no file to
replay. Readers prefer model and fall back to the bytes.

go.mod points go.viam.com/api at the api branch until viamrobotics/api#899
merges and tags.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@viambot viambot added the safe to test This pull request is marked safe to test from a trusted zone label Oct 12, 2026
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@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 Oct 12, 2026
Visual geometries are held as spatialmath.GeometryConfig and the component properties as a
plain struct, so Go callers never touch the KinematicModel message. The converters in
model_proto.go are the only place the proto appears. A geometry whose center is the identity
no longer comes back with an orientation config after a round trip.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@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 Oct 13, 2026
Static and translational frames hold a list of geometries. LinkConfig gains a geometries
field for the ones beyond the first, while the first stays in geometry so a reader that
predates the field still sees one. An unlabelled geometry is named after its link when it is
the only one, as before, and <link>_collision_<i> otherwise, on the model and on the wire.
A label written in a file is kept rather than replaced with the link id, so the wire and the
Go model agree.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@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 Oct 13, 2026
@JohnN193

Copy link
Copy Markdown
Member Author

Reopened from an upstream branch as #6655, same commits.

@JohnN193 JohnN193 closed this Oct 14, 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.

2 participants