Skip to content

Bus servo management. Improvements to framework including temperature management - #143

Merged
danic85 merged 28 commits into
developfrom
feature/bus_servos
Dec 21, 2025
Merged

danic85 merged 28 commits into
developfrom
feature/bus_servos

Conversation

@danic85

@danic85 danic85 commented Jul 12, 2025 •

Copy link
Copy Markdown
Collaborator

What type of change is this?

  • New module
  • Change to an existing module
  • Core improvement
  • Other (please describe)

📝 What does this change do?

This pull request introduces significant improvements to the modular biped system, focusing on bus servo management, controller input handling, and system loop architecture. The changes lay the groundwork for more sophisticated robot control but contain several areas that need attention before merging.

Key Changes
New System Loop Architecture: Refactored the main loop into a dedicated SystemLoop class with state management (running/throttled/sleeping) and improved resource management
Xbox Controller Support: Added comprehensive Xbox controller input handling with configurable button/axis mappings and a handler for converting inputs to robot actions
Bus Servo Management: Implemented support for ST and SC series bus servos with calibration, position control, and SDK integration

❓ Why is this change needed?

🛠️ How was this implemented?

🧪 How was this tested?

💥 Breaking changes

  • Yes (please describe)
  • No

🗂 Related issues

✅ PR Checklist

  • Title & Description: PR title and description are clear and complete.
  • Documentation: PR links to idea in github discussion group containing complete documentation.
  • Scope & Size: PR is focused on a single issue/feature and is a reasonable size.
  • Code Quality: Code is clean, consistent, and follows the project style guide.
  • Tests: Tests have been added/updated if needed.
  • Manual Testing: Changes have been tested on the latest release of the project.
  • Self-Review: I’ve reviewed my own code and ensured there are no obvious issues.

🚀 Thank you for your contribution to the project!

@danic85
danic85 marked this pull request as ready for review December 16, 2025 23:09
@danic85

danic85 commented Dec 16, 2025

Copy link
Copy Markdown
Collaborator Author

Currently there is an issue with the tft eye not behaving correctly when starting on boot, but seems to work fine after restarting using CLI. Need to debug this before merge. Everything else is working correctly (with some improvements needed to the controller axis handler).

@danic85
danic85 requested a review from Copilot December 21, 2025 18:02
@danic85

danic85 commented Dec 21, 2025

Copy link
Copy Markdown
Collaborator Author

Currently there is an issue with the tft eye not behaving correctly when starting on boot, but seems to work fine after restarting using CLI. Need to debug this before merge. Everything else is working correctly (with some improvements needed to the controller axis handler).

This was caused by some code at the top of the serial bus servo code that was used in the example to get input from the user, but was not needed in this module. Apparently it relied on a terminal being present, which was not the case for the service created by the autolauncher. Removing this code resolved the issue.

I added the command to debug autolauncher issues in the output from enabling autolauncher.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This WIP pull request introduces significant improvements to the modular biped system, focusing on bus servo management, controller input handling, and system loop architecture. The changes lay the groundwork for more sophisticated robot control but contain several areas that need attention before merging.

Key Changes

  • New System Loop Architecture: Refactored the main loop into a dedicated SystemLoop class with state management (running/throttled/sleeping) and improved resource management
  • Xbox Controller Support: Added comprehensive Xbox controller input handling with configurable button/axis mappings and a handler for converting inputs to robot actions
  • Bus Servo Management: Implemented support for ST and SC series bus servos with calibration, position control, and SDK integration

Reviewed changes

Copilot reviewed 83 out of 84 changed files in this pull request and generated 86 comments.

Show a summary per file
File Description
system_loop.py New system loop class with state management and periodic event publishing
main.py Refactored to use SystemLoop and support environment-based module loading
module_loader.py Added environment filtering to selectively load modules based on deployment context
modules/xbox_controller.py Low-level Xbox controller input reading and normalization
modules/controller_handler.py Maps controller inputs to robot actions via configurable YAML mappings
modules/actuators/bus_servo/servo.py Comprehensive servo control with calibration and dual SDK support
modules/pitemperature.py Migrated to background threading with enhanced temperature monitoring
modules/personality.py Replaced datetime with time.time() for consistency
modules/gpio/motion.py Converted to background thread polling with time-since-motion tracking
modules/display/tft_display_eye.py Added smooth eye movement with background thread animation
tests/ Added comprehensive tests for new modules (controller, module_loader, input_recorder)
docs/ Added documentation for XboxController, SystemLoop, ModuleLoader, and BusServo
config/ Added environment field to vision and temperature configs

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread modules/actuators/bus_servo/servo.py Resolved
Comment thread modules/xbox_controller.py Resolved
Comment thread modules/network/messaging_service.py Resolved
Comment thread modules/audio/ttsmodule.py Resolved
Comment thread system_loop.py Resolved
Comment thread system_loop.py Resolved
Comment thread tests/test_input_recorder.py Resolved
Comment thread tests/test_module_loader.py Resolved
Comment thread tests/test_module_loader.py Resolved
Comment thread modules/actuators/bus_servo/servo.py Resolved
@danic85 danic85 changed the title WIP bus servo management Bus servo management. Improvements to framework including temperature management Dec 21, 2025

Copilot AI commented Dec 21, 2025

Copy link
Copy Markdown

@danic85 I've opened a new pull request, #146, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 83 out of 84 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread startup.sh Resolved

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 83 out of 84 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@danic85
danic85 merged commit f666763 into develop Dec 21, 2025
13 checks passed
@danic85
danic85 deleted the feature/bus_servos branch December 21, 2025 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants