AP_NavEKF2: add configuredToUseGPSForPosXY

This commit is contained in:
Randy Mackay 2020-11-24 14:53:51 +09:00 committed by Andrew Tridgell
parent 07ffac429b
commit 4087d7b792
2 changed files with 10 additions and 0 deletions

View File

@ -1694,6 +1694,13 @@ bool NavEKF2::isExtNavUsedForYaw() const
return false; return false;
} }
// check if configured to use GPS for horizontal position estimation
bool NavEKF2::configuredToUseGPSForPosXY(void) const
{
// 0 = use 3D velocity, 1 = use 2D velocity, 2 = use no velocity, 3 = do not use GPS
return (_fusionModeGPS.get() != 3);
}
void NavEKF2::requestYawReset(void) void NavEKF2::requestYawReset(void)
{ {
AP::dal().log_event2(AP_DAL::Event::requestYawReset); AP::dal().log_event2(AP_DAL::Event::requestYawReset);

View File

@ -362,6 +362,9 @@ public:
// check if external navigation is being used for yaw observation // check if external navigation is being used for yaw observation
bool isExtNavUsedForYaw(void) const; bool isExtNavUsedForYaw(void) const;
// check if configured to use GPS for horizontal position estimation
bool configuredToUseGPSForPosXY(void) const;
// Writes the default equivalent airspeed in m/s to be used in forward flight if a measured airspeed is required and not available. // Writes the default equivalent airspeed in m/s to be used in forward flight if a measured airspeed is required and not available.
void writeDefaultAirSpeed(float airspeed); void writeDefaultAirSpeed(float airspeed);