-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Split RadioComponentController into based class for use with both RC and Joystick cal #13732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
DonLakeFlyer
commented
Dec 12, 2025
- Joystick cal was a duplicated and hacked up version of the RC Cal code. Not only is that crappy, but because of that it was missing some basic functionality which was in RC cal
- Split RadioComponentController code into RadioComponentController which is RC cal specific and generic RemoteControlCalibrationController base class which will be common to RC and Joystick cal
- Updated RC Cal to use the new base class
- Joystick updates to use base class still not done and will come in a later pull
- First step along the way to cleaning up Feature: Add QML-configurable gimbal max speed and deadzones #13280 and joystick cal and gimbal cal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors the radio calibration code by extracting a generic RemoteControlCalibrationController base class from the existing RadioComponentController, setting the stage for reusing the calibration logic for both RC transmitters and joysticks. The refactoring eliminates code duplication and improves maintainability.
Key Changes:
- Created abstract base class
RemoteControlCalibrationControllercontaining common calibration state machine and channel management logic - Converted
RadioComponentControllerto inherit from the new base class, implementing RC-specific parameter storage/retrieval - Standardized signal naming across codebase (
channelRCValueChanged→channelValueChanged,_rcChannelsChanged→channelValuesChanged) - Added bounds checking in
Vehicle.ccto prevent channel count overflow
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
src/Vehicle/VehicleSetup/RemoteControlCalibrationController.h/.cc |
New abstract base class for RC/Joystick calibration with shared state machine logic |
src/AutoPilotPlugins/Common/RadioComponentController.h/.cc |
Refactored to inherit from base class, implements parameter-specific overrides |
src/Vehicle/Vehicle.cc |
Added std::min() bounds check for channel count in MAVLink message handling |
src/QmlControls/RCChannelMonitorController.h/.cc |
Renamed signal/slot to match new naming convention |
src/QmlControls/RCChannelMonitor.qml |
Updated QML signal handler names |
src/AutoPilotPlugins/Common/RadioComponent.qml |
Updated QML signal handler names, adjusted UI column width |
src/AutoPilotPlugins/PX4/PX4SimpleFlightModesController.h/.cc |
Renamed slot to match new naming convention |
src/AutoPilotPlugins/APM/APMFlightModesComponentController.h/.cc |
Renamed slot to match new naming convention |
test/CMakeLists.txt |
Removed commented-out test references |
test/AutoPilotPlugins/RadioConfigTest.h/.cc |
Removed old test files (were already disabled) |
test/AutoPilotPlugins/CMakeLists.txt |
Removed test directory CMake configuration |
src/Vehicle/VehicleSetup/CMakeLists.txt |
Added new base class files to build |
* Split RadioComponentController into generic RemoteControlCalibrationController which can be used by both RC and Joystick cal * Updated RadioComponentController to use new RemoteControlCalibrationController base class
754b31a to
9fc68c1
Compare