feathersdk.robot.actuators.robstride.robstride_motor Module

feathersdk.robot.actuators.robstride.robstride_motor.CHECKED_PARAM_TOLERANCE = 0.01

Tolerance for checked parameter values. Some Robstride params are truncated to 16 bits, so they’re not perfect

exception feathersdk.robot.actuators.robstride.robstride_motor.IncompatibleRobstrideMotorModeError(*args, **kwargs)

Bases: Exception

Raised when attempting to command a motor with an incompatible run mode.

Parameters:
Return type:

None

class feathersdk.robot.actuators.robstride.robstride_motor.RobstrideMotorConfig(*, compliance_mode_torque_threshold, compliance_mode_update_dx, compliance_mode_max_velocity, compliance_mode_max_acceleration, name, id, endpoint='', shares_endpoint_with=None, requires_calibration, calibration_timeout=20.0, version, direction, max_angle_dx, max_torque, max_velocity, max_acceleration, angle_range, calibration_config, message_block_timeout=0.3, message_send_attempts=2, loc_kp=8.0)

Bases: MotorConfig, ComplianceModeConfig

Configuration for a Robstride motor.

Parameters:
version: RobstrideVersion

The version of the Robstride motor. See RobstrideVersion

direction: Literal[1, -1]

The direction of the motor. 1 for clockwise, -1 for counterclockwise, as seen with the motor’s shaft pointing towards you.

max_angle_dx: float

The maximum allowed angle change in motor position before triggering compliance mode.

max_torque: float

The maximum allowed torque the motor can apply in Newtons-meters.

max_velocity: float

The maximum allowed velocity the motor can apply in radians per second.

max_acceleration: float

The maximum allowed acceleration the motor can apply in radians per second squared.

angle_range: NumericRange

The expected total angle range of the actuator in radians.

calibration_config: RobstrideCalibrationConfig

The config for calibrating the motor.

calibration_timeout: float

The timeout in seconds to wait for the motor to fully calibrate.

message_block_timeout: float

The timeout in seconds to wait for a message to be sent to the motor when blocking.

message_send_attempts: int

The number of attempts to send a message to the motor when awaiting a response.

loc_kp: float

The position mode kp value.

validate_motor_id()
validate_angle_range_and_homing_offset()
validate_param_bounds()
model_config: ClassVar[ConfigDict] = {'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class feathersdk.robot.actuators.robstride.robstride_motor.RobstrideMotor(config, *args, **kwargs)

Bases: Motor[RobstrideMotorConfig, RobstrideParamSet, RobstrideParam, TRobParamVal]

Class to control a Robstride motor.

Parameters:
host_id: int = 170

The host ID to use when sending messages to the motor.

calibration_state: RobstrideCalibrationState = RobstrideCalibrationState(calibrated=False, calibrated_angle_range=NumericRange(min=-6.283185307179586, max=6.283185307179586), homing_offset=0, calibration_time=2678321.291047408)

The current calibration state of the motor.

PARAM_SET: RobstrideParamSet = <feathersdk.robot.actuators.robstride.params.RobstrideParamSet object>

The parameter set for Robstride motors.

has_dual_encoder: bool

Whether the motor has a dual encoder.

get_param(param, default=<SENTINEL>)

Get the latest stored value for a property in this motor

Parameters:
  • param (RobstrideParam) – the parameter to get the latest value for

  • default (U) – the value to return if the buffer is empty. If no default is provided, an error will be raised

Return type:

TRobParamVal | U

get_device_id(block=False)

Get the device id of the motor.

Parameters:

block (bool)

Return type:

int

enable(block=False)

Send ‘enable’ command to the motor. If block, block until response is received and return it.

Parameters:

block (bool)

Return type:

None

save_motor_data(block=False)

Save the motor data to the motor.

Parameters:

block (bool)

Return type:

None

disable(clear_faults=False, block=False)

Send the ‘disable’ command to the motor.

Parameters:
  • clear_faults (bool) – If True, clear the fault bits in the disable command.

  • block (bool) – If True, block until response is received and return it.

set_active_reporting(active, scan_time_ms=10, block=False)

Turn on/off active reporting for the motor.

Parameters:
  • active (bool) – If True, turn on active reporting. False to disable.

  • scan_time_ms (int) – Time between feedback messages. Minimum is 10ms, max is 327680ms (about 5.5 mins). Note: The motor only supports multiples of 5ms, so actual scan time is rounded down to the nearest 5ms.

  • block (bool)

zero_position(block=False)

Set the zero position for the motor.

Parameters:

block (bool)

Return type:

None

read_param(param, block=False)

Read a parameter from the motor. If block, block until the response is received and return it.

Parameters:
Return type:

TRobParamVal | None

write_param(param, value, block=False, clamp_values=False)

Write a parameter value to the specified motor.

Parameters:
  • param (RobstrideParam) – The parameter to write the value to.

  • value (TRobParamVal) – The value to write to the parameter.

  • block (bool) – If True, block until the response is received and we’ve checked that the value was successfully written.

  • clamp_values (bool) – If True, clamp the value to the range of the parameter.

Return type:

None

trigger_feedback_frame(block=False)

Trigger a feedback frame for the motor.

Parameters:

block (bool)

Return type:

None

set_run_mode(run_mode, block=False)

Set the run mode for the specified motor.

Parameters:
Return type:

None

set_limit_torque(limit_torque, block=False)

Set the limit torque for the motor. If block, block until the response is received and we’ve checked that the value was successfully written.

Parameters:
Return type:

None

set_target_position(target_position, block=False, await_position=False, await_timeout=1.0)
Set the target position for this motor. If block, block until the response is received and we’ve

checked that the value was successfully written.

Parameters:
  • target_position (float) – The target position to set in radians.

  • block (bool) – If True, block until the response is received and we’ve checked the value was successfully written.

  • await_position (bool) – If True, wait for the motor to reach the target position.

  • await_timeout (float) – The timeout in seconds to wait for the motor to reach the target position.

Return type:

None

set_target_velocity(target_velocity, block=False)

Set the target velocity for this motor. If block, block until the response is received and we’ve checked that the value was successfully written.

Parameters:
Return type:

None

set_target_acceleration(target_acceleration, block=False)

Set the target acceleration for this motor. If block, block until the response is received and we’ve checked that the value was successfully written.

Parameters:
Return type:

None

set_target_current(target_current, block=False)

Set the target current for this motor. If block, block until the response is received and we’ve checked that the value was successfully written.

Parameters:
Return type:

None

operation_command(torque, angle, velocity, kp, kd, force=False, clamp_values=False)

Send an operation control command to the motor.

Parameters:
  • torque (float) – The target torque in Newtons-meters.

  • angle (float) – The target angle in radians.

  • velocity (float) – The target velocity in radians per second.

  • kp (float) – The proportional gain.

  • kd (float) – The derivative gain.

  • force (bool) – If True, don’t check that the values are within the range.

  • clamp_values (bool) – If True, clamp the values to the range. Will not clamp if force is True.

Return type:

None

await_param(param, value, abs_tol, check_errors=False, torque_limit=None, timeout=1.0)

Await a parameter to reach a value within a tolerance. Returns the final value once reached.

Parameters:
  • param (RobstrideParam) – The parameter to await.

  • value (TRobParamVal) – The value to wait for param to reach.

  • abs_tol (float) – The absolute tolerance for the value to be considered reached.

  • check_errors (bool) – If True, check that no motor errors occur during the wait. If errors are found, an error will be raised.

  • torque_limit (float | None) – The torque limit to check. If None, don’t check. Otherwise if the torque limit is exceeded, an error will be raised.

  • timeout (float) – The timeout in seconds to wait for the parameter to reach the value.

Return type:

TRobParamVal