viam.components.arm.client

Module Contents

Classes

ArmClient

gRPC client for an Arm component.

class viam.components.arm.client.ArmClient(name: str, channel: grpclib.client.Channel)[source]

gRPC client for an Arm component.

Used to communicate with an existing Arm implementation over gRPC.

async get_end_position(*, extra: Optional[Dict[str, Any]] = None, timeout: Optional[float] = None) viam.proto.common.Pose[source]

Get the current position of the end of the arm expressed as a Pose.

Returns: The location and orientation of the arm described as a Pose.

async move_to_position(pose: viam.proto.common.Pose, world_state: Optional[viam.proto.common.WorldState] = None, *, extra: Optional[Dict[str, Any]] = None, timeout: Optional[float] = None)[source]

Move the end of the arm to the Pose specified in pose. When obstacles are specified in world_state, the motion plan of the arm will avoid them.

Parameters
  • pose (Pose) – The destination Pose for the arm.

  • world_state (WorldState) – The obstacles for the arm to avoid on its way to pose.

async get_joint_positions(*, extra: Optional[Dict[str, Any]] = None, timeout: Optional[float] = None) viam.proto.component.arm.JointPositions[source]

Get the JointPositions representing the current position of the arm.

Returns

The current JointPositions for the arm.

Return type

JointPositions

async move_to_joint_positions(positions: viam.proto.component.arm.JointPositions, *, extra: Optional[Dict[str, Any]] = None, timeout: Optional[float] = None)[source]

Move each joint on the arm to the corresponding angle specified in positions.

Parameters

positions (JointPositions) – The destination JointPositions for the arm.

async stop(*, extra: Optional[Dict[str, Any]] = None, timeout: Optional[float] = None)[source]

Stop all motion of the arm. It is assumed that the arm stops immediately.

async is_moving(*, extra: Optional[Dict[str, Any]] = None, timeout: Optional[float] = None) bool[source]

Get if the arm is currently moving.

Returns

Whether the arm is moving.

Return type

bool

async do_command(command: Dict[str, Any], *, timeout: Optional[float] = None) Dict[str, Any][source]

Send/Receive arbitrary commands

Parameters

command (Dict[str, Any]) – The command to execute

Raises

NotImplementedError – Raised if the component does not support arbitrary commands

Returns

Result of the executed command

Return type

Dict[str, Any]