Add feetech operating modes

This commit is contained in:
Simon Alibert
2025-03-23 19:41:46 +01:00
parent 7152bc8aa7
commit 25388d0947
2 changed files with 16 additions and 1 deletions

View File

@@ -1,3 +1,3 @@
from .feetech import FeetechMotorsBus
from .feetech import FeetechMotorsBus, OperatingMode
from .feetech_calibration import apply_feetech_offsets_from_calibration, run_full_arm_calibration
from .tables import *

View File

@@ -13,6 +13,7 @@
# limitations under the License.
from copy import deepcopy
from enum import Enum
from ..motors_bus import Motor, MotorsBus
from .tables import (
@@ -29,6 +30,20 @@ DEFAULT_TIMEOUT_MS = 1000
MAX_ID_RANGE = 252
class OperatingMode(Enum):
# position servo mode
POSITION = 0
# The motor is in constant speed mode, which is controlled by parameter 0x2e, and the highest bit 15 is
# the direction bit
VELOCITY = 1
# PWM open-loop speed regulation mode, with parameter 0x2c running time parameter control, bit11 as
# direction bit
PWM = 2
# In step servo mode, the number of step progress is represented by parameter 0x2a, and the highest bit 15
# is the direction bit
STEP = 3
class FeetechMotorsBus(MotorsBus):
"""
The FeetechMotorsBus class allows to efficiently read and write to the attached motors. It relies on the