Skip to content

Commit

Permalink
AP_Compass: use ahrs for location instead of GPS directly for calibra…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
Williangalvani committed Jul 2, 2024
1 parent c388943 commit 22425ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libraries/AP_Compass/CompassCalibrator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1065,14 +1065,14 @@ bool CompassCalibrator::calculate_orientation(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
// will disable use of WMM in the EKF. Users can manually set
// scale factor after calibration if it is known
_params.scale_factor = 0;
return true;
}
const Location &loc = AP::gps().location();
float intensity;
float declination;
float inclination;
Expand Down

0 comments on commit 22425ba

Please sign in to comment.