Repository navigation
RSDK-14757 Typed kinematic model for arm, gantry and gripper - #1312
Merged
Merged
Conversation
Add get_kinematic_model to the arm, gantry and gripper, returning the KinematicModel message, and deprecate get_kinematics, which stays for modules and clients that still use the file bytes. viam.kinematics holds the helpers a module needs to serve a model: read_kinematic_model_file, a strict loader for the proto JSON file format, and narrow_joint_limits, which narrows a model to a resource's config and refuses anything that would widen a limit. The three servers share one GetKinematics reply that follows rdk. A request with a mesh flag gets the model alone, with bytes only for the roles asked for. A request with no flags gets the model and the deprecated file fields, which are written from the model as an SVA file when the resource no longer implements get_kinematics. The loader is held to the shared fixtures from rdk, copied into tests/data/kinematic_models at rdk cefbb7080. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Contributor
|
Warning your change may break code samples. If your change modifies any of the following functions please contact @viamrobotics/fleet-management. Thanks!
|
Member
|
👋 Thanks for requesting a review from the team! We aim to review PRs within one business day. If this is urgent |
The fixtures are a pinned copy of rdk's, so GitHub collapses them in a diff. The attribute goes in a root .gitattributes rather than the one in the fixture directory so that the copy stays identical to rdk. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Naveed Jooma (njooma)
approved these changes
Nov 13, 2026
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.
What
Finishes the Python side of the typed kinematics API (RSDK-14757). The automated protos update #1291 already carried the raw
KinematicModelthrough as an optional fourth tuple element ofget_kinematics. This adds a typed way in and the helpers a module needs.get_kinematic_model(include_collision_meshes=, include_visual_meshes=)onArm,GantryandGripper, base, client and server. It returns theKinematicModelmessage, asget_kinematic_modeldoes in the C++ SDK.get_kinematicsis deprecated in its docstring and keeps working for existing modules and clients.viam.kinematics:read_kinematic_model_file(path), a strict loader for the kinematic model file format (the proto JSON of the message), a port ofReadKinematicModelFilein rdk.narrow_joint_limits(model, limits), which narrows a model to thejoint_limitsattribute of a resource config and refuses a value that would widen a limit.KinematicsResponsein rdk:formatandkinematics_dataget_kinematicswhen the resource still implements it, and are otherwise written from the model as an SVA file. A model with a joint that has no position bound cannot be written, so it is served as the model alone, as rdk does.Things to look at
get_kinematicsloses@abc.abstractmethodandget_kinematic_modelis added without it, both raisingMethodNotImplementedErrorby default. An existing module keeps working on upgrade and a new one implements onlyget_kinematic_model. The C++ SDK went the other way and made the new method pure virtual. If anything builds module stubs from the abstract methods it will now emit neither, I have not checkedviam module generate... deprecated:: 0.86.0assumes the next release number.docs/examples/my_cool_arm.pystill implementsget_kinematicsonly.Testing
tests/test_kinematics.pyruns the loader over the shared fixtures from rdk (referenceframe/testfiles/kinematic_models, copied totests/data/kinematic_modelsat rdk cefbb7080). All 32 cases pass: 9 load to exactlyexpected.json, 23 are refused for the kinderror.jsonnames.UnmarshalModelJSONin rdk and compared to the model built fromexpected.json. The 8 fixtures that can be written as a file all match. That check is not part of this repo.make lint typecheck test: 1075 passed, 5 skipped (no viam-server locally).🤖 Generated with Claude Code