From 69440b0d78cb996e9815a448e215d1d3c892471d Mon Sep 17 00:00:00 2001 From: HipsterBrown Date: Tue, 28 Jul 2026 15:24:04 -0400 Subject: [PATCH 1/8] chore(arm): implement move_through_joint_positions and get_3d_models on all Arm subclasses Adds both methods to MockArm, ExampleArm, MyArm, MyCoolArm, and MyModularArm (notebook) while the Arm ABC remains untouched, so the test suite stays green. This is a prerequisite for a later change that declares both methods as abstract on the Arm ABC. --- docs/examples/example.ipynb | 18 +++++++++++-- docs/examples/my_cool_arm.py | 29 ++++++++++++++++++++ examples/complex_module/src/arm/my_arm.py | 31 ++++++++++++++++++++- examples/server/v1/components.py | 16 ++++++++++- tests/mocks/components.py | 33 +++++++++++++++++++++++ 5 files changed, 123 insertions(+), 4 deletions(-) diff --git a/docs/examples/example.ipynb b/docs/examples/example.ipynb index 090358396c..05e6ab2048 100644 --- a/docs/examples/example.ipynb +++ b/docs/examples/example.ipynb @@ -505,7 +505,7 @@ "# modular-arm/src/my_modular_arm.py\n", "import asyncio\n", "import os\n", - "from typing import Any, ClassVar, Dict, Mapping, Optional, Tuple, Union\n", + "from typing import Any, ClassVar, Dict, List, Mapping, Optional, Tuple, Union\n", "from typing_extensions import Self\n", "\n", "from viam.components.arm import Arm, JointPositions, KinematicsFileFormat, Pose\n", @@ -513,6 +513,7 @@ "from viam.operations import run_with_operation\n", "from viam.proto.app.robot import ComponentConfig\n", "from viam.proto.common import Mesh, ResourceName\n", + "from viam.proto.component.arm import MoveOptions\n", "from viam.resource.base import ResourceBase\n", "from viam.resource.registry import Registry, ResourceCreatorRegistration\n", "from viam.resource.types import Model, ModelFamily\n", @@ -567,10 +568,23 @@ " if await operation.is_cancelled():\n", " await self.stop()\n", " break\n", - " \n", + "\n", " self.joint_positions = positions\n", " self.is_stopped = True\n", "\n", + " async def move_through_joint_positions(\n", + " self,\n", + " positions: List[JointPositions],\n", + " options: Optional[MoveOptions] = None,\n", + " extra: Optional[Dict[str, Any]] = None,\n", + " **kwargs,\n", + " ):\n", + " for position in positions:\n", + " self.joint_positions = position\n", + "\n", + " async def get_3d_models(self, extra: Optional[Dict[str, Any]] = None, **kwargs) -> Mapping[str, Mesh]:\n", + " raise NotImplementedError()\n", + "\n", " async def stop(self, extra: Optional[Dict[str, Any]] = None, **kwargs):\n", " self.is_stopped = True\n", "\n", diff --git a/docs/examples/my_cool_arm.py b/docs/examples/my_cool_arm.py index 889b3cb667..c2dae8a748 100644 --- a/docs/examples/my_cool_arm.py +++ b/docs/examples/my_cool_arm.py @@ -7,6 +7,7 @@ from viam.components.arm import Arm, JointPositions, KinematicsFileFormat, Pose from viam.operations import run_with_operation from viam.proto.common import Capsule, Geometry, Mesh, Sphere +from viam.proto.component.arm import MoveOptions class MyCoolArm(Arm): @@ -91,6 +92,34 @@ async def move_to_joint_positions(self, positions: JointPositions, extra: Option self.is_stopped = True + @run_with_operation + async def move_through_joint_positions( + self, + positions: List[JointPositions], + options: Optional[MoveOptions] = None, + extra: Optional[Dict[str, Any]] = None, + **kwargs, + ): + operation = self.get_operation(kwargs) + + self.is_stopped = False + + # Move through each waypoint in order, honoring cancellation between them. + for position in positions: + await asyncio.sleep(1) + + if await operation.is_cancelled(): + await self.stop() + break + + self.joint_positions = position + + self.is_stopped = True + + async def get_3d_models(self, extra: Optional[Dict[str, Any]] = None, **kwargs) -> Mapping[str, Mesh]: + # Return the 3D meshes for this arm, keyed by link name. This arm has none. + return {} + async def stop(self, extra: Optional[Dict[str, Any]] = None, **kwargs): self.is_stopped = True diff --git a/examples/complex_module/src/arm/my_arm.py b/examples/complex_module/src/arm/my_arm.py index 00b3000df4..9b9cc24476 100644 --- a/examples/complex_module/src/arm/my_arm.py +++ b/examples/complex_module/src/arm/my_arm.py @@ -8,7 +8,8 @@ from viam.logging import getLogger from viam.operations import run_with_operation from viam.proto.app.robot import ComponentConfig -from viam.proto.common import Capsule, Geometry, ResourceName, Sphere +from viam.proto.common import Capsule, Geometry, Mesh, ResourceName, Sphere +from viam.proto.component.arm import MoveOptions from viam.resource.base import ResourceBase from viam.resource.registry import Registry, ResourceCreatorRegistration from viam.resource.types import Model, ModelFamily @@ -93,6 +94,34 @@ async def move_to_joint_positions(self, positions: JointPositions, extra: Option self.joint_positions = positions self.is_stopped = True + @run_with_operation + async def move_through_joint_positions( + self, + positions: List[JointPositions], + options: Optional[MoveOptions] = None, + extra: Optional[Dict[str, Any]] = None, + **kwargs, + ): + operation = self.get_operation(kwargs) + + self.is_stopped = False + + # Move through each waypoint in order, honoring cancellation between them. + for position in positions: + await asyncio.sleep(1) + + if await operation.is_cancelled(): + await self.stop() + break + + self.joint_positions = position + + self.is_stopped = True + + async def get_3d_models(self, extra: Optional[Dict[str, Any]] = None, **kwargs) -> Mapping[str, Mesh]: + # This arm has no meshes to report. + return {} + async def stop(self, extra: Optional[Dict[str, Any]] = None, **kwargs): self.is_stopped = True diff --git a/examples/server/v1/components.py b/examples/server/v1/components.py index 50ef07aee1..679ed35719 100644 --- a/examples/server/v1/components.py +++ b/examples/server/v1/components.py @@ -49,7 +49,7 @@ Vector3, Mesh, ) -from viam.proto.component.arm import JointPositions +from viam.proto.component.arm import JointPositions, MoveOptions from viam.proto.component.encoder import PositionType from viam.streams import StreamWithIterator from viam.utils import SensorReading, ValueTypes @@ -95,6 +95,20 @@ async def move_to_joint_positions(self, positions: JointPositions, extra: Option self.is_stopped = False self.joint_positions = positions + async def move_through_joint_positions( + self, + positions: List[JointPositions], + options: Optional[MoveOptions] = None, + extra: Optional[Dict[str, Any]] = None, + **kwargs, + ): + self.is_stopped = False + for position in positions: + self.joint_positions = position + + async def get_3d_models(self, extra: Optional[Dict[str, Any]] = None, **kwargs) -> Mapping[str, Mesh]: + return {} + async def stop(self, extra: Optional[Dict[str, Any]] = None, **kwargs): self.is_stopped = True diff --git a/tests/mocks/components.py b/tests/mocks/components.py index 3746bc33c8..e5acfca5d0 100644 --- a/tests/mocks/components.py +++ b/tests/mocks/components.py @@ -46,6 +46,7 @@ Sphere, Vector3, ) +from viam.proto.component.arm import MoveOptions from viam.proto.component.audioin import AudioChunk, GetAudioResponse from viam.proto.component.board import PowerMode from viam.proto.component.encoder import PositionType @@ -57,6 +58,11 @@ Geometry(center=Pose(x=1, y=2, z=3, o_x=2, o_y=3, o_z=4, theta=20), capsule=Capsule(radius_mm=3, length_mm=8)), ] +MODELS_3D = { + "base_link": Mesh(content_type="ply", mesh=b"\x00\x01"), + "link_1": Mesh(content_type="ply", mesh=b"\x02\x03"), +} + class MockArm(Arm): def __init__(self, name: str): @@ -67,6 +73,9 @@ def __init__(self, name: str): self.geometries = GEOMETRIES self.extra = None self.timeout: Optional[float] = None + self.waypoints: List[JointPositions] = [] + self.move_options: Optional[MoveOptions] = None + self.models_3d = MODELS_3D super().__init__(name) async def get_end_position(self, *, extra: Optional[Dict[str, Any]] = None, timeout: Optional[float] = None, **kwargs) -> Pose: @@ -102,6 +111,30 @@ async def move_to_joint_positions( self.extra = extra self.timeout = timeout + async def move_through_joint_positions( + self, + positions: List[JointPositions], + options: Optional[MoveOptions] = None, + *, + extra: Optional[Dict[str, Any]] = None, + timeout: Optional[float] = None, + **kwargs, + ): + self.waypoints = list(positions) + self.move_options = options + if self.waypoints: + self.joint_positions = self.waypoints[-1] + self.is_stopped = False + self.extra = extra + self.timeout = timeout + + async def get_3d_models( + self, *, extra: Optional[Dict[str, Any]] = None, timeout: Optional[float] = None, **kwargs + ) -> Mapping[str, Mesh]: + self.extra = extra + self.timeout = timeout + return self.models_3d + async def stop(self, *, extra: Optional[Dict[str, Any]] = None, timeout: Optional[float] = None, **kwargs): self.is_stopped = True self.extra = extra From 2208c0061aba2356743fffb3864e0b9946b300c0 Mon Sep 17 00:00:00 2001 From: HipsterBrown Date: Tue, 28 Jul 2026 15:35:51 -0400 Subject: [PATCH 2/8] chore(arm): implement new Arm methods on FakeArmClient test double FakeArmClient in tests/test_robot.py is a sixth Arm subclass that the original Task 1 file list missed. Without these methods it fails to instantiate once move_through_joint_positions and get_3d_models become abstract on the Arm ABC. --- tests/test_robot.py | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/tests/test_robot.py b/tests/test_robot.py index a09aeeff79..28f157a16a 100644 --- a/tests/test_robot.py +++ b/tests/test_robot.py @@ -1,5 +1,5 @@ import asyncio -from typing import Any, Dict, List, Optional, Tuple +from typing import Any, Dict, List, Mapping, Optional, Tuple from unittest import mock import pytest @@ -14,8 +14,8 @@ from viam.components.movement_sensor import MovementSensor from viam.errors import ResourceNotFoundError from viam.proto.app.datasync import UploadMetadata -from viam.proto.common import Geometry, GeoPoint, Orientation, Pose, PoseInFrame, ResourceName, Transform, Vector3 -from viam.proto.component.arm import JointPositions +from viam.proto.common import Geometry, GeoPoint, Mesh, Orientation, Pose, PoseInFrame, ResourceName, Transform, Vector3 +from viam.proto.component.arm import JointPositions, MoveOptions from viam.proto.robot import ( BlockForOperationRequest, BlockForOperationResponse, @@ -497,6 +497,24 @@ async def move_to_joint_positions( ): return await self.actual_client.move_to_joint_positions(positions, extra=extra, timeout=timeout) + async def move_through_joint_positions( + self, + positions: List[JointPositions], + options: Optional[MoveOptions] = None, + *, + extra: Optional[Dict[str, Any]] = None, + timeout: Optional[float] = None, + ): + return await self.actual_client.move_through_joint_positions(positions, options, extra=extra, timeout=timeout) + + async def get_3d_models( + self, + *, + extra: Optional[Dict[str, Any]] = None, + timeout: Optional[float] = None, + ) -> Mapping[str, Mesh]: + return await self.actual_client.get_3d_models(extra=extra, timeout=timeout) + async def get_joint_positions( self, *, From a389a724c1ab474a722dff52667ddedd986d3682 Mon Sep 17 00:00:00 2001 From: HipsterBrown Date: Tue, 28 Jul 2026 15:50:48 -0400 Subject: [PATCH 3/8] docs(arm): note MoveOptions obligations in example arm drivers my_cool_arm.py and complex_module's my_arm.py accepted MoveOptions in move_through_joint_positions but silently ignored it, with the only comment pointing at cancellation instead. A module author copying these examples would ship a driver that accepts speed/accel limits and drops them on the floor. Also fixes FakeArmClient in test_robot.py to pass options by keyword, matching extra/timeout, so a future keyword-only change on ArmClient doesn't break it at a distance. --- docs/examples/my_cool_arm.py | 2 ++ examples/complex_module/src/arm/my_arm.py | 3 +++ tests/test_robot.py | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/examples/my_cool_arm.py b/docs/examples/my_cool_arm.py index c2dae8a748..50ffbd41d6 100644 --- a/docs/examples/my_cool_arm.py +++ b/docs/examples/my_cool_arm.py @@ -105,6 +105,8 @@ async def move_through_joint_positions( self.is_stopped = False # Move through each waypoint in order, honoring cancellation between them. + # A real driver would clamp its motion to options.max_vel_degs_per_sec and + # options.max_acc_degs_per_sec2 here; this example moves at a fixed rate. for position in positions: await asyncio.sleep(1) diff --git a/examples/complex_module/src/arm/my_arm.py b/examples/complex_module/src/arm/my_arm.py index 9b9cc24476..f46fe8bb86 100644 --- a/examples/complex_module/src/arm/my_arm.py +++ b/examples/complex_module/src/arm/my_arm.py @@ -107,6 +107,9 @@ async def move_through_joint_positions( self.is_stopped = False # Move through each waypoint in order, honoring cancellation between them. + # A real driver is expected to honor the velocity/acceleration ceilings in + # `options` (e.g. options.max_vel_degs_per_sec); this example ignores them + # and just sleeps for a fixed interval between waypoints. for position in positions: await asyncio.sleep(1) diff --git a/tests/test_robot.py b/tests/test_robot.py index 28f157a16a..5acd8a3382 100644 --- a/tests/test_robot.py +++ b/tests/test_robot.py @@ -505,7 +505,7 @@ async def move_through_joint_positions( extra: Optional[Dict[str, Any]] = None, timeout: Optional[float] = None, ): - return await self.actual_client.move_through_joint_positions(positions, options, extra=extra, timeout=timeout) + return await self.actual_client.move_through_joint_positions(positions, options=options, extra=extra, timeout=timeout) async def get_3d_models( self, From 9ec2f6c865ed1e5b56f83f4ea27f4c8d430a1d34 Mon Sep 17 00:00:00 2001 From: HipsterBrown Date: Wed, 29 Jul 2026 09:46:25 -0400 Subject: [PATCH 4/8] feat(arm): add move_through_joint_positions across interface, service, and client Declares the method as abstract on the Arm ABC and implements it in ArmRPCService and ArmClient in the same change, since ArmClient is a seventh Arm subclass (beyond the six covered by the prior mock/example commit) and would otherwise fail to instantiate once the ABC method is abstract. The service guards on MoveOptions field presence so "no limit requested" (None) is never conflated with a zeroed MoveOptions, which a driver could misread as "do not move". --- src/viam/components/arm/__init__.py | 3 +- src/viam/components/arm/arm.py | 46 ++++++++++++++++++++- src/viam/components/arm/client.py | 16 ++++++++ src/viam/components/arm/service.py | 21 ++++++++++ tests/test_arm.py | 62 +++++++++++++++++++++++++++++ 5 files changed, 145 insertions(+), 3 deletions(-) diff --git a/src/viam/components/arm/__init__.py b/src/viam/components/arm/__init__.py index fcc9ce871a..b775f54d1e 100644 --- a/src/viam/components/arm/__init__.py +++ b/src/viam/components/arm/__init__.py @@ -1,6 +1,6 @@ from viam.components import KinematicsReturn from viam.proto.common import KinematicsFileFormat, Pose -from viam.proto.component.arm import JointPositions +from viam.proto.component.arm import JointPositions, MoveOptions from viam.resource.registry import Registry, ResourceRegistration from .arm import Arm @@ -12,6 +12,7 @@ "JointPositions", "KinematicsFileFormat", "KinematicsReturn", + "MoveOptions", "Pose", ] diff --git a/src/viam/components/arm/arm.py b/src/viam/components/arm/arm.py index b3f65595f7..97bcc537c9 100644 --- a/src/viam/components/arm/arm.py +++ b/src/viam/components/arm/arm.py @@ -1,11 +1,11 @@ import abc -from typing import Any, Dict, Final, Optional +from typing import Any, Dict, Final, List, Optional from viam.components import KinematicsReturn from viam.components.component_base import ComponentBase from viam.resource.types import API, RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT -from . import JointPositions, Pose +from . import JointPositions, MoveOptions, Pose class Arm(ComponentBase): @@ -149,6 +149,48 @@ async def get_joint_positions( """ ... + @abc.abstractmethod + async def move_through_joint_positions( + self, + positions: List[JointPositions], + options: Optional[MoveOptions] = None, + *, + extra: Optional[Dict[str, Any]] = None, + timeout: Optional[float] = None, + **kwargs, + ): + """ + Move the arm through the given joint positions in the order they are specified, + obeying the velocity and acceleration limits in ``options``. + + :: + + my_arm = Arm.from_robot(robot=machine, name="my_arm") + + # Move through two waypoints, capping joint speed and acceleration. + await my_arm.move_through_joint_positions( + positions=[ + JointPositions(values=[0, 45, 0, 0, 0, 0]), + JointPositions(values=[0, 0, 0, 0, 0, 0]), + ], + options=MoveOptions(max_vel_degs_per_sec=15.0, max_acc_degs_per_sec2=30.0), + ) + + Args: + positions (List[JointPositions]): The waypoints to move through, in order. + options (Optional[MoveOptions]): Optional kinematic ceilings obeyed at every + point along the trajectory. ``None`` means no limits are requested. + + Note: + Unlike the Go SDK, this method does not validate the requested positions + against the arm's joint limits before sending them, because the Python SDK + cannot yet parse a kinematics model. Implementations are responsible for + their own limit checking. + + For more information, see `Arm component `_. + """ + ... + @abc.abstractmethod async def stop( self, diff --git a/src/viam/components/arm/client.py b/src/viam/components/arm/client.py index 7113fa269e..d2eb2ed446 100644 --- a/src/viam/components/arm/client.py +++ b/src/viam/components/arm/client.py @@ -21,6 +21,8 @@ IsMovingRequest, IsMovingResponse, JointPositions, + MoveOptions, + MoveThroughJointPositionsRequest, MoveToJointPositionsRequest, MoveToPositionRequest, StopRequest, @@ -91,6 +93,20 @@ async def move_to_joint_positions( request = MoveToJointPositionsRequest(name=self.name, positions=positions, extra=dict_to_struct(extra)) await self.client.MoveToJointPositions(request, timeout=timeout, metadata=md) + async def move_through_joint_positions( + self, + positions: List[JointPositions], + options: Optional[MoveOptions] = None, + *, + extra: Optional[Dict[str, Any]] = None, + timeout: Optional[float] = None, + **kwargs, + ): + md = kwargs.get("metadata", self.Metadata()).proto + # Passing options=None leaves the optional field genuinely unset. + request = MoveThroughJointPositionsRequest(name=self.name, positions=positions, options=options, extra=dict_to_struct(extra)) + await self.client.MoveThroughJointPositions(request, timeout=timeout, metadata=md) + async def stop( self, *, diff --git a/src/viam/components/arm/service.py b/src/viam/components/arm/service.py index f7bba88dde..5a68fe86e6 100644 --- a/src/viam/components/arm/service.py +++ b/src/viam/components/arm/service.py @@ -17,6 +17,8 @@ GetJointPositionsResponse, IsMovingRequest, IsMovingResponse, + MoveThroughJointPositionsRequest, + MoveThroughJointPositionsResponse, MoveToJointPositionsRequest, MoveToJointPositionsResponse, MoveToPositionRequest, @@ -78,6 +80,25 @@ async def MoveToJointPositions(self, stream: Stream[MoveToJointPositionsRequest, response = MoveToJointPositionsResponse() await stream.send_message(response) + async def MoveThroughJointPositions(self, stream: Stream[MoveThroughJointPositionsRequest, MoveThroughJointPositionsResponse]) -> None: + request = await stream.recv_message() + assert request is not None + name = request.name + arm = self.get_resource(name) + timeout = stream.deadline.time_remaining() if stream.deadline else None + # `options` has explicit presence; passing a zeroed message when the caller sent + # nothing would be indistinguishable from a real zero limit. + options = request.options if request.HasField("options") else None + await arm.move_through_joint_positions( + list(request.positions), + options, + extra=struct_to_dict(request.extra), + timeout=timeout, + metadata=stream.metadata, + ) + response = MoveThroughJointPositionsResponse() + await stream.send_message(response) + async def Stop(self, stream: Stream[StopRequest, StopResponse]) -> None: request = await stream.recv_message() assert request is not None diff --git a/tests/test_arm.py b/tests/test_arm.py index 1100f7d4f3..ba6bd63e69 100644 --- a/tests/test_arm.py +++ b/tests/test_arm.py @@ -22,6 +22,8 @@ IsMovingRequest, IsMovingResponse, JointPositions, + MoveOptions, + MoveThroughJointPositionsRequest, MoveToJointPositionsRequest, MoveToPositionRequest, StopRequest, @@ -55,6 +57,14 @@ async def test_get_joint_positions(self): jp = await self.arm.get_joint_positions() assert jp == self.joint_pos + async def test_move_through_joint_positions(self): + waypoints = [JointPositions(values=[1, 2, 3]), JointPositions(values=[4, 5, 6])] + options = MoveOptions(max_vel_degs_per_sec=15.0, max_acc_degs_per_sec2=30.0) + await self.arm.move_through_joint_positions(waypoints, options) + assert self.arm.waypoints == waypoints + assert self.arm.move_options == options + assert self.arm.joint_positions == waypoints[-1] + async def test_stop(self): assert self.arm.is_stopped is False await self.arm.stop() @@ -128,6 +138,40 @@ async def test_get_joint_positions(self): response: GetJointPositionsResponse = await client.GetJointPositions(request) assert response.positions == self.joint_pos + async def test_move_through_joint_positions(self): + async with ChannelFor([self.service]) as channel: + client = ArmServiceStub(channel) + waypoints = [JointPositions(values=[1, 2, 3]), JointPositions(values=[4, 5, 6])] + options = MoveOptions( + max_vel_degs_per_sec=15.0, + max_acc_degs_per_sec2=30.0, + max_vel_degs_per_sec_joints=[1.0, 2.0, 3.0], + max_acc_degs_per_sec2_joints=[4.0, 5.0, 6.0], + max_tcp_speed=0.25, + ) + request = MoveThroughJointPositionsRequest(name=self.name, positions=waypoints, options=options) + await client.MoveThroughJointPositions(request) + assert self.arm.waypoints == waypoints + assert self.arm.move_options == options + + async def test_move_through_joint_positions_without_options(self): + async with ChannelFor([self.service]) as channel: + client = ArmServiceStub(channel) + waypoints = [JointPositions(values=[7, 8, 9])] + request = MoveThroughJointPositionsRequest(name=self.name, positions=waypoints) + await client.MoveThroughJointPositions(request) + assert self.arm.waypoints == waypoints + # Must be None, NOT a zeroed MoveOptions: a driver reading + # max_vel_degs_per_sec == 0.0 could interpret that as "do not move". + assert self.arm.move_options is None + + async def test_move_through_joint_positions_empty(self): + async with ChannelFor([self.service]) as channel: + client = ArmServiceStub(channel) + request = MoveThroughJointPositionsRequest(name=self.name, positions=[]) + await client.MoveThroughJointPositions(request) + assert self.arm.waypoints == [] + async def test_stop(self): async with ChannelFor([self.service]) as channel: assert self.arm.is_stopped is False @@ -221,6 +265,24 @@ async def test_get_joint_positions(self): jp = await client.get_joint_positions() assert jp == self.joint_pos + async def test_move_through_joint_positions(self): + async with ChannelFor([self.service]) as channel: + client = ArmClient(self.name, channel) + waypoints = [JointPositions(values=[1, 2, 3]), JointPositions(values=[4, 5, 6])] + options = MoveOptions(max_vel_degs_per_sec=15.0, max_tcp_speed=0.25) + await client.move_through_joint_positions(waypoints, options, extra={"foo": "bar"}) + assert self.arm.waypoints == waypoints + assert self.arm.move_options == options + assert self.arm.extra == {"foo": "bar"} + + async def test_move_through_joint_positions_without_options(self): + async with ChannelFor([self.service]) as channel: + client = ArmClient(self.name, channel) + waypoints = [JointPositions(values=[7, 8, 9])] + await client.move_through_joint_positions(waypoints) + assert self.arm.waypoints == waypoints + assert self.arm.move_options is None + async def test_stop(self): async with ChannelFor([self.service]) as channel: assert self.arm.is_stopped is False From d2d766d0b6732343e71c04031c390c4988347fc0 Mon Sep 17 00:00:00 2001 From: HipsterBrown Date: Wed, 29 Jul 2026 10:01:12 -0400 Subject: [PATCH 5/8] fix(arm): pass options by keyword and document MoveOptions field-presence Address code review on move_through_joint_positions: - ArmRPCService now calls the resource's move_through_joint_positions with options=options (keyword) instead of positionally, so drivers that reasonably declare it keyword-only don't blow up at runtime. - Extend the ABC's Note to cover the same 0.0-vs-unset ambiguity one level deeper: every scalar on MoveOptions has its own explicit presence, so reading e.g. max_vel_degs_per_sec without a HasField check silently reads "unset" as "stop". Also document the proto's precedence rule (per-joint limits override the scalar ceiling) and that an empty positions list must be handled by implementations. - Update the two example drivers' comments to point at HasField instead of naming the scalar directly, so they don't teach the wrong pattern. - Add the MoveOptions import hint to the Arm class docstring, and move the ABC's move_through_joint_positions to sit after move_to_joint_positions, matching the order already used in client.py, service.py, and MockArm. - Cover the keyword form (options=..., timeout=...) in TestClient, moving the new timeout assertion onto the test that runs first so the timeout-is-None invariant TestClient.test_stop relies on still holds. --- docs/examples/my_cool_arm.py | 4 +- examples/complex_module/src/arm/my_arm.py | 5 +- src/viam/components/arm/arm.py | 73 ++++++++++++++--------- src/viam/components/arm/service.py | 2 +- tests/test_arm.py | 3 +- 5 files changed, 53 insertions(+), 34 deletions(-) diff --git a/docs/examples/my_cool_arm.py b/docs/examples/my_cool_arm.py index 50ffbd41d6..0057251fea 100644 --- a/docs/examples/my_cool_arm.py +++ b/docs/examples/my_cool_arm.py @@ -105,8 +105,8 @@ async def move_through_joint_positions( self.is_stopped = False # Move through each waypoint in order, honoring cancellation between them. - # A real driver would clamp its motion to options.max_vel_degs_per_sec and - # options.max_acc_degs_per_sec2 here; this example moves at a fixed rate. + # A real driver would check options.HasField("max_vel_degs_per_sec") etc. and + # clamp its motion accordingly; this example moves at a fixed rate. for position in positions: await asyncio.sleep(1) diff --git a/examples/complex_module/src/arm/my_arm.py b/examples/complex_module/src/arm/my_arm.py index f46fe8bb86..ee9a5d28c4 100644 --- a/examples/complex_module/src/arm/my_arm.py +++ b/examples/complex_module/src/arm/my_arm.py @@ -108,8 +108,9 @@ async def move_through_joint_positions( # Move through each waypoint in order, honoring cancellation between them. # A real driver is expected to honor the velocity/acceleration ceilings in - # `options` (e.g. options.max_vel_degs_per_sec); this example ignores them - # and just sleeps for a fixed interval between waypoints. + # `options`, checking e.g. options.HasField("max_vel_degs_per_sec") before + # applying it (an unset field reads as 0.0); this example ignores them and + # just sleeps for a fixed interval between waypoints. for position in positions: await asyncio.sleep(1) diff --git a/src/viam/components/arm/arm.py b/src/viam/components/arm/arm.py index 97bcc537c9..56859512ef 100644 --- a/src/viam/components/arm/arm.py +++ b/src/viam/components/arm/arm.py @@ -21,8 +21,10 @@ class Arm(ComponentBase): from viam.components.arm import Arm # To use move_to_position: from viam.proto.common import Pose - # To use move_to_joint_positions: + # To use move_to_joint_positions and move_through_joint_positions: from viam.proto.component.arm import JointPositions + # To use move_through_joint_positions: + from viam.components.arm import MoveOptions For more information, see `Arm component `_. """ @@ -122,33 +124,6 @@ async def move_to_joint_positions( """ ... - @abc.abstractmethod - async def get_joint_positions( - self, - *, - extra: Optional[Dict[str, Any]] = None, - timeout: Optional[float] = None, - **kwargs, - ) -> JointPositions: - """ - Get the JointPositions representing the current position of the arm. - - :: - - my_arm = Arm.from_robot(robot=machine, name="my_arm") - - # Get the current position of each joint on the arm as JointPositions. - pos = await my_arm.get_joint_positions() - - Returns: - JointPositions: The current ``JointPositions`` for the arm. - ``JointPositions`` can have one attribute, ``values``, a list of joint positions with rotational values (degrees) - and translational values (mm). - - For more information, see `Arm component `_. - """ - ... - @abc.abstractmethod async def move_through_joint_positions( self, @@ -187,10 +162,52 @@ async def move_through_joint_positions( cannot yet parse a kinematics model. Implementations are responsible for their own limit checking. + Every scalar field on ``MoveOptions`` (``max_vel_degs_per_sec``, + ``max_acc_degs_per_sec2``, ``max_tcp_speed``) also has explicit presence: an + unset field reads back as ``0.0``, indistinguishable from an explicitly-set + zero. Implementations must check ``options.HasField("max_vel_degs_per_sec")`` + (and likewise for the other scalar fields) before applying it as a ceiling — + reading an unset field's ``0.0`` directly would misread "no limit requested" + as "do not move". Per the proto definition, ``max_vel_degs_per_sec`` is + ignored whenever ``max_vel_degs_per_sec_joints`` is set, and likewise + ``max_acc_degs_per_sec2`` is ignored whenever ``max_acc_degs_per_sec2_joints`` + is set; implementations should honor only the per-joint limit in that case, + not both. + + An empty ``positions`` list is passed through to the implementation + unchanged; implementations must handle it, typically as a no-op. + For more information, see `Arm component `_. """ ... + @abc.abstractmethod + async def get_joint_positions( + self, + *, + extra: Optional[Dict[str, Any]] = None, + timeout: Optional[float] = None, + **kwargs, + ) -> JointPositions: + """ + Get the JointPositions representing the current position of the arm. + + :: + + my_arm = Arm.from_robot(robot=machine, name="my_arm") + + # Get the current position of each joint on the arm as JointPositions. + pos = await my_arm.get_joint_positions() + + Returns: + JointPositions: The current ``JointPositions`` for the arm. + ``JointPositions`` can have one attribute, ``values``, a list of joint positions with rotational values (degrees) + and translational values (mm). + + For more information, see `Arm component `_. + """ + ... + @abc.abstractmethod async def stop( self, diff --git a/src/viam/components/arm/service.py b/src/viam/components/arm/service.py index 5a68fe86e6..f79400ed79 100644 --- a/src/viam/components/arm/service.py +++ b/src/viam/components/arm/service.py @@ -91,7 +91,7 @@ async def MoveThroughJointPositions(self, stream: Stream[MoveThroughJointPositio options = request.options if request.HasField("options") else None await arm.move_through_joint_positions( list(request.positions), - options, + options=options, extra=struct_to_dict(request.extra), timeout=timeout, metadata=stream.metadata, diff --git a/tests/test_arm.py b/tests/test_arm.py index ba6bd63e69..ec45b02716 100644 --- a/tests/test_arm.py +++ b/tests/test_arm.py @@ -270,10 +270,11 @@ async def test_move_through_joint_positions(self): client = ArmClient(self.name, channel) waypoints = [JointPositions(values=[1, 2, 3]), JointPositions(values=[4, 5, 6])] options = MoveOptions(max_vel_degs_per_sec=15.0, max_tcp_speed=0.25) - await client.move_through_joint_positions(waypoints, options, extra={"foo": "bar"}) + await client.move_through_joint_positions(waypoints, options=options, extra={"foo": "bar"}, timeout=1.23) assert self.arm.waypoints == waypoints assert self.arm.move_options == options assert self.arm.extra == {"foo": "bar"} + assert self.arm.timeout == expected_grpc_timeout(1.23) async def test_move_through_joint_positions_without_options(self): async with ChannelFor([self.service]) as channel: From ce9ef0faf3a718c53a8ab1bbc8135c769afb5f45 Mon Sep 17 00:00:00 2001 From: HipsterBrown Date: Wed, 29 Jul 2026 10:06:39 -0400 Subject: [PATCH 6/8] feat(arm): add get_3d_models across interface, service, and client --- src/viam/components/arm/__init__.py | 3 ++- src/viam/components/arm/arm.py | 32 +++++++++++++++++++++++-- src/viam/components/arm/client.py | 11 +++++++++ src/viam/components/arm/service.py | 11 +++++++++ tests/test_arm.py | 36 ++++++++++++++++++++++++++++- 5 files changed, 89 insertions(+), 4 deletions(-) diff --git a/src/viam/components/arm/__init__.py b/src/viam/components/arm/__init__.py index b775f54d1e..ffad555cb6 100644 --- a/src/viam/components/arm/__init__.py +++ b/src/viam/components/arm/__init__.py @@ -1,5 +1,5 @@ from viam.components import KinematicsReturn -from viam.proto.common import KinematicsFileFormat, Pose +from viam.proto.common import KinematicsFileFormat, Mesh, Pose from viam.proto.component.arm import JointPositions, MoveOptions from viam.resource.registry import Registry, ResourceRegistration @@ -12,6 +12,7 @@ "JointPositions", "KinematicsFileFormat", "KinematicsReturn", + "Mesh", "MoveOptions", "Pose", ] diff --git a/src/viam/components/arm/arm.py b/src/viam/components/arm/arm.py index 56859512ef..b6c05eb1aa 100644 --- a/src/viam/components/arm/arm.py +++ b/src/viam/components/arm/arm.py @@ -1,11 +1,11 @@ import abc -from typing import Any, Dict, Final, List, Optional +from typing import Any, Dict, Final, List, Mapping, Optional from viam.components import KinematicsReturn from viam.components.component_base import ComponentBase from viam.resource.types import API, RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT -from . import JointPositions, MoveOptions, Pose +from . import JointPositions, Mesh, MoveOptions, Pose class Arm(ComponentBase): @@ -25,6 +25,8 @@ class Arm(ComponentBase): from viam.proto.component.arm import JointPositions # To use move_through_joint_positions: from viam.components.arm import MoveOptions + # To use get_3d_models: + from viam.components.arm import Mesh For more information, see `Arm component `_. """ @@ -282,3 +284,29 @@ async def get_kinematics( For more information, see `Arm component `_. """ ... + + @abc.abstractmethod + async def get_3d_models( + self, *, extra: Optional[Dict[str, Any]] = None, timeout: Optional[float] = None, **kwargs + ) -> Mapping[str, Mesh]: + """ + Get the 3D models associated with the arm, keyed by name. + + :: + + my_arm = Arm.from_robot(robot=machine, name="my_arm") + + # Get the arm's 3D models. + models = await my_arm.get_3d_models() + + for name, mesh in models.items(): + print(name, mesh.content_type, len(mesh.mesh)) + + Returns: + Mapping[str, Mesh]: The arm's 3D models keyed by name. Each ``Mesh`` carries a + ``content_type`` (for example ``"ply"``) and the raw ``mesh`` bytes in that format. + An arm with no models returns an empty mapping. + + For more information, see `Arm component `_. + """ + ... diff --git a/src/viam/components/arm/client.py b/src/viam/components/arm/client.py index d2eb2ed446..822dc6394c 100644 --- a/src/viam/components/arm/client.py +++ b/src/viam/components/arm/client.py @@ -7,10 +7,13 @@ DoCommandRequest, DoCommandResponse, Geometry, + Get3DModelsRequest, + Get3DModelsResponse, GetKinematicsRequest, GetKinematicsResponse, GetStatusRequest, GetStatusResponse, + Mesh, ) from viam.proto.component.arm import ( ArmServiceStub, @@ -155,6 +158,14 @@ async def get_kinematics( response: GetKinematicsResponse = await self.client.GetKinematics(request, timeout=timeout, metadata=md) return (response.format, response.kinematics_data, response.meshes_by_urdf_filepath) + async def get_3d_models( + self, *, extra: Optional[Dict[str, Any]] = None, timeout: Optional[float] = None, **kwargs + ) -> Mapping[str, Mesh]: + md = kwargs.get("metadata", self.Metadata()).proto + request = Get3DModelsRequest(name=self.name, extra=dict_to_struct(extra)) + response: Get3DModelsResponse = await self.client.Get3DModels(request, timeout=timeout, metadata=md) + return response.models + async def get_geometries(self, *, extra: Optional[Dict[str, Any]] = None, timeout: Optional[float] = None, **kwargs) -> List[Geometry]: md = kwargs.get("metadata", self.Metadata()) return await get_geometries(self.client, self.name, extra, timeout, md) diff --git a/src/viam/components/arm/service.py b/src/viam/components/arm/service.py index f79400ed79..dd2aa087eb 100644 --- a/src/viam/components/arm/service.py +++ b/src/viam/components/arm/service.py @@ -3,6 +3,8 @@ from viam.proto.common import ( DoCommandRequest, DoCommandResponse, + Get3DModelsRequest, + Get3DModelsResponse, GetGeometriesRequest, GetGeometriesResponse, GetKinematicsRequest, @@ -158,3 +160,12 @@ async def GetGeometries(self, stream: Stream[GetGeometriesRequest, GetGeometries geometries = await arm.get_geometries(extra=struct_to_dict(request.extra), timeout=timeout) response = GetGeometriesResponse(geometries=geometries) await stream.send_message(response) + + async def Get3DModels(self, stream: Stream[Get3DModelsRequest, Get3DModelsResponse]) -> None: + request = await stream.recv_message() + assert request is not None + arm = self.get_resource(request.name) + timeout = stream.deadline.time_remaining() if stream.deadline else None + models = await arm.get_3d_models(extra=struct_to_dict(request.extra), timeout=timeout, metadata=stream.metadata) + response = Get3DModelsResponse(models=models) + await stream.send_message(response) diff --git a/tests/test_arm.py b/tests/test_arm.py index ec45b02716..89716f6275 100644 --- a/tests/test_arm.py +++ b/tests/test_arm.py @@ -5,6 +5,8 @@ from viam.proto.common import ( DoCommandRequest, DoCommandResponse, + Get3DModelsRequest, + Get3DModelsResponse, GetGeometriesRequest, GetGeometriesResponse, GetKinematicsRequest, @@ -32,7 +34,7 @@ from viam.utils import dict_to_struct, struct_to_dict from . import expected_grpc_timeout -from .mocks.components import GEOMETRIES, MockArm +from .mocks.components import GEOMETRIES, MODELS_3D, MockArm class TestArm: @@ -85,6 +87,11 @@ async def test_get_geometries(self): geometries = await self.arm.get_geometries() assert geometries == GEOMETRIES + async def test_get_3d_models(self): + models = await self.arm.get_3d_models(extra={"1": "2"}) + assert models == MODELS_3D + assert self.arm.extra == {"1": "2"} + async def test_do(self): command = {"command": "args"} resp = await self.arm.do_command(command) @@ -221,6 +228,26 @@ async def test_get_geometries(self): response: GetGeometriesResponse = await client.GetGeometries(request) assert [geometry for geometry in response.geometries] == GEOMETRIES + async def test_get_3d_models(self): + async with ChannelFor([self.service]) as channel: + client = ArmServiceStub(channel) + request = Get3DModelsRequest(name=self.name) + response: Get3DModelsResponse = await client.Get3DModels(request) + assert dict(response.models) == MODELS_3D + assert response.models["base_link"].content_type == "ply" + assert response.models["base_link"].mesh == b"\x00\x01" + + async def test_get_3d_models_empty(self): + async with ChannelFor([self.service]) as channel: + self.arm.models_3d = {} + try: + client = ArmServiceStub(channel) + request = Get3DModelsRequest(name=self.name) + response: Get3DModelsResponse = await client.Get3DModels(request) + assert dict(response.models) == {} + finally: + self.arm.models_3d = MODELS_3D + async def test_extra(self): async with ChannelFor([self.service]) as channel: client = ArmServiceStub(channel) @@ -313,6 +340,13 @@ async def test_get_geometries(self): geometries = await client.get_geometries() assert geometries == GEOMETRIES + async def test_get_3d_models(self): + async with ChannelFor([self.service]) as channel: + client = ArmClient(self.name, channel) + models = await client.get_3d_models(extra={"1": "2"}) + assert dict(models) == MODELS_3D + assert self.arm.extra == {"1": "2"} + async def test_do(self): async with ChannelFor([self.service]) as channel: client = ArmClient(self.name, channel) From adcc687201ba87706d4075228230d0f3e220859c Mon Sep 17 00:00:00 2001 From: HipsterBrown Date: Wed, 29 Jul 2026 10:21:56 -0400 Subject: [PATCH 7/8] fix(arm): fix get_3d_models Mapping contract and docstring/ordering nits Address code review on get_3d_models: - ArmClient.get_3d_models now copies the protobuf map response into a plain dict before returning it. Protobuf map containers create and insert a default-constructed value on __getitem__ for an absent key instead of raising KeyError, silently violating the Mapping[str, Mesh] contract and corrupting subsequent len()/iteration on the caller's reference. get_kinematics has the same wart on its third element but is left alone as pre-existing and out of scope. - Cross-reference the get_3d_models and get_kinematics docstrings so readers of either know the two are keyed differently (by model name vs. by URDF filepath) and aren't the same data. - Reword "an arm with no models returns an empty mapping" as an implementer obligation ("must return an empty mapping, not None"), matching the Note: style used in move_through_joint_positions. - Unify the Arm class docstring's import guidance to the package re-export form for all four types (Pose, JointPositions, MoveOptions, Mesh), since all four are in __all__. - Soften docs/examples/my_cool_arm.py's comment from "keyed by link name" to "keyed by name" to match the ABC and avoid over-claiming beyond what the proto documents. - Move ArmRPCService.Get3DModels to sit between GetKinematics and GetGeometries, matching ArmClient's method ordering. - Tighten TestClient.test_get_3d_models to assert equality against the live Mapping (not a dict() copy, which would pass either way) and add a KeyError assertion plus a timeout assertion. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_015RbNNgUjePEdPuUGAdU3qb --- docs/examples/my_cool_arm.py | 2 +- src/viam/components/arm/arm.py | 11 ++++++++--- src/viam/components/arm/client.py | 5 ++++- src/viam/components/arm/service.py | 12 ++++++------ tests/test_arm.py | 8 ++++++-- 5 files changed, 25 insertions(+), 13 deletions(-) diff --git a/docs/examples/my_cool_arm.py b/docs/examples/my_cool_arm.py index 0057251fea..b944859924 100644 --- a/docs/examples/my_cool_arm.py +++ b/docs/examples/my_cool_arm.py @@ -119,7 +119,7 @@ async def move_through_joint_positions( self.is_stopped = True async def get_3d_models(self, extra: Optional[Dict[str, Any]] = None, **kwargs) -> Mapping[str, Mesh]: - # Return the 3D meshes for this arm, keyed by link name. This arm has none. + # Return the 3D meshes for this arm, keyed by name. This arm has none. return {} async def stop(self, extra: Optional[Dict[str, Any]] = None, **kwargs): diff --git a/src/viam/components/arm/arm.py b/src/viam/components/arm/arm.py index b6c05eb1aa..501c16c7c2 100644 --- a/src/viam/components/arm/arm.py +++ b/src/viam/components/arm/arm.py @@ -20,9 +20,9 @@ class Arm(ComponentBase): from viam.components.arm import Arm # To use move_to_position: - from viam.proto.common import Pose + from viam.components.arm import Pose # To use move_to_joint_positions and move_through_joint_positions: - from viam.proto.component.arm import JointPositions + from viam.components.arm import JointPositions # To use move_through_joint_positions: from viam.components.arm import MoveOptions # To use get_3d_models: @@ -280,6 +280,7 @@ async def get_kinematics( Viam's kinematic parameter format (spatial vector algebra) (``KinematicsFileFormat.KINEMATICS_FILE_FORMAT_SVA``), and the second [1] value represents the byte contents of the file. If available, a third [2] value provides meshes keyed by URDF filepath. + See ``get_3d_models`` for meshes keyed by model name instead. For more information, see `Arm component `_. """ @@ -305,7 +306,11 @@ async def get_3d_models( Returns: Mapping[str, Mesh]: The arm's 3D models keyed by name. Each ``Mesh`` carries a ``content_type`` (for example ``"ply"``) and the raw ``mesh`` bytes in that format. - An arm with no models returns an empty mapping. + This is distinct from ``get_kinematics``'s third return value, which keys meshes + by URDF filepath rather than by model name. + + Note: + Implementations with no models must return an empty mapping, not ``None``. For more information, see `Arm component `_. """ diff --git a/src/viam/components/arm/client.py b/src/viam/components/arm/client.py index 822dc6394c..a74f2195f6 100644 --- a/src/viam/components/arm/client.py +++ b/src/viam/components/arm/client.py @@ -164,7 +164,10 @@ async def get_3d_models( md = kwargs.get("metadata", self.Metadata()).proto request = Get3DModelsRequest(name=self.name, extra=dict_to_struct(extra)) response: Get3DModelsResponse = await self.client.Get3DModels(request, timeout=timeout, metadata=md) - return response.models + # Copy out of the protobuf map container: `__getitem__` on an absent key would + # otherwise create and insert a default-constructed value instead of raising + # KeyError, silently violating the Mapping contract. + return dict(response.models) async def get_geometries(self, *, extra: Optional[Dict[str, Any]] = None, timeout: Optional[float] = None, **kwargs) -> List[Geometry]: md = kwargs.get("metadata", self.Metadata()) diff --git a/src/viam/components/arm/service.py b/src/viam/components/arm/service.py index dd2aa087eb..8b4884eb6d 100644 --- a/src/viam/components/arm/service.py +++ b/src/viam/components/arm/service.py @@ -152,20 +152,20 @@ async def GetKinematics(self, stream: Stream[GetKinematicsRequest, GetKinematics response = GetKinematicsResponse(format=format, kinematics_data=kinematics_data, meshes_by_urdf_filepath=meshes) await stream.send_message(response) - async def GetGeometries(self, stream: Stream[GetGeometriesRequest, GetGeometriesResponse]) -> None: + async def Get3DModels(self, stream: Stream[Get3DModelsRequest, Get3DModelsResponse]) -> None: request = await stream.recv_message() assert request is not None arm = self.get_resource(request.name) timeout = stream.deadline.time_remaining() if stream.deadline else None - geometries = await arm.get_geometries(extra=struct_to_dict(request.extra), timeout=timeout) - response = GetGeometriesResponse(geometries=geometries) + models = await arm.get_3d_models(extra=struct_to_dict(request.extra), timeout=timeout, metadata=stream.metadata) + response = Get3DModelsResponse(models=models) await stream.send_message(response) - async def Get3DModels(self, stream: Stream[Get3DModelsRequest, Get3DModelsResponse]) -> None: + async def GetGeometries(self, stream: Stream[GetGeometriesRequest, GetGeometriesResponse]) -> None: request = await stream.recv_message() assert request is not None arm = self.get_resource(request.name) timeout = stream.deadline.time_remaining() if stream.deadline else None - models = await arm.get_3d_models(extra=struct_to_dict(request.extra), timeout=timeout, metadata=stream.metadata) - response = Get3DModelsResponse(models=models) + geometries = await arm.get_geometries(extra=struct_to_dict(request.extra), timeout=timeout) + response = GetGeometriesResponse(geometries=geometries) await stream.send_message(response) diff --git a/tests/test_arm.py b/tests/test_arm.py index 89716f6275..b451554ca7 100644 --- a/tests/test_arm.py +++ b/tests/test_arm.py @@ -1,3 +1,4 @@ +import pytest from grpclib.testing import ChannelFor from viam.components.arm import ArmClient, KinematicsFileFormat @@ -343,9 +344,12 @@ async def test_get_geometries(self): async def test_get_3d_models(self): async with ChannelFor([self.service]) as channel: client = ArmClient(self.name, channel) - models = await client.get_3d_models(extra={"1": "2"}) - assert dict(models) == MODELS_3D + models = await client.get_3d_models(extra={"1": "2"}, timeout=1.23) + assert models == MODELS_3D + with pytest.raises(KeyError): + models["does_not_exist"] assert self.arm.extra == {"1": "2"} + assert self.arm.timeout == expected_grpc_timeout(1.23) async def test_do(self): async with ChannelFor([self.service]) as channel: From 355208995326bf25b33a9713071728f0b0153819 Mon Sep 17 00:00:00 2001 From: HipsterBrown Date: Wed, 19 Aug 2026 10:19:53 -0400 Subject: [PATCH 8/8] doc: add TODO comment for followup to get_kinematics empty mesh issue in arm client --- src/viam/components/arm/client.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/viam/components/arm/client.py b/src/viam/components/arm/client.py index a74f2195f6..a602d6bdaf 100644 --- a/src/viam/components/arm/client.py +++ b/src/viam/components/arm/client.py @@ -156,6 +156,7 @@ async def get_kinematics( md = kwargs.get("metadata", self.Metadata()).proto request = GetKinematicsRequest(name=self.name, extra=dict_to_struct(extra)) response: GetKinematicsResponse = await self.client.GetKinematics(request, timeout=timeout, metadata=md) + # TODO: handle empty meshes in the response to prevent silent mapping return (response.format, response.kinematics_data, response.meshes_by_urdf_filepath) async def get_3d_models(