mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
AP_Compass: use ahrs for location instead of GPS directly for calibration
This commit is contained in:
parent
b172f086de
commit
ad3a3aefae
@ -1065,14 +1065,14 @@ bool CompassCalibrator::calculate_orientation(void)
|
|||||||
*/
|
*/
|
||||||
bool CompassCalibrator::fix_radius(void)
|
bool CompassCalibrator::fix_radius(void)
|
||||||
{
|
{
|
||||||
if (AP::gps().status() < AP_GPS::GPS_OK_FIX_2D) {
|
Location loc;
|
||||||
|
if (!AP::ahrs().get_location(loc) && !AP::ahrs().get_origin(loc)) {
|
||||||
// we don't have a position, leave scale factor as 0. This
|
// we don't have a position, leave scale factor as 0. This
|
||||||
// will disable use of WMM in the EKF. Users can manually set
|
// will disable use of WMM in the EKF. Users can manually set
|
||||||
// scale factor after calibration if it is known
|
// scale factor after calibration if it is known
|
||||||
_params.scale_factor = 0;
|
_params.scale_factor = 0;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
const Location &loc = AP::gps().location();
|
|
||||||
float intensity;
|
float intensity;
|
||||||
float declination;
|
float declination;
|
||||||
float inclination;
|
float inclination;
|
||||||
|
Loading…
Reference in New Issue
Block a user