viam.components.arm

Submodules

Package Contents

Classes

Arm

Arm represents a physical robot arm that exists in three-dimensional space.

JointPositions

Abstract base class for protocol messages.

Pose

Pose is a combination of location and orientation.

WorldState

WorldState contains information about the physical environment around a given robot. All of the fields within this message are optional,

class viam.components.arm.Arm(name: str)[source]

Arm represents a physical robot arm that exists in three-dimensional space.

This acts as an abstract base class for any drivers representing specific arm implementations. This cannot be used on its own. If the __init__() function is overridden, it must call the super().__init__() function.

SUBTYPE :Final
abstract async get_end_position(*, extra: Optional[Dict[str, Any]] = None, timeout: Optional[float] = None, **kwargs) 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.

abstract 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, **kwargs)[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.

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

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

Parameters

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

abstract async get_joint_positions(*, extra: Optional[Dict[str, Any]] = None, timeout: Optional[float] = None, **kwargs) 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

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

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

abstract async is_moving() bool[source]

Get if the arm is currently moving.

Returns

Whether the arm is moving.

Return type

bool

class viam.components.arm.JointPositions(*, values: collections.abc.Iterable[builtins.float] | None = ...)

Abstract base class for protocol messages.

Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below.

property values: google.protobuf.internal.containers.RepeatedScalarFieldContainer[float]

A list of joint positions. Rotations values are in degrees, translational values in mm. The numbers are ordered spatially from the base toward the end effector This is used in GetJointPositionsResponse and MoveToJointPositionsRequest

class viam.components.arm.Pose(*, x: float = ..., y: float = ..., z: float = ..., o_x: float = ..., o_y: float = ..., o_z: float = ..., theta: float = ...)

Pose is a combination of location and orientation. Location is expressed as distance which is represented by x , y, z coordinates. Orientation is expressed as an orientation vector which is represented by o_x, o_y, o_z and theta. The o_x, o_y, o_z coordinates represent the point on the cartesian unit sphere that the end of the arm is pointing to (with the origin as reference). That unit vector forms an axis around which theta rotates. This means that incrementing / decrementing theta will perform an inline rotation of the end effector. Theta is defined as rotation between two planes: the first being defined by the origin, the point (0,0,1), and the rx, ry, rz point, and the second being defined by the origin, the rx, ry, rz point and the local Z axis. Therefore, if theta is kept at zero as the north/south pole is circled, the Roll will correct itself to remain in-line.

x :float

millimeters from the origin

y :float

millimeters from the origin

z :float

millimeters from the origin

o_x :float

z component of a vector defining axis of rotation

o_y :float

x component of a vector defining axis of rotation

o_z :float

y component of a vector defining axis of rotation

theta :float

degrees

class viam.components.arm.WorldState(*, obstacles: collections.abc.Iterable[global___GeometriesInFrame] | None = ..., interaction_spaces: collections.abc.Iterable[global___GeometriesInFrame] | None = ..., transforms: collections.abc.Iterable[global___Transform] | None = ...)

WorldState contains information about the physical environment around a given robot. All of the fields within this message are optional, they can include information about the physical dimensions of an obstacle, the freespace of a robot, and any desired transforms between a given reference frame and a new target reference frame.

property obstacles: google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___GeometriesInFrame]

a list of obstacles expressed as a geometry and the reference frame in which it was observed; this field is optional

property interaction_spaces: google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___GeometriesInFrame]

a list of spaces the robot is allowed to operate within expressed as a geometry and the reference frame it is measured from; this field is optional

property transforms: google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Transform]

a list of Transforms, optionally with geometries. Used as supplemental transforms to transform a pose from one reference frame to another, or to attach moving geometries to the frame system. This field is optional