Repository navigation
Conversation
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>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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>
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>
Member
Author
|
Reopened from an upstream branch as #6655, same commits. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
ModelToProtoandModelFromProtoconvert a model to and fromcommonpb.KinematicModel, withModelConfigToProtoandModelConfigFromProtounderneath 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 wayParseConfigalready names them.NewModelWithLimitOverridesor aninput_range_overrideshows up on the wire. A revolute joint with no position bound goes out asJOINT_TYPE_CONTINUOUSand comes back as the unbounded revolute joint the URDF reader has always built.original_file_source_path_diagnostic.<link>_collision_<i>for several unlabelled ones. The frames andLinkConfigside 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 inmodel_proto.gostays here after a merge from main.SimpleModelholds visual geometries per link asspatialmath.GeometryConfigand the component properties as a plainKinematicPropertiesstruct, with accessors. No proto type on the model, the converters inmodel_proto.goare 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.KinematicModelToProtobuffillsmodel. 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.KinematicModelFromProtobufprefersmodeland falls back to the bytes.Notes
modelsees 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.go.modpointsgo.viam.com/apiat 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, andTestAppTemplateCompilesin cli and the motion benchmarks fail because both build rdk as a dependency of another module, which resolvesgo.viam.com/apifrom the proxy at the released version where the new messages do not exist. Those clear once api tags.TestParseJSONFilefails for xarm6 on main at 2176b91 without any of these changes.Testing
go build ./...,go testover referenceframe, spatialmath, the arm, gantry and gripper components and the frame system service, andgolangci-lint run ./...locally with the api replace in place.🤖 Generated with Claude Code