mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-27 16:54:15 +01:00
REVONANO Improve GPSAssist
I decided to not check throttle when re-enabling stabii control. It can feel as though the mode is defective. I would rather someone have immediate always-there ability to overridwe gps hold.
This commit is contained in:
parent
b3817007c4
commit
ba903614c6
@ -280,7 +280,6 @@ static void manualControlTask(void)
|
|||||||
|
|
||||||
// assess throttle state
|
// assess throttle state
|
||||||
bool throttleNeutral = false;
|
bool throttleNeutral = false;
|
||||||
bool throttleNeutralOrLow = false;
|
|
||||||
float neutralThrustOffset = 0.0f;
|
float neutralThrustOffset = 0.0f;
|
||||||
VtolSelfTuningStatsNeutralThrustOffsetGet(&neutralThrustOffset);
|
VtolSelfTuningStatsNeutralThrustOffsetGet(&neutralThrustOffset);
|
||||||
|
|
||||||
@ -291,9 +290,6 @@ static void manualControlTask(void)
|
|||||||
if (cmd.Thrust > throttleNeutralLow && cmd.Thrust < throttleNeutralHi) {
|
if (cmd.Thrust > throttleNeutralLow && cmd.Thrust < throttleNeutralHi) {
|
||||||
throttleNeutral = true;
|
throttleNeutral = true;
|
||||||
}
|
}
|
||||||
if (cmd.Thrust < throttleNeutralHi) {
|
|
||||||
throttleNeutralOrLow = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// determine default thrust mode for hold/brake states
|
// determine default thrust mode for hold/brake states
|
||||||
uint8_t pathfollowerthrustmode = FLIGHTSTATUS_ASSISTEDTHROTTLESTATE_MANUAL;
|
uint8_t pathfollowerthrustmode = FLIGHTSTATUS_ASSISTEDTHROTTLESTATE_MANUAL;
|
||||||
@ -371,7 +367,7 @@ static void manualControlTask(void)
|
|||||||
newAssistedThrottleState != FLIGHTSTATUS_ASSISTEDTHROTTLESTATE_MANUAL) {
|
newAssistedThrottleState != FLIGHTSTATUS_ASSISTEDTHROTTLESTATE_MANUAL) {
|
||||||
// ok auto thrust mode applies in hold unless overridden
|
// ok auto thrust mode applies in hold unless overridden
|
||||||
|
|
||||||
if (throttleNeutralOrLow && flagRollPitchHasInput) {
|
if (flagRollPitchHasInput) {
|
||||||
// throttle is neutral approximately and stick input present so revert to primary mode control
|
// throttle is neutral approximately and stick input present so revert to primary mode control
|
||||||
newAssistedControlState = FLIGHTSTATUS_ASSISTEDCONTROLSTATE_PRIMARY;
|
newAssistedControlState = FLIGHTSTATUS_ASSISTEDCONTROLSTATE_PRIMARY;
|
||||||
newAssistedThrottleState = FLIGHTSTATUS_ASSISTEDTHROTTLESTATE_MANUAL; // Effectively None
|
newAssistedThrottleState = FLIGHTSTATUS_ASSISTEDTHROTTLESTATE_MANUAL; // Effectively None
|
||||||
@ -410,8 +406,13 @@ static void manualControlTask(void)
|
|||||||
// During development the assistedcontrol implementation is optional and set
|
// During development the assistedcontrol implementation is optional and set
|
||||||
// set in stabi settings. Once if we decide to always have this on, it can
|
// set in stabi settings. Once if we decide to always have this on, it can
|
||||||
// can be directly set here...i.e. set the flight mode assist as required.
|
// can be directly set here...i.e. set the flight mode assist as required.
|
||||||
case FLIGHTSTATUS_FLIGHTMODE_POSITIONHOLD:
|
|
||||||
case FLIGHTSTATUS_FLIGHTMODE_VELOCITYROAM:
|
case FLIGHTSTATUS_FLIGHTMODE_VELOCITYROAM:
|
||||||
|
newFlightModeAssist = FLIGHTSTATUS_FLIGHTMODEASSIST_GPSASSIST_PRIMARYTHRUST;
|
||||||
|
newAssistedThrottleState = FLIGHTSTATUS_ASSISTEDTHROTTLESTATE_MANUAL;
|
||||||
|
handler = &handler_PATHFOLLOWER;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case FLIGHTSTATUS_FLIGHTMODE_POSITIONHOLD:
|
||||||
case FLIGHTSTATUS_FLIGHTMODE_LAND:
|
case FLIGHTSTATUS_FLIGHTMODE_LAND:
|
||||||
case FLIGHTSTATUS_FLIGHTMODE_AUTOTAKEOFF:
|
case FLIGHTSTATUS_FLIGHTMODE_AUTOTAKEOFF:
|
||||||
newFlightModeAssist = isAssistedFlightMode(position, newMode, &modeSettings);
|
newFlightModeAssist = isAssistedFlightMode(position, newMode, &modeSettings);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user