mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-23 16:25:26 +03:00
NAV: Configurable position sensor timeout. Ability to disable emergency landing
This commit is contained in:
parent
c8b7e8ae74
commit
e321526a3f
5 changed files with 43 additions and 28 deletions
|
@ -22,7 +22,6 @@
|
|||
#define DISTANCE_BETWEEN_TWO_LONGITUDE_POINTS_AT_EQUATOR 1.113195f // MagicEarthNumber from APM
|
||||
|
||||
#define LAND_DETECTOR_TRIGGER_TIME_MS 2000 // 2 seconds
|
||||
#define NAV_WAIT_FOR_GPS_TIMEOUT_MS 5000 // GPS wait time-out 5 sec
|
||||
|
||||
#define MIN_POSITION_UPDATE_RATE_HZ 5 // Minimum position update rate at which XYZ controllers would be applied
|
||||
|
||||
|
@ -218,11 +217,9 @@ typedef struct {
|
|||
|
||||
typedef struct {
|
||||
/* Flags and navigation system state */
|
||||
navigationFSMState_t navState;
|
||||
uint32_t navStateActivationTimeMs;
|
||||
navigationFSMState_t navState;
|
||||
|
||||
bool enabled;
|
||||
navigationFlags_t flags;
|
||||
navigationFlags_t flags;
|
||||
|
||||
/* Navigation PID controllers + pre-computed flight parameters */
|
||||
navigationPIDControllers_t pids;
|
||||
|
@ -233,6 +230,9 @@ typedef struct {
|
|||
navigationEstimatedState_t actualState;
|
||||
navigationDesiredState_t desiredState; // waypoint coordinates + velocity
|
||||
|
||||
uint32_t lastValidPositionTimeMs;
|
||||
uint32_t lastValidAltitudeTimeMs;
|
||||
|
||||
/* INAV GPS origin (position where GPS fix was first acquired) */
|
||||
gpsOrigin_s gpsOrigin;
|
||||
|
||||
|
@ -296,6 +296,8 @@ void updateActualHorizontalPositionAndVelocity(bool hasValidSensor, float newX,
|
|||
void updateActualAltitudeAndClimbRate(bool hasValidSensor, float newAltitude, float newVelocity);
|
||||
void updateActualSurfaceDistance(bool hasValidSensor, float surfaceDistance, float surfaceVelocity);
|
||||
|
||||
bool checkForPositionSensorTimeout(void);
|
||||
|
||||
bool isGPSGlitchDetected(void);
|
||||
|
||||
/* Autonomous navigation functions */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue