mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-26 01:35:35 +03:00
Merge branch 'master' of https://github.com/iNavFlight/inav into submit-gps-fix-estimation
This commit is contained in:
commit
9a633d1337
32 changed files with 960 additions and 368 deletions
|
@ -3905,9 +3905,7 @@ static navigationFSMEvent_t selectNavEventFromBoxModeInput(void)
|
|||
/* Soaring mode, disables altitude control in Position hold and Course hold modes.
|
||||
* Pitch allowed to freefloat within defined Angle mode deadband */
|
||||
if (IS_RC_MODE_ACTIVE(BOXSOARING) && (FLIGHT_MODE(NAV_POSHOLD_MODE) || FLIGHT_MODE(NAV_COURSE_HOLD_MODE))) {
|
||||
if (!FLIGHT_MODE(SOARING_MODE)) {
|
||||
ENABLE_FLIGHT_MODE(SOARING_MODE);
|
||||
}
|
||||
ENABLE_FLIGHT_MODE(SOARING_MODE);
|
||||
} else {
|
||||
DISABLE_FLIGHT_MODE(SOARING_MODE);
|
||||
}
|
||||
|
@ -4582,3 +4580,21 @@ int32_t navigationGetHeadingError(void)
|
|||
{
|
||||
return wrap_18000(posControl.desiredState.yaw - posControl.actualState.cog);
|
||||
}
|
||||
|
||||
int8_t navCheckActiveAngleHoldAxis(void)
|
||||
{
|
||||
int8_t activeAxis = -1;
|
||||
|
||||
if (IS_RC_MODE_ACTIVE(BOXANGLEHOLD)) {
|
||||
navigationFSMStateFlags_t stateFlags = navGetCurrentStateFlags();
|
||||
bool altholdActive = stateFlags & NAV_REQUIRE_ANGLE_FW && !(stateFlags & NAV_REQUIRE_ANGLE);
|
||||
|
||||
if (FLIGHT_MODE(NAV_COURSE_HOLD_MODE) && !FLIGHT_MODE(NAV_ALTHOLD_MODE)) {
|
||||
activeAxis = FD_PITCH;
|
||||
} else if (altholdActive) {
|
||||
activeAxis = FD_ROLL;
|
||||
}
|
||||
}
|
||||
|
||||
return activeAxis;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue