Arm API | Component APIs
Arm API
The arm API allows you to give commands to your arm components for linear motion planning with self-collision prevention. If you want the arm to avoid obstacles, or you want to plan complex motion in an automated way, use the motion API.
The arm component supports the following methods:
| Method Name | Description |
|---|---|
GetEndPosition |
Get the current position of the arm as a pose. |
MoveToPosition |
Move the end of the arm in a straight line to the desired pose, relative to the base of the arm. |
MoveToJointPositions |
Move each joint on the arm to the position specified in positions. |
MoveThroughJointPositions |
Move the arm’s joints through the given positions in the order they are specified. |
GetJointPositions |
Get the current position of each joint on the arm. |
Get3DModels |
Get the 3D models of the arm. |
GetKinematics |
Get the kinematics information associated with the arm as the format and byte contents of the kinematics file. |
IsMoving |
Get if the arm is currently moving. |
Stop |
Stop all motion of the arm. |
GetGeometries |
Get all the geometries associated with the arm in its current configuration, in the frame of the arm. |
Reconfigure |
Reconfigure this resource. |
DoCommand |
Execute model-specific commands that are not otherwise defined by the component API. |
GetResourceName |
Get the ResourceName for this arm. |
Close |
Safely shut down the resource and prevent further use. |
API
GetEndPosition
Get the current position of the arm as a pose.
Parameters:
extra(Mapping[ str, Any]) (optional): Extra options to pass to the underlying RPC call.timeout( float) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call.
Returns:
- ( viam.components.arm.Pose): : A representation of the arm’s current position as a 6 DOF (six degrees of freedom) pose. The
Poseis composed of values for location and orientation with respect to the origin. Location is expressed as distance, which is represented by x, y, and z coordinate values. Orientation is expressed as an orientation vector, which is represented by o_x, o_y, o_z, and theta values.
Example:
For more information, see the Python SDK Docs.
MoveToPosition
Move the end of the arm in a straight line to the desired pose, relative to the base of the arm.
All arms have a Home position, which corresponds to setting all joint angles to 0.
Parameters:
pose( viam.components.arm.Pose) (required): The destination Pose for the arm. The Pose is composed of values for location and orientation with respect to the origin. Location is expressed as distance, which is represented by x, y, and z coordinate values. Orientation is expressed as an orientation vector, which is represented by o_x, o_y, o_z, and theta values.extra(Mapping[ str, Any]) (optional): Extra options to pass to the underlying RPC call.timeout( float) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call.
Returns:
- None.
Example:
For more information, see the Python SDK Docs.
MoveToJointPositions
Move each joint on the arm to the position specified in positions.
Caution
Collision checks are not enabled when doing direct joint control with MoveToJointPositions().
Parameters:
positions( viam.proto.component.arm.JointPositions) (required): The destination JointPositions for the arm.extra(Mapping[ str, Any]) (optional): Extra options to pass to the underlying RPC call.timeout( float) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call.
Returns:
- None.
Example:
For more information, see the Python SDK Docs.
MoveThroughJointPositions
Move the arm’s joints through the given positions in the order they are specified. This will block until done or a new operation cancels this one.
Parameters:
ctx(Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.positions([][]referenceframe.Input)options(*MoveOptions)extra(map[string]interface{}): Extra options to pass to the underlying RPC call. Returns:- (error): An error, if one occurred. Example:
For more information, see the Go SDK Docs.
GetJointPositions
Get the current position of each joint on the arm.
Parameters:
extra(Mapping[ str, Any]) (optional): Extra options to pass to the underlying RPC call.timeout( float) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call.
Returns:
- ( viam.proto.component.arm.JointPositions): : The current
JointPositionsfor the arm.JointPositionscan have one attribute,values, a list of joint positions with rotational values (degrees) and translational values (mm).
Example:
For more information, see the Python SDK Docs.
Get3DModels
Get the 3D models of the arm.
Parameters:
ctx(Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.extra(map[string]interface{}): Extra options to pass to the underlying RPC call.
Returns:
- (map[string]*commonpb.Mesh)
- (error): An error, if one occurred.
For more information, see the Go SDK Docs.
GetKinematics
Get the kinematics information associated with the arm as the format and byte contents of the kinematics file.
Returns:
- ( viam.components.KinematicsReturn): : A tuple containing two values; the first [0] value represents the format of the file, either in URDF format (
KinematicsFileFormat.KINEMATICS_FILE_FORMAT_URDF) or 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.
Example:
For more information, see the Python SDK Docs.
IsMoving
Get if the arm is currently moving.
Parameters:
timeout( float) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call.
Returns:
- ( bool): : Whether the arm is moving.
Example:
For more information, see the Python SDK Docs.
Stop
Stop all motion of the arm.
Returns:
- None.
Example:
For more information, see the Python SDK Docs.
GetGeometries
Get all the geometries associated with the arm in its current configuration, in the frame of the arm. The motion and navigation services use the relative position of inherent geometries to configured geometries representing obstacles for collision detection and obstacle avoidance while motion planning.
Returns:
- ( List[viam.proto.common.Geometry]): : The geometries associated with the Component.
Example:
For more information, see the Python SDK Docs.
Reconfigure
Reconfigure this resource. Reconfigure must reconfigure the resource atomically and in place.
Parameters:
ctx(Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.deps(Dependencies): The resource dependencies.conf(Config): The resource configuration.
Returns:
- (error): An error, if one occurred.
For more information, see the Go SDK Docs.
DoCommand
Execute model-specific commands that are not otherwise defined by the component API. Most models do not implement DoCommand. Any available model-specific commands should be covered in the model’s documentation. If you are implementing your own arm and want to add features that have no corresponding built-in API method, you can implement them with DoCommand.
Parameters:
command(Mapping[ str, ValueTypes]) (required): The command to execute.timeout( float) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call.
Returns:
- (Mapping[ str, viam.utils.ValueTypes]): : Result of the executed command.
Raises:
- (NotImplementedError): Raised if the Resource does not support arbitrary commands.
Example:
For more information, see the Python SDK Docs.
GetResourceName
Get the ResourceName for this arm.
Parameters:
name( str) (required): The name of the Resource.
Returns:
- ( viam.proto.common.ResourceName): : The ResourceName of this Resource.
Example:
For more information, see the Python SDK Docs.
Close
Safely shut down the resource and prevent further use.
Parameters:
- None.
Returns:
- None.
Example:
For more information, see the Python SDK Docs.