Refactor control subsystem

Add interpretControls function to convert pilot commands and mode into control targets and make control functions independent from the mode.
Add ratesExtra target for rates feed-forward; remove yawMode.
Rename controlRate to controlRates to reflect rates variable name.
Remove USER mode.
This commit is contained in:
Oleg Kalachev
2025-08-26 01:00:56 +03:00
parent a1539157b8
commit 8418723ccc
8 changed files with 88 additions and 62 deletions

View File

@@ -102,8 +102,8 @@ void handleMavlink(const void *_msg) {
controlPitch = m.x / 1000.0f * mavlinkControlScale;
controlRoll = m.y / 1000.0f * mavlinkControlScale;
controlYaw = m.r / 1000.0f * mavlinkControlScale;
controlMode = 1; // STAB mode
controlArmed = 1; // armed
controlMode = NAN;
controlArmed = NAN;
controlTime = t;
if (abs(controlYaw) < MAVLINK_CONTROL_YAW_DEAD_ZONE) controlYaw = 0;