mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-27 02:13:33 +08:00
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:
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user