Repository navigation
Bus servo management. Improvements to framework including temperature management - #143
Conversation
|
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. |
There was a problem hiding this comment.
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
SystemLoopclass 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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
What type of change is this?
📝 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
🗂 Related issues
✅ PR Checklist
🚀 Thank you for your contribution to the project!