Skip to content

Commit 0b65f81

Browse files
Merge branch 'main' into switch_mag_calibration_report
2 parents 2e7fe57 + 987bb73 commit 0b65f81

File tree

5 files changed

+9
-21
lines changed

5 files changed

+9
-21
lines changed

NAV_Algorithms/AHRS.cpp

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ AHRS_type::update_diff_GNSS (const float3vector &gyro,
298298

299299
// when circling is finished eventually update the magnetic calibration
300300
if (automatic_magnetic_calibration && (old_circle_state == CIRCLING) && (circling_state == TRANSITION))
301-
handle_magnetic_calibration ('s');
301+
handle_magnetic_calibration();
302302
}
303303

304304
/**
@@ -384,7 +384,7 @@ AHRS_type::update_compass (const float3vector &gyro, const float3vector &acc,
384384

385385
// when circling is finished eventually update the magnetic calibration
386386
if (automatic_magnetic_calibration && (old_circle_state == CIRCLING) && (circling_state == TRANSITION))
387-
handle_magnetic_calibration('m');
387+
handle_magnetic_calibration();
388388
}
389389

390390
void AHRS_type::write_calibration_into_EEPROM( void)
@@ -400,18 +400,18 @@ void AHRS_type::write_calibration_into_EEPROM( void)
400400
lock_EEPROM( true);
401401
}
402402

403-
void AHRS_type::handle_magnetic_calibration ( char type)
403+
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

407407
#if REPORT_MAGNETIC_CALIBRATION == 1
408+
408409
if( calibration_changed)
409410
{
410411
magnetic_induction_report_t magnetic_induction_report;
411412
for( unsigned i=0; i<3; ++i)
412413
magnetic_induction_report.calibration[i] = (compass_calibration.get_calibration())[i];
413414

414-
report_magnetic_calibration_has_changed( &magnetic_induction_report, type);
415415
magnetic_calibration_updated = true;
416416
}
417417
#else
@@ -424,14 +424,5 @@ void AHRS_type::filter_magnetic_induction( const float3vector &gyro, float3vecto
424424
{
425425
float absolute_rotation = gyro.abs();
426426
for( unsigned i=0; i<3; ++i)
427-
{
428-
float max_expected_slope;
429-
if( mag[i] > 0.95f)
430-
max_expected_slope = 0.3124f; // = sqrt( 1 - 0.95^2)
431-
else
432-
max_expected_slope = SQRT( 1.0f - SQR( mag[i]));
433-
mag[i] = mag_filter[i].respond(mag[i], absolute_rotation * Ts * max_expected_slope);
434-
}
427+
mag[i] = mag_filter[i].respond(mag[i], absolute_rotation * Ts * MAX_EXPECTED_INDUCTION_SLOPE);
435428
}
436-
437-

NAV_Algorithms/AHRS.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ class AHRS_type
193193
}
194194
enum magnetic_calibration_type { NONE, AUTO_1D, AUTO_SOFT_IRON_COMPENSATE};
195195
private:
196-
void handle_magnetic_calibration( char type);
196+
void handle_magnetic_calibration( void);
197197

198198
void update_magnetic_loop_gain( void)
199199
{

NAV_Algorithms/NAV_tuning_parameters.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
#define MAG_SCALE_CHANGE_LIMIT 0.02f
3131
#define USE_SOFT_IRON_COMPENSATION 0
3232

33+
#define MAX_EXPECTED_INDUCTION_SLOPE 1.1f
34+
3335
#define CIRCLE_LIMIT (10 * 100) //!< 10 * 1/100 s delay into / out of circling state
3436

3537
// filters for CAN information (turn-coordinator, G-load ...)

NAV_Algorithms/data_structures.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ typedef struct
4141
float static_pressure;
4242
float static_sensor_temperature; //log temperature to monitor temperature in enclosure
4343
float supply_voltage; //Measuring the supply voltage. Might be related to sensor noise.
44-
#if WITH_DENSITY_DATA
45-
float outside_air_temperature; //!< OAT from external sensor if installed
46-
float outside_air_humidity; //!< 0.0 -> 1.0 NOT percent
47-
#endif
4844
} measurement_data_t;
4945

5046
//! this structure contains all the observations from all sensors and the GNSS-receiver

NAV_Algorithms/persistent_data.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ typedef union
3737

3838
enum GNSS_configration_t
3939
{
40-
GNSS_NONE, // not really useful
41-
GNSS_M9N, // single frequency module, usually on PCB
40+
GNSS_M9N=1, // single frequency module, usually on PCB
4241
GNSS_F9P_F9P, // D-GNSS using 2 * uBlox F9P, both on USART 3
4342
GNSS_F9P_F9H // D-GNSS using F9P on USART 3 and F9H (heading) on USART4
4443
};

0 commit comments

Comments
 (0)