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
Allow other poses to be stored and accessed
  • Loading branch information
danic85 committed Jul 14, 2025
commit 0be65a3c7e695ffb414378c2119a49de48559b7f
12 changes: 10 additions & 2 deletions config/servo_waveshare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,20 @@ servos:
model: 'ST3215'
id: 3
range: [744, 3136]
start: 1269 #2048
start: 1269
poses:
- stand: 824
- sit: 1269
- centre: 2048
- name: "leg_r_knee"
model: 'ST3215'
id: 2
range: [702, 3260]
start: 723 #2048
start: 723
poses:
- stand: 2111
- sit: 723
- centre: 2048
# configure_on_boot: true
- name: "leg_r_ankle"
model: 'ST3215'
Expand Down
27 changes: 21 additions & 6 deletions modules/actuators/bus_servo/servo.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,13 @@ def __init__(self, **kwargs):
self.model = kwargs.get('model', 'ST')
self.index = kwargs.get('id')
self.range = kwargs.get('range')
self.start = kwargs.get('start', 50)
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.configure_on_boot = kwargs.get('configure_on_boot', False) # Loop to show position for manual configuration
self.pos = self.start
self.speed = 2400
self.speed = 2400 # 3073
self.acceleration = 50

# Initialize PortHandler instance
Expand Down Expand Up @@ -100,7 +101,10 @@ def setup_messaging(self):
self.get_position() # Log will show current position repeatedly to help with manual configuration

self.pos = self.get_position() # Get initial position to avoid jumping from unknown position

# Move to start position
# if self.get_pose_value('stand') is not None:
# self.start = self.get_pose_value('stand')
Comment on lines +124 to +125

Copilot AI Dec 21, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment appears to contain commented-out code.

Copilot uses AI. Check for mistakes.
self.move(self.start)

def move(self, position):
Expand Down Expand Up @@ -206,14 +210,25 @@ def handle_errors(self, comm_result, error):
self.log("%s" % self.packetHandler.getRxPacketError(error), level='error')
return True
return False




def get_pose_value(self, pose_name):
"""
Returns the position value for the given pose name from self.poses.
"""
if not self.poses:
return None
for pose in self.poses:
if pose_name in pose:
return pose[pose_name]
return None # or raise an exception if preferred