mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-25 01:05:21 +03:00
rth trackback tweaks
This commit is contained in:
parent
b96c3d4c1f
commit
c9779c2dee
3 changed files with 11 additions and 14 deletions
|
@ -301,10 +301,6 @@ bool validateRTHSanityChecker(void);
|
|||
void updateHomePosition(void);
|
||||
bool abortLaunchAllowed(void);
|
||||
|
||||
// static bool rthAltControlStickOverrideCheck(unsigned axis);
|
||||
// static void updateRthTrackback(bool forceSaveTrackPoint);
|
||||
// static fpVector3_t * rthGetTrackbackPos(void);
|
||||
|
||||
#ifdef USE_FW_AUTOLAND
|
||||
static float getLandAltitude(void);
|
||||
static int32_t calcWindDiff(int32_t heading, int32_t windHeading);
|
||||
|
@ -1449,7 +1445,7 @@ static navigationFSMEvent_t navOnEnteringState_NAV_STATE_RTH_INITIALIZE(navigati
|
|||
}
|
||||
else {
|
||||
// Switch to RTH trackback
|
||||
if (rthTrackBackIsActive() && rth_trackback.activePointIndex >= 0 && !isWaypointMissionRTHActive()) {
|
||||
if (rthTrackBackCanBeActivated() && rth_trackback.activePointIndex >= 0 && !isWaypointMissionRTHActive()) {
|
||||
rthTrackBackUpdate(true); // save final trackpoint for altitude and max trackback distance reference
|
||||
posControl.flags.rthTrackbackActive = true;
|
||||
calculateAndSetActiveWaypointToLocalPosition(getRthTrackBackPosition());
|
||||
|
@ -1568,7 +1564,7 @@ static navigationFSMEvent_t navOnEnteringState_NAV_STATE_RTH_TRACKBACK(navigatio
|
|||
return NAV_FSM_EVENT_SWITCH_TO_EMERGENCY_LANDING;
|
||||
}
|
||||
|
||||
if (rthTrackBackSetNewPosition()) {
|
||||
if (!rthTrackBackSetNewPosition()) {
|
||||
return NAV_FSM_EVENT_SWITCH_TO_NAV_STATE_RTH_INITIALIZE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue