feat: add reset method

This commit is contained in:
hehesheng 2025-01-21 19:13:40 +08:00
parent e18d1fb7a0
commit c487ce3072
3 changed files with 5 additions and 0 deletions

View File

@ -139,6 +139,7 @@ class A1Motor(MotorInstance):
def temp(self):
return self.motor_data.temp
@override
@timeit
def reset(self):
self.init_motor_cmd()

View File

@ -12,3 +12,6 @@ class MotorInstance(object):
def sendrecv(self, cmd: MotorCmd) -> MotorData:
pass
def reset(self):
pass

View File

@ -57,6 +57,7 @@ class MotorManager(object):
def register_motor(self, motor: MotorInstance):
self.motor_dict[motor.get_motor_name()] = motor
motor.reset()
return motor.get_motor_name()
def get_motor(self, motor_name: str) -> MotorInstance: