feathersdk.robot.arm_system Module

class feathersdk.robot.arm_system.ArmSystem(motors_manager: MotorsManager, motors_map: Dict[str, RobstrideMotor], name: str, calibration_order: List[str])

Bases: SteppableSystem

Single-arm motor control: trajectories, enable/disable, and calibration.

Each arm registers its motors with a shared MotorsManager, loads calibration on construction, and runs per-motor trajectories in _step() at operating_frequency (Hz), with periodic CAN pings staggered across motors.

capture_position(is_calibrated_angle: bool = False)

Return cached angles from last feedback (no extra CAN read).

Parameters:

is_calibrated_angle (bool) – If True, use calibrated_angle; else raw angle.

Returns:

Motor name → angle (rad).

Return type:

dict[str, float]

capture_position_sync(is_calibrated_angle: bool = False)

Read mech_pos from each motor via synchronous parameter read.

Parameters:

is_calibrated_angle (bool) – If True, convert raw mechanical position to calibrated angle; if False, return raw mech_pos.

Returns:

Motor name → position (rad).

Return type:

dict[str, float]

disable()

Disable this arm via the motors manager (stops compliance mode for this family).

enable()

Enable all arm motors in operation mode with retries.

Resets trajectories first. Acquires each motor’s enable_lock until Run mode is confirmed, then releases locks for motors that succeeded.

Raises:

Exception – If this arm’s family is still in compliance mode, or if any motor fails to enter Run mode after max_retries.

freeze_current_arm_state(kp: float | Dict[str, float] = 30, kd: float | Dict[str, float] = 5)

Hold the arm at the current pose using operation-mode gains.

Sets last_kp / last_kd on each motor (scalar or per-motor dict), then commands an immediate move (short total_time) to current calibrated angles.

Parameters:
  • kp (float | Dict[str, float]) – Position gain or per-motor overrides. Default 30.

  • kd (float | Dict[str, float]) – Damping gain or per-motor overrides. Default 5.

get_state() dict

Get synchronous snapshot state for all motors in this arm.

Uses the last cached feedback values on each motor (no extra CAN read).

Returns:

Maps each motor name to a dict with:

  • temp: temperature (scalar from last feedback)

  • torque: torque (scalar from last feedback)

  • angle: calibrated angle in radians

  • velocity: velocity in rad/s

Return type:

dict

async get_state_async(motor_name: str) Dict[str, TimestampedValue]

Fetch fresh feedback for one motor and return timestamped fields.

Parameters:

motor_name (str) – Name of a motor belonging to this arm.

Returns:

Keys temp, torque, angle (calibrated), and velocity.

Return type:

dict[str, TimestampedValue]

go_to(motors_targets: Dict[str, float], total_time: float)

Go to a target position for all motors in the arm.

Parameters:
  • motors_targets (Dict[str, float]) – Motor name → target calibrated angle (rad).

  • total_time (float) – Duration (s) over which trajectories should complete.

home(time: float = 2.0)

Move all joints toward calibrated angle zero over time seconds.

Parameters:

time (float) – Trajectory duration in seconds (default 2.0).

is_calibrated() bool

Check if the arm is calibrated and ready for use.

reset_trajectories()

Clear trajectory state and align internal targets with current encoder angles.

Sets each motor’s target_position to the raw angle feedback and resets its trajectory planner so the next go_to() defines a fresh motion.