11import abc
2- from typing import Any , Dict , Final , List , Optional , Tuple , Mapping
2+ from typing import Any , Dict , Final , List , Optional , Tuple , Mapping , Union
33
44from viam .components .arm import KinematicsFileFormat
55from viam .resource .types import API , RESOURCE_NAMESPACE_RDK , RESOURCE_TYPE_COMPONENT
66from viam .proto .common import Mesh
77
88from ..component_base import ComponentBase
99
10+ KinematicsReturn = Union [
11+ Tuple [KinematicsFileFormat .ValueType , bytes ],
12+ Tuple [KinematicsFileFormat .ValueType , bytes , Mapping [str , Mesh ]],
13+ ]
14+
1015
1116class Gantry (ComponentBase ):
1217 """
@@ -160,7 +165,7 @@ async def is_moving(self) -> bool:
160165 @abc .abstractmethod
161166 async def get_kinematics (
162167 self , * , extra : Optional [Dict [str , Any ]] = None , timeout : Optional [float ] = None , ** kwargs
163- ) -> Tuple [ KinematicsFileFormat . ValueType , bytes , Mapping [ str , Mesh ]] :
168+ ) -> KinematicsReturn :
164169 """
165170 Get the kinematics information associated with the gantry.
166171
@@ -182,6 +187,7 @@ async def get_kinematics(
182187 file, either in URDF format (``KinematicsFileFormat.KINEMATICS_FILE_FORMAT_URDF``) or
183188 Viam's kinematic parameter format (spatial vector algebra) (``KinematicsFileFormat.KINEMATICS_FILE_FORMAT_SVA``),
184189 and the second [1] value represents the byte contents of the file.
190+ If available, a third [2] value provides meshes keyed by URDF filepath.
185191
186192 For more information, see `Arm component <https://docs.viam.com/dev/reference/apis/components/arm/#getkinematics>`_.
187193 """
0 commit comments