Skip to content

Commit ce54273

Browse files
Merge pull request #49 from larus-breeze/switch_mag_calibration_report
Switchable mag calibration report.
2 parents 987bb73 + 0b65f81 commit ce54273

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

NAV_Algorithms/AHRS.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,8 @@ void AHRS_type::handle_magnetic_calibration ( void)
404404
{
405405
bool calibration_changed = compass_calibration.set_calibration_if_changed ( mag_calibration_data_collector_right_turn, mag_calibration_data_collector_left_turn, MAG_SCALE);
406406

407+
#if REPORT_MAGNETIC_CALIBRATION == 1
408+
407409
if( calibration_changed)
408410
{
409411
magnetic_induction_report_t magnetic_induction_report;
@@ -412,6 +414,10 @@ void AHRS_type::handle_magnetic_calibration ( void)
412414

413415
magnetic_calibration_updated = true;
414416
}
417+
#else
418+
(void)calibration_changed;
419+
(void)type;
420+
#endif
415421
}
416422

417423
void AHRS_type::filter_magnetic_induction( const float3vector &gyro, float3vector &mag)
@@ -420,5 +426,3 @@ void AHRS_type::filter_magnetic_induction( const float3vector &gyro, float3vecto
420426
for( unsigned i=0; i<3; ++i)
421427
mag[i] = mag_filter[i].respond(mag[i], absolute_rotation * Ts * MAX_EXPECTED_INDUCTION_SLOPE);
422428
}
423-
424-

0 commit comments

Comments
 (0)