Skip to content

RSDK-14588 Add a FrameSystem service type and client - #1271

Draft
JohnN193 wants to merge 1 commit into
RSDK-14587-robot-client-get-posefrom
RSDK-14588-framesystem-service
Draft

JohnN193 wants to merge 1 commit into
RSDK-14587-robot-client-get-posefrom
RSDK-14588-framesystem-service

Conversation

@JohnN193

Copy link
Copy Markdown
Member

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 full RobotClient. In Go the frame system is an RDK internal resource with API rdk-internal:service:frame_system and public name $framesystem, reachable through framesystem.FromDependencies and framesystem.FromProvider.

Depends on #1270 (RobotClient.get_pose).

Change

New package src/viam/services/framesystem/, following the motion service layout:

  • FrameSystem(ServiceBase) with API = API("rdk-internal", "service", "frame_system") and PUBLIC_NAME = "$framesystem". Abstract get_frame_system_config, get_pose, transform_pose, transform_pcd, mirroring the RobotClient signatures plus timeout. CurrentInputs is 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 raises ResourceNotFoundError when missing.
  • FrameSystemClient(name, channel) over RobotServiceStub. Client only: the RPCs live on RobotService and viam-server owns the implementation, so there is no RPC service and no Registry.register_api. transform_pcd keeps calling the TransformPCD RPC rather than transforming locally, since Python has no point cloud library.
  • RESOURCE_NAMESPACE_RDK_INTERNAL = "rdk-internal" added next to RESOURCE_NAMESPACE_RDK.

The ticket left open whether RobotClient.get_service should special case $framesystem the way Go RobotClient.ResourceByName does. Decided yes: RobotClient holds one FrameSystemClient over its own channel, get_service returns it for the reserved name, and the client's channel is reset alongside the robot stub on reconnect. $framesystem never appears in ResourceNames, so the registry lookup is bypassed only for that exact name. Any other name under the API still raises ResourceNotFoundError.

Tests

tests/test_framesystem_service.py against the shared RobotService fixture from tests/test_robot.py, which gains a TransformPCD handler:

  • API string, public name and resource_name_from_string("rdk-internal:service:frame_system/$framesystem") round trip.
  • FrameSystemClient for all four RPCs, including request field pass through, timeout propagation and reset_channel.
  • RobotClient.get_service special case: not in resource_names, returns the same cached client each time, type mismatch still raises ValueError, other names still raise ResourceNotFoundError.
  • FrameSystem.from_robot and from_dependencies.

make lint, pyright and make test pass (907 passed, 5 skipped).

Jira: RSDK-14588

🤖 Generated with Claude Code

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

No deployments
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