pylabrobot.paa.kx2.KX2#

class pylabrobot.paa.kx2.KX2(has_rail: bool = False, has_servo_gripper: bool = True, interface: str | None = None, channel: str | None = None, bitrate: int = 500000, gripper_length: float = 0.0, gripper_z_offset: float = 0.0, gripper_finger_side: Literal['barcode_reader', 'proximity_sensor'] = 'barcode_reader', barcode_port: str | None = None, barcode_baudrate: int = 9600, parking_position: Dict[Axis, float] | None = None)#

Bases: object

PAA KX2 robotic plate handler.

A single class spanning CAN transport + Elmo drive primitives and the robot-level arm/gripper/homing/kinematics logic. Construct it, await setup(), drive it, await stop().

Attributes

barcode_reader

The independent serial reader, if fitted.

configuration

Calibration and limits read from this arm during setup.

emcy_move_error

First pending fault across all nodes; None if no fault.

last_emcy

Most recent EMCY frame received from any node; None if none yet.

loop

Event loop captured in setup().

parking_position

An explicit park target in this arm's calibrated joint coordinates.

setup_finished

Whether connection and calibration discovery completed.

Methods

__init__([has_rail, has_servo_gripper, ...])

add_emcy_callback(cb)

Register a callback fired on every (non-suppressed) EMCY frame.

drop_at_joint_state(joint_state, ...[, ...])

Move to the joint target and release to the supplied jaw width.

drop_at_location(location, direction, ...[, ...])

Move to the Cartesian target and release to the supplied jaw width.

find_with_proximity_sensor(start, end, *[, ...])

Sweep a straight Cartesian segment until the beam trips; retain the measured yaw.

find_z_with_proximity_sensor(z_start, z_end)

Descend between absolute Z bounds, stopping on the beam and restoring its input logic.

halt()

Cancel active motion and stop the positioning axes, preserving gripper holding power.

motion_limits()

Per-axis (max_speed, max_acceleration) read from the drives at setup.

move_parametric(path_fn, duration)

Stream a parametric Cartesian trajectory through IPM.

move_through_waypoints(waypoints, *, speed, ...)

Stream a smooth Catmull-Rom spline through waypoints.

move_to_joint_state(joint_state, *[, ...])

Move absolute joint targets; omitted axes stay at their measured positions.

move_to_location(location, direction, *[, ...])

Move the gripper to a Cartesian location with yaw direction (deg).

park()

Move to the configured park target, leaving the gripper unchanged.

pick_up_at_joint_state(joint_state, ...[, ...])

Move to the joint target and grip using the supplied jaw width.

pick_up_at_location(location, direction, ...)

Move to the Cartesian target and grip using the supplied jaw width.

request_axis_enabled(node_id)

Return True if the motor is energized (Elmo MO=1).

request_axis_fault(node_id)

Read and decode the drive motor-fault register.

request_axis_position(axis)

Read one calibrated axis position in millimeters or degrees.

request_drive_version(node_id)

Read the standard firmware-version object without changing interpreter settings.

request_estop()

Return True if the arm is in estop, False otherwise.

request_gripper_pose()

Compute the grip-center pose from measured calibrated joints.

request_input(axis, input_num)

Read the assigned digital input on an axis.

request_joint_state()

Read all calibrated axis positions in millimeters or degrees.

request_output(node_id, output_num)

Read the current state of an output bit.

scan_barcode([read_time])

Fire the onboard barcode reader and return the decoded Barcode (or None on a no-read).

sense_proximity()

Read the interrupted-beam sensor between the gripper fingers.

set_output(node_id, output_num, state)

Set an output to the requested state.

setup([skip_home])

Connect and read calibration.

start_freedrive_mode([free_axes])

Disable the selected positioning motors for teaching, retaining their prior enable states.

stop()

Finish active work, restore session settings, and close both transports.

stop_freedrive_mode()

Return each taught axis to its enable state from before freedrive.

wait_for_proximity_sensor([state, timeout, poll])

Poll until the sensor reads state.

Parameters:
  • has_rail (bool)

  • has_servo_gripper (bool)

  • interface (Optional[str])

  • channel (Optional[str])

  • bitrate (int)

  • gripper_length (float)

  • gripper_z_offset (float)

  • gripper_finger_side (GripperFingerSide)

  • barcode_port (Optional[str])

  • barcode_baudrate (int)

  • parking_position (Optional[Dict[Axis, float]])