firmware.motor_utils package

Submodules

firmware.motor_utils.motor_factory module

Motor factory module. Contains a factory class to create motor objects based on configuration.

class firmware.motor_utils.motor_factory.MotorFactory[source]

Bases: object

static create_motor(motor, motor_id, control_params, communication_interface)[source]
Return type:

MotorInterface

firmware.motor_utils.motor_utils module

This module contains the abstract base class for motor interfaces.

class firmware.motor_utils.motor_utils.MotorInterface(motor_id, control_params, communication_interface)[source]

Bases: ABC

Abstract base class for motor interfaces.

abstract calibrate(current_limit)[source]

Calibrates motor assuming the existence of hard stops.

Return type:

None

abstract get_position()[source]

Gets the current position of the motor.

Return type:

float

abstract get_speed()[source]

Gets the current speed of the motor.

Return type:

float

abstract set_current(current)[source]

Sets the current of the motor.

Return type:

None

abstract set_position(position, **kwargs)[source]

Sets the position of the motor.

Return type:

None

abstract set_zero_position()[source]

Sets the zero position of the motor.

Return type:

None

class firmware.motor_utils.motor_utils.MotorParams[source]

Bases: object

Module contents