Skip to content

Conversation

@DonLakeFlyer
Copy link
Collaborator

  • 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

Copilot AI review requested due to automatic review settings December 12, 2025 19:35
Copy link
Contributor

Copilot AI left a 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 RemoteControlCalibrationController containing common calibration state machine and channel management logic
  • Converted RadioComponentController to inherit from the new base class, implementing RC-specific parameter storage/retrieval
  • Standardized signal naming across codebase (channelRCValueChangedchannelValueChanged, _rcChannelsChangedchannelValuesChanged)
  • Added bounds checking in Vehicle.cc to 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
@DonLakeFlyer DonLakeFlyer force-pushed the RemoteControlCalibrationController branch from 754b31a to 9fc68c1 Compare December 12, 2025 20:22
@DonLakeFlyer DonLakeFlyer merged commit 373d72d into master Dec 12, 2025
20 checks passed
@DonLakeFlyer DonLakeFlyer deleted the RemoteControlCalibrationController branch December 12, 2025 22:13
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.

2 participants