mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-23 00:05:28 +03:00
Update master
This commit is contained in:
parent
566d971026
commit
e4554fa509
3 changed files with 8 additions and 6 deletions
|
@ -56,6 +56,8 @@
|
|||
#include "sensors/sensors.h"
|
||||
#include "sensors/acceleration.h"
|
||||
#include "sensors/boardalignment.h"
|
||||
#include "sensors/battery.h"
|
||||
|
||||
|
||||
// Multirotors:
|
||||
#define MR_RTH_CLIMB_OVERSHOOT_CM 100 // target this amount of cm *above* the target altitude to ensure it is actually reached (Vz > 0 at target alt)
|
||||
|
@ -2564,7 +2566,7 @@ void updateLandingStatus(void)
|
|||
disarm(DISARM_LANDING);
|
||||
} else if (!navigationIsFlyingAutonomousMode()) {
|
||||
// for multirotor only - reactivate landing detector without disarm when throttle raised toward hover throttle
|
||||
landingDetectorIsActive = rxGetChannelValue(THROTTLE) < (0.5 * (navConfig()->mc.hover_throttle + getThrottleIdleValue()));
|
||||
landingDetectorIsActive = rxGetChannelValue(THROTTLE) < (0.5 * (currentBatteryProfile->nav.mc.hover_throttle + getThrottleIdleValue()));
|
||||
}
|
||||
} else if (isLandingDetected()) {
|
||||
ENABLE_STATE(LANDING_DETECTED);
|
||||
|
|
|
@ -245,18 +245,18 @@ static int8_t loiterDirection(void) {
|
|||
|
||||
if (pidProfile()->loiter_direction == NAV_LOITER_YAW) {
|
||||
|
||||
if (rcCommand[YAW] < -250) {
|
||||
if (rcCommand[YAW] < -250) {
|
||||
loiterDirYaw = 1; //RIGHT //yaw is contrariwise
|
||||
}
|
||||
|
||||
if (rcCommand[YAW] > 250) {
|
||||
if (rcCommand[YAW] > 250) {
|
||||
loiterDirYaw = -1; //LEFT //see annexCode in fc_core.c
|
||||
}
|
||||
|
||||
dir = loiterDirYaw;
|
||||
}
|
||||
|
||||
if (IS_RC_MODE_ACTIVE(BOXLOITERDIRCHN)) {
|
||||
if (IS_RC_MODE_ACTIVE(BOXLOITERDIRCHN)) {
|
||||
dir *= -1;
|
||||
}
|
||||
|
||||
|
@ -599,7 +599,7 @@ bool isFixedWingFlying(void)
|
|||
#ifdef USE_PITOT
|
||||
airspeed = pitot.airSpeed;
|
||||
#endif
|
||||
bool throttleCondition = rcCommand[THROTTLE] > navConfig()->fw.cruise_throttle;
|
||||
bool throttleCondition = rcCommand[THROTTLE] > currentBatteryProfile->nav.fw.cruise_throttle;
|
||||
bool velCondition = posControl.actualState.velXY > 250 || airspeed > 250;
|
||||
|
||||
return isImuHeadingValid() && throttleCondition && velCondition;
|
||||
|
|
|
@ -677,7 +677,7 @@ static void applyMulticopterPositionController(timeUs_t currentTimeUs)
|
|||
|
||||
bool isMulticopterFlying(void)
|
||||
{
|
||||
bool throttleCondition = rcCommand[THROTTLE] > navConfig()->mc.hover_throttle;
|
||||
bool throttleCondition = rcCommand[THROTTLE] > currentBatteryProfile->nav.mc.hover_throttle;
|
||||
bool gyroCondition = averageAbsGyroRates() > 7.0f;
|
||||
|
||||
return throttleCondition && gyroCondition;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue