forked from tangger/lerobot
Add feetech operating modes
This commit is contained in:
@@ -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 .feetech_calibration import apply_feetech_offsets_from_calibration, run_full_arm_calibration
|
||||||
from .tables import *
|
from .tables import *
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
|
from enum import Enum
|
||||||
|
|
||||||
from ..motors_bus import Motor, MotorsBus
|
from ..motors_bus import Motor, MotorsBus
|
||||||
from .tables import (
|
from .tables import (
|
||||||
@@ -29,6 +30,20 @@ DEFAULT_TIMEOUT_MS = 1000
|
|||||||
MAX_ID_RANGE = 252
|
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):
|
class FeetechMotorsBus(MotorsBus):
|
||||||
"""
|
"""
|
||||||
The FeetechMotorsBus class allows to efficiently read and write to the attached motors. It relies on the
|
The FeetechMotorsBus class allows to efficiently read and write to the attached motors. It relies on the
|
||||||
|
|||||||
Reference in New Issue
Block a user