mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-23 16:25:26 +03:00
parent
7f3c69e2c2
commit
2ea3f50e5e
5 changed files with 9 additions and 1 deletions
|
@ -713,7 +713,7 @@ void taskMainPidLoop(timeUs_t currentTimeUs)
|
|||
cycleTime = getTaskDeltaTime(TASK_SELF);
|
||||
dT = (float)cycleTime * 0.000001f;
|
||||
|
||||
if (ARMING_FLAG(ARMED) && ((!STATE(FIXED_WING)) || (!isNavLaunchEnabled()) || (isNavLaunchEnabled() && isFixedWingLaunchDetected()))) {
|
||||
if (ARMING_FLAG(ARMED) && (!STATE(FIXED_WING) || !isNavLaunchEnabled() || (isNavLaunchEnabled() && (isFixedWingLaunchDetected() || isFixedWingLaunchFinishedOrAborted())))) {
|
||||
flightTime += cycleTime;
|
||||
}
|
||||
|
||||
|
|
|
@ -1504,6 +1504,7 @@ static navigationFSMEvent_t navOnEnteringState_NAV_STATE_LAUNCH_WAIT(navigationF
|
|||
if (feature(FEATURE_FW_LAUNCH)) {
|
||||
throttleStatus_e throttleStatus = calculateThrottleStatus();
|
||||
if ((throttleStatus == THROTTLE_LOW) && (areSticksDeflectedMoreThanPosHoldDeadband())) {
|
||||
abortFixedWingLaunch();
|
||||
return NAV_FSM_EVENT_SWITCH_TO_IDLE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -417,6 +417,7 @@ bool navigationRTHAllowsLanding(void);
|
|||
|
||||
bool isNavLaunchEnabled(void);
|
||||
bool isFixedWingLaunchDetected(void);
|
||||
bool isFixedWingLaunchFinishedOrAborted(void);
|
||||
|
||||
float calculateAverageSpeed();
|
||||
|
||||
|
|
|
@ -122,6 +122,11 @@ bool isFixedWingLaunchFinishedOrAborted(void)
|
|||
return launchState.launchFinished;
|
||||
}
|
||||
|
||||
void abortFixedWingLaunch(void)
|
||||
{
|
||||
launchState.launchFinished = true;
|
||||
}
|
||||
|
||||
#define LAUNCH_MOTOR_IDLE_SPINUP_TIME 1500 //ms
|
||||
|
||||
static void applyFixedWingLaunchIdleLogic(void)
|
||||
|
|
|
@ -424,6 +424,7 @@ void resetFixedWingLaunchController(timeUs_t currentTimeUs);
|
|||
bool isFixedWingLaunchDetected(void);
|
||||
void enableFixedWingLaunchController(timeUs_t currentTimeUs);
|
||||
bool isFixedWingLaunchFinishedOrAborted(void);
|
||||
void abortFixedWingLaunch(void);
|
||||
void applyFixedWingLaunchController(timeUs_t currentTimeUs);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue