Fix _find_single_motor
This commit is contained in:
@@ -155,7 +155,7 @@ class DynamixelMotorsBus(MotorsBus):
|
|||||||
if found_model != expected_model_nb:
|
if found_model != expected_model_nb:
|
||||||
raise RuntimeError(
|
raise RuntimeError(
|
||||||
f"Found one motor on {baudrate=} with id={found_id} but it has a "
|
f"Found one motor on {baudrate=} with id={found_id} but it has a "
|
||||||
f"model number '{found_model}' different than the one expected: '{expected_model_nb}' "
|
f"model number '{found_model}' different than the one expected: '{expected_model_nb}'. "
|
||||||
f"Make sure you are connected only connected to the '{motor}' motor (model '{model}')."
|
f"Make sure you are connected only connected to the '{motor}' motor (model '{model}')."
|
||||||
)
|
)
|
||||||
return baudrate, found_id
|
return baudrate, found_id
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ class FeetechMotorsBus(MotorsBus):
|
|||||||
if found_model != expected_model_nb:
|
if found_model != expected_model_nb:
|
||||||
raise RuntimeError(
|
raise RuntimeError(
|
||||||
f"Found one motor on {baudrate=} with id={found_id} but it has a "
|
f"Found one motor on {baudrate=} with id={found_id} but it has a "
|
||||||
f"model number '{found_model}' different than the one expected: '{expected_model_nb}' "
|
f"model number '{found_model}' different than the one expected: '{expected_model_nb}'. "
|
||||||
f"Make sure you are connected only connected to the '{motor}' motor (model '{model}')."
|
f"Make sure you are connected only connected to the '{motor}' motor (model '{model}')."
|
||||||
)
|
)
|
||||||
return baudrate, found_id
|
return baudrate, found_id
|
||||||
@@ -205,13 +205,14 @@ class FeetechMotorsBus(MotorsBus):
|
|||||||
self.set_baudrate(baudrate)
|
self.set_baudrate(baudrate)
|
||||||
for id_ in range(scs.MAX_ID + 1):
|
for id_ in range(scs.MAX_ID + 1):
|
||||||
found_model = self.ping(id_)
|
found_model = self.ping(id_)
|
||||||
if found_model is not None and found_model != expected_model_nb:
|
if found_model is not None:
|
||||||
raise RuntimeError(
|
if found_model != expected_model_nb:
|
||||||
f"Found one motor on {baudrate=} with id={id_} but it has a "
|
raise RuntimeError(
|
||||||
f"model number '{found_model}' different than the one expected: '{expected_model_nb}' "
|
f"Found one motor on {baudrate=} with id={id_} but it has a "
|
||||||
f"Make sure you are connected only connected to the '{motor}' motor (model '{model}')."
|
f"model number '{found_model}' different than the one expected: '{expected_model_nb}'. "
|
||||||
)
|
f"Make sure you are connected only connected to the '{motor}' motor (model '{model}')."
|
||||||
return baudrate, id_
|
)
|
||||||
|
return baudrate, id_
|
||||||
|
|
||||||
raise RuntimeError(f"Motor '{motor}' (model '{model}') was not found. Make sure it is connected.")
|
raise RuntimeError(f"Motor '{motor}' (model '{model}') was not found. Make sure it is connected.")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user