feathersdk.robot.actuators.actuator Module¶
- class feathersdk.robot.actuators.actuator.ActuatorConfig(*, name, id, endpoint='', shares_endpoint_with=None, requires_calibration, calibration_timeout=10.0, feedback_delay_threshold=0.1, feedback_delay_warning_interval=10.0, urdf_joint_name='', urdf_link_name='')¶
Bases:
PyDFrozenBaseModelFrozen base class for all actuator configs.
- Parameters:
- endpoint: str | int¶
The endpoint to use for the communication. Will be set automatically by the manager.
Name of an actuator or multiple actuators that share the same endpoint with this actuator. If set, we will probe for this actuator’s endpoint after all other actuators have been found. We check only endpoints of existing actuator names in this list. If no actuators in this list exist, we probe as normal. Otherwise, the endpoint for this actuator must be the same as the first shared actuator found in the list. This is useful for speeding up actuator endpoint detection, especially for slow-detecting actuators like the EZMotion motors.
- feedback_delay_threshold: float¶
The threshold in seconds for feedback delay. If we do not receive an updated value for a parameter within this threshold, we will consider the actuator to have feedback delay.
- feedback_delay_warning_interval: float¶
The interval in seconds between feedback delay warnings. Will only warn once every this interval at most.
- urdf_joint_name: str¶
The name of the joint in the URDF that this actuator corresponds to. Ignored if motor is not in a system that requires URDF joint names.
- urdf_link_name: str¶
The name of an important link this actuator is attached to. Mainly used for wheel geometry extraction.
- set_endpoint(endpoint)¶
Set the communication endpoint for the motor.
- Parameters:
endpoint (str)
- Return type:
None
- clear_endpoint()¶
Clear the communication endpoint for the motor.
- Return type:
None
- model_config: ClassVar[ConfigDict] = {'frozen': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class feathersdk.robot.actuators.actuator.TActuatorConfig¶
Typevar bound to ActuatorConfig
alias of TypeVar(‘TActuatorConfig’, bound=
ActuatorConfig)
- class feathersdk.robot.actuators.actuator.TTelemetryParamCode¶
Unique Enum of telemetry parameter codes for the actuator. Names should be string key to use, values should be the pcodes needed to be sent to the ethernet -> CAN adapter.
alias of TypeVar(‘TTelemetryParamCode’, bound=
Enum)
- feathersdk.robot.actuators.actuator.TIMESTAMP_SUFFIX = '_TS'¶
The suffix to add to telemetry keys to store the timestamp, to keep with convention.
- class feathersdk.robot.actuators.actuator.ActuatorTelemetry(actuator)¶
Bases:
Generic[TTelemetryParamCode]Base class for all actuator telemetry.
- Parameters:
actuator (Actuator[TActuatorConfig, TActuatorTelemetry])
- PARAMS: TTelemetryParamCode¶
The telemetry parameters for this actuator.
- telemetry_inds()¶
Get the indices of the telemetry entries for this actuator in the global telemetry manager.
Indices are returned in the order of the PARAMS class variable.
- get_latest_value(key, default=<SENTINEL>)¶
Get the latest value of a telemetry parameter by name. Can pass either a normal param or timestamp param.
- Parameters:
key (TTelemetryParamCode)
default (U)
- Return type:
- get_latest_timestamp(key, default=<SENTINEL>)¶
Get the latest timestamp of a telemetry parameter by name.
- Parameters:
key (TTelemetryParamCode)
default (U)
- Return type:
float | U
- get_value_at(key, index, default=<SENTINEL>)¶
Get the value of a telemetry parameter at a given index.
- Parameters:
key (TTelemetryParamCode)
index (int)
default (U)
- Return type:
- get_timestamp_at(key, index, default=<SENTINEL>)¶
Get the timestamp of a telemetry parameter at a given index.
- Parameters:
key (TTelemetryParamCode)
index (int)
default (U)
- Return type:
float | U
- class feathersdk.robot.actuators.actuator.TActuatorTelemetry¶
Typevar bound to ActuatorTelemetry
alias of TypeVar(‘TActuatorTelemetry’, bound=
ActuatorTelemetry)
- class feathersdk.robot.actuators.actuator.Actuator(config, *args, **kwargs)¶
Bases:
Configurable[TActuatorConfig],ABC,Generic[TActuatorConfig,TActuatorTelemetry,TTelemetryParamCode]Base class for all actuators.
Hashable by name as all names are required to be unique. Will also be equal to the string name for use as dict key.
- Parameters:
config (TConfig)
system (ActuatorSystem[TActuatorSystemConfig])
- name¶
The unique name of the actuator.
- id¶
The unique identifier for the actuator.
- system¶
The actuator system that this actuator belongs to.
- robot¶
The robot that this actuator’s system belongs to.
- comms¶
The comms manager for the actuator. Handles all low-level communication with the actuator.
- telemetry¶
The telemetry manager for the actuator. Handles all telemetry collection and storage.
- PARAMS: TTelemetryParamCode¶
The telemetry parameters for the actuator.
- get_param(key, default=<SENTINEL>)¶
Get the value of a parameter by name.
- Parameters:
key (TTelemetryParamCode)
default (U)
- Return type:
- has_feedback_delay(key, threshold=None)¶
Check if the actuator has feedback delay for a given parameter.
Will return True if the param has no value in the telemetry manager.
- check_warn_on_feedback_delay(key, threshold=None)¶
Check if the actuator has feedback delay for a given parameter and warn if so.
Will only warn once every self.config.feedback_delay_warning_interval seconds at most.
- class feathersdk.robot.actuators.actuator.TActuator¶
Typevar bound to Actuator
alias of TypeVar(‘TActuator’, bound=
Actuator[TActuatorConfig,TActuatorTelemetry,TTelemetryParamCode])
- exception feathersdk.robot.actuators.actuator.ActuatorCalibrationError¶
Bases:
ExceptionRaised when an error occurs during actuator calibration.
- feathersdk.robot.actuators.actuator.calibrate_actuator_group(actuators, allow_load=False, only_load=False, home=True, multithreaded=True)¶
Recalibrate a group of actuators.
- Parameters:
actuators (List[Actuator[TActuatorConfig, TActuatorTelemetry, TTelemetryParamCode]]) – The list of actuators to calibrate.
allow_load (bool) – If True, allow the actuators to load calibration state from file instead of recalibrating.
only_load (bool) – If True, only load calibration state from file, do not recalibrate. allow_load must be True.
home (bool) – If True, home the actuators after calibration.
multithreaded (bool) – If True, calibrate the actuators all at once in multiple threads. Otherwise, one at a time.
- Return type:
None