Guides¶
Integrating a New Motor Controller¶
The following steps are needed for integrating a new motor controller in Being.
- Subclass
being.motors.controllers.Controller
Define emergency descriptions
Define supported homing methods
Overwrite
apply_motor_direction
method[Optional] Overwrite
init_homing
method if another homing type thanbeing.motors.homing.CiA402Homing
is required.
- Subclass
Register new controller type in
being.motors.blocks.CONTROLLER_TYPES
.
from typing import List, Set
from being.motors.controllers import Controller
class R2D2(Controller):
EMERGENCY_DESCRIPTIONS: List[tuple] = [
# Code Mask Description
#(0x0000, 0xFF00, 'No error'),
...
]
"""(error code, error mask, description) tuples."""
SUPPORTED_HOMING_METHODS: Set[int] = {1, 2, 3, 4} # ...
"""Supported homing methods for the controller. See CiA 402
homing methods.
"""
def apply_motor_direction(self, direction: float):
"""For direction in -1.0 or 1.0 configure the motor
direction of the controller.
"""
pass