Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
4c8c7d9
WIP bus servo management
danic85 Jul 12, 2025
d18189c
Update config
danic85 Jul 12, 2025
60d524a
Added SC servo examples + compatibility
danic85 Jul 13, 2025
3e4dfc0
Configure initial positions
danic85 Jul 14, 2025
0be65a3
Allow other poses to be stored and accessed
danic85 Jul 14, 2025
91fac95
Added change_id script
danic85 Aug 3, 2025
69f2d7c
Calibrate servos on boot
danic85 Oct 4, 2025
9a57f8a
adjustments
danic85 Oct 4, 2025
0cf906e
Dynamic servo calibration + center on change_id
danic85 Oct 5, 2025
8d62b54
Controller support and WIP recording
danic85 Dec 13, 2025
f02d0db
Working with Pi
danic85 Dec 13, 2025
b052ed0
Adjust config
danic85 Dec 13, 2025
6841f63
Cleanup
danic85 Dec 14, 2025
c1ed384
Working input recorder
danic85 Dec 14, 2025
5e503e5
Support servo control (WIP - calibration needed)
danic85 Dec 14, 2025
008c369
Callibration + allow modules to be disabled on test environments
danic85 Dec 15, 2025
af0fdb2
Disable test
danic85 Dec 15, 2025
40040c8
Add documentation and tests
danic85 Dec 16, 2025
f645caa
Fix test
danic85 Dec 16, 2025
8a22781
Timeout controller connection after 30 seconds
danic85 Dec 16, 2025
d81c07c
Enable on robot
danic85 Dec 16, 2025
6a84d43
Fix for environment input to resolve pi issue
danic85 Dec 17, 2025
4803d58
Calibrate new leg position
danic85 Dec 17, 2025
dc4cb27
Improvements to gamepad controller modules. Temperature alert in disp…
danic85 Dec 18, 2025
d48ccd8
Fix tests
danic85 Dec 18, 2025
4a5a0ee
Fixes and improvements to loop and temperature management
danic85 Dec 21, 2025
5349956
Fix tests
danic85 Dec 21, 2025
cd4331b
Resolve PR comments
danic85 Dec 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
adjustments
  • Loading branch information
danic85 committed Oct 4, 2025
commit 9a57f8ac403f2c0fdfc0fb9e539fb1adea27e8aa
12 changes: 9 additions & 3 deletions docs/BusServo.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,19 @@ The `config/servo_waveshare.yml` file contains the configuration for each bus se

To calibrate the servos, each must have their ID set individually. To achieve this, connect one servo to the driver board and run `modules/actuators/bus_servo/change_id.py`. This script will prompt you to enter the ID for the connected servo, which will then be saved permanently on the servo.

If you have challenges understanding the current ID of the servo, run `modules/actuators/bus_servo/STServo_examples/read_all.py` or `modules/actuators/bus_servo/SCServo_examples/read_all.py` depending on the servo type. This script will read and display the current ID of the connected servo.

Note: if there is an issue with dependencies, you may need to run the script from within the `modules/actuators/bus_servo` directory.

Once this has been done for all servos, you can use the `Servo` class to control them by enabling it in the above yaml file.

To calibrate the servo positions, set the flag `configure_on_boot` to `true` in the configuration file for each instance (servo). This will cause the servo to output it's current position in the debug log, which can then be copied into the start position, or range. Servos can be manually moved to any position to identify their range or certain poses.
To calibrate the servo positions, set the flag `calibrate_on_boot` to `true` in the configuration file for each instance (servo). This will cause the servo to output it's current position in the debug log, which can then be copied into the start position, or range. Servos can be manually moved to any position to identify their range or certain poses.

Note: calibrate_on_boot is enabled by default to help with initial configuration.

Once the start position and range are set, move the flag to the next servo and repeat the process until all servos are configured.
Once the start position and range are set, move the flag to the next servo and repeat the process until all servos are calibrated.

Finally, remove the `configure_on_boot` flag from the configuration file and re-run the program to start using the servos with their configured positions.
Finally, set `calibrate_on_boot` to false and re-run the program to start using the servos with their configured positions.

## Subscriptions

Expand Down
2 changes: 1 addition & 1 deletion modules/actuators/bus_servo/change_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def getch():
SERVO_TYPE = input("Enter servo type (STS for ST3215, SCSCL for SC09): ").strip().upper()
SERVO_ID = int(input("Enter current servo ID (1-253): "))
BAUDRATE = 1000000
DEVICENAME = '/dev/ttyACM0' # Change as needed
DEVICENAME = '/dev/ttyACM0' # Change as needed, find with `ls /dev/ttyACM*`

# Initialize PortHandler
portHandler = PortHandler(DEVICENAME)
Expand Down
2 changes: 1 addition & 1 deletion modules/actuators/bus_servo/servo.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init__(self, **kwargs):
self.start = kwargs.get('start') # Default start position
self.poses = kwargs.get('poses') # Dictionary of poses
self.baudrate = kwargs.get('baudrate', 1000000)
self.port = kwargs.get('port', '/dev/ttyACM0')
self.port = kwargs.get('port', '/dev/ttyACM0') # Change as needed, find with `ls /dev/ttyACM*`
self.calibrate_on_boot = kwargs.get('calibrate_on_boot', True) # Loop to show position for manual configuration
self.pos = self.start
self.speed = 2400 # 3073
Expand Down