"""This module contains the abstract base class for motor interfaces."""fromabcimportABC,abstractmethodfromdataclassesimportdataclassfromtypingimportAny
[docs]classMotorInterface(ABC):"""Abstract base class for motor interfaces."""def__init__(self,motor_id:int,control_params:MotorParams,communication_interface:Any)->None:self.motor_id=motor_idself.control_params=control_paramsself.communication_interface=communication_interfaceself.position:float=0self.speed:float=0
[docs]@abstractmethoddefset_position(self,position:float,**kwargs:Any)->None:"""Sets the position of the motor."""pass
[docs]@abstractmethoddefset_current(self,current:float)->None:"""Sets the current of the motor."""pass
[docs]@abstractmethoddefset_zero_position(self)->None:"""Sets the zero position of the motor."""pass
[docs]@abstractmethoddefget_position(self)->float:"""Gets the current position of the motor."""pass
[docs]@abstractmethoddefget_speed(self)->float:"""Gets the current speed of the motor."""pass
[docs]@abstractmethoddefcalibrate(self,current_limit:float)->None:"""Calibrates motor assuming the existence of hard stops."""pass