Replace EKF/common.h #defines with enums.

This commit is contained in:
mcsauder
2022-05-18 09:25:19 -04:00
committed by Daniel Agar
parent 8f2c84d36f
commit ea10eacb99
17 changed files with 171 additions and 164 deletions
+4 -4
View File
@@ -55,7 +55,7 @@
#define MASK_GPS_HSPD (1<<7)
#define MASK_GPS_VSPD (1<<8)
bool Ekf::collect_gps(const gps_message &gps)
bool Ekf::collect_gps(const gpsMessage &gps)
{
// Run GPS checks always
_gps_checks_passed = gps_is_good(gps);
@@ -92,7 +92,7 @@ bool Ekf::collect_gps(const gps_message &gps)
_mag_strength_gps = get_mag_strength_gauss(lat, lon);
// request a reset of the yaw using the new declination
if ((_params.mag_fusion_type != MAG_FUSE_TYPE_NONE)
if ((_params.mag_fusion_type != MagFuseType::NONE)
&& !declination_was_valid) {
_mag_yaw_reset_req = true;
}
@@ -120,7 +120,7 @@ bool Ekf::collect_gps(const gps_message &gps)
_mag_strength_gps = get_mag_strength_gauss(lat, lon);
// request mag yaw reset if there's a mag declination for the first time
if (_params.mag_fusion_type != MAG_FUSE_TYPE_NONE) {
if (_params.mag_fusion_type != MagFuseType::NONE) {
if (!declination_was_valid && PX4_ISFINITE(_mag_declination_gps)) {
_mag_yaw_reset_req = true;
}
@@ -141,7 +141,7 @@ bool Ekf::collect_gps(const gps_message &gps)
* Checks are activated using the EKF2_GPS_CHECK bitmask parameter
* Checks are adjusted using the EKF2_REQ_* parameters
*/
bool Ekf::gps_is_good(const gps_message &gps)
bool Ekf::gps_is_good(const gpsMessage &gps)
{
// Check the fix type
_gps_check_fail_status.flags.fix = (gps.fix_type < 3);