simplify world_magnetic_model interface (degrees in, degrees out)

- this hopefully helps avoid accidental mis-use
 - try to clarify units everywhere
This commit is contained in:
Daniel Agar
2024-06-04 09:14:36 -04:00
parent 5fa3b9d86a
commit 157f7cf40b
8 changed files with 52 additions and 72 deletions
@@ -227,8 +227,8 @@ void AttitudeEstimatorQ::update_gps_position()
if (_vehicle_gps_position_sub.update(&gps)) {
if (_param_att_mag_decl_a.get() && (gps.eph < 20.0f)) {
// set magnetic declination automatically
update_mag_declination(get_mag_declination_radians((float)gps.latitude_deg,
(float)gps.longitude_deg));
float mag_decl_deg = get_mag_declination_degrees(gps.latitude_deg, gps.longitude_deg);
update_mag_declination(math::radians(mag_decl_deg));
}
}
}