Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow full compass calibration with location sources other than GPS #27409

Merged
merged 2 commits into from
Jul 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions libraries/AP_Compass/CompassCalibrator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1065,14 +1065,15 @@ 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)) {
GCS_SEND_TEXT(MAV_SEVERITY_WARNING, "MagCal: No location, fix_radius skipped");
// 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
Loading