Conversation
Add viam.services.framesystem with an abstract FrameSystem under the rdk-internal:service:frame_system API and a FrameSystemClient that talks to RobotService over a channel, so modules and clients can use the frame system without holding a full RobotClient. The frame system is never listed in ResourceNames, so there is no registry entry. RobotClient.get_service special cases the reserved $framesystem name the way the Go RobotClient does and hands out one client that follows the robot's channel across reconnects. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This branch has not been deployed
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.
Problem
The Python SDK has no frame system service type. Frame system access exists only as RPC wrappers on
RobotClient, so a module or client that only needs poses has to hold a fullRobotClient. In Go the frame system is an RDK internal resource with APIrdk-internal:service:frame_systemand public name$framesystem, reachable throughframesystem.FromDependenciesandframesystem.FromProvider.Depends on #1270 (
RobotClient.get_pose).Change
New package
src/viam/services/framesystem/, following the motion service layout:FrameSystem(ServiceBase)withAPI = API("rdk-internal", "service", "frame_system")andPUBLIC_NAME = "$framesystem". Abstractget_frame_system_config,get_pose,transform_pose,transform_pcd, mirroring theRobotClientsignatures plustimeout.CurrentInputsis left for RSDK-14593.FrameSystem.from_robot(robot)defaults the name to$framesystem.FrameSystem.from_dependencies(deps)looks the frame system up in a dependency mapping and raisesResourceNotFoundErrorwhen missing.FrameSystemClient(name, channel)overRobotServiceStub. Client only: the RPCs live onRobotServiceand viam-server owns the implementation, so there is no RPC service and noRegistry.register_api.transform_pcdkeeps calling theTransformPCDRPC rather than transforming locally, since Python has no point cloud library.RESOURCE_NAMESPACE_RDK_INTERNAL = "rdk-internal"added next toRESOURCE_NAMESPACE_RDK.The ticket left open whether
RobotClient.get_serviceshould special case$framesystemthe way GoRobotClient.ResourceByNamedoes. Decided yes:RobotClientholds oneFrameSystemClientover its own channel,get_servicereturns it for the reserved name, and the client's channel is reset alongside the robot stub on reconnect.$framesystemnever appears inResourceNames, so the registry lookup is bypassed only for that exact name. Any other name under the API still raisesResourceNotFoundError.Tests
tests/test_framesystem_service.pyagainst the sharedRobotServicefixture fromtests/test_robot.py, which gains aTransformPCDhandler:resource_name_from_string("rdk-internal:service:frame_system/$framesystem")round trip.FrameSystemClientfor all four RPCs, including request field pass through, timeout propagation andreset_channel.RobotClient.get_servicespecial case: not inresource_names, returns the same cached client each time, type mismatch still raisesValueError, other names still raiseResourceNotFoundError.FrameSystem.from_robotandfrom_dependencies.make lint,pyrightandmake testpass (907 passed, 5 skipped).Jira: RSDK-14588
🤖 Generated with Claude Code