Replies: 1 comment
-
Created https://github.com/makerforgetech/modular-biped/tree/feature/servo_module as a starting point for this. It has not been tested. The I2C servo module handles multiple servos with a single instance, but the other servo modules do not. This needs to be standardised. I have attempted to manage the protocol changes by creating three configuration items in the servo.yaml. The module loader should be able to handle this correctly (untested).
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The current develop branch now has three main modules for managing servos:
modules/actuators/servo.py
: for servo communication via UART to thearduino_sketch
modules/actuators/piservo.py
: for servo communication via GPIO from the Raspberry Pi.modules/i2c_servo.py
: for servo communication via I2C using the servo driver board PCA9685I'd like to merge all three, into the main
servo.py
file, so that a protocol can be selected for each servo instance.We already support multiple servos on a single module:
This change would allow each servo instance to have a
protocol
attribute which would determine which logic to use, and combine all protocols into a single module.The piServo and i2cServo modules are very simple, and so can be merged easily.
To reduce complexity and improve readability, there should be a hierarchy of modules:
Create a BaseServo module that handles generic functionality, such as calculating angles from percentages and storing values. Extend with three classes for UARTServo, GPIOServo (formerly PiServo) and I2CServo.
The module loader may also need to be modified to support this.
Beta Was this translation helpful? Give feedback.
All reactions