Skip to content
Snippets Groups Projects
Commit 5935b185 authored by James Goppert's avatar James Goppert Committed by Lorenz Meier
Browse files

Added EPH/EPV min to LPE. (#4915)

parent 04e8b40a
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,8 @@ extern orb_advert_t mavlink_log_pub;
// to initialize
static const uint32_t REQ_GPS_INIT_COUNT = 10;
static const uint32_t GPS_TIMEOUT = 1000000; // 1.0 s
static const float GPS_EPH_MIN = 2.0; // m, min allowed by gps self reporting
static const float GPS_EPV_MIN = 2.0; // m, min allowed by gps self reporting
void BlockLocalPositionEstimator::gpsInit()
{
......@@ -122,12 +124,12 @@ void BlockLocalPositionEstimator::gpsCorrect()
float var_vxy = _gps_vxy_stddev.get() * _gps_vxy_stddev.get();
float var_vz = _gps_vz_stddev.get() * _gps_vz_stddev.get();
// if field is not zero, set it to the value provided
if (_sub_gps.get().eph > 1e-3f) {
// if field is not below minimum, set it to the value provided
if (_sub_gps.get().eph > GPS_EPH_MIN) {
var_xy = _sub_gps.get().eph * _sub_gps.get().eph;
}
if (_sub_gps.get().epv > 1e-3f) {
if (_sub_gps.get().epv > GPS_EPV_MIN) {
var_z = _sub_gps.get().epv * _sub_gps.get().epv;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment