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

Fix reject_mag* and imu_coning* key errors #21717

Merged
merged 1 commit into from
Jun 22, 2023
Merged
Show file tree
Hide file tree
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
13 changes: 8 additions & 5 deletions Tools/ecl_ekf/analysis/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,14 @@ def perform_imu_checks(
# perform the vibration check
imu_status['imu_vibration_check'] = 'Pass'
for imu_vibr_metric in ['imu_coning', 'imu_hfgyro', 'imu_hfaccel']:
mean_metric = '{:s}_mean'.format(imu_vibr_metric)
peak_metric = '{:s}_peak'.format(imu_vibr_metric)
if imu_metrics[mean_metric] > check_levels['{:s}_warn'.format(mean_metric)] \
or imu_metrics[peak_metric] > check_levels['{:s}_warn'.format(peak_metric)]:
imu_status['imu_vibration_check'] = 'Warning'
mean_metric = '{:s}_mean_warn'.format(imu_vibr_metric)
peak_metric = '{:s}_peak_warn'.format(imu_vibr_metric)
mean_key = '{:s}_mean'.format(imu_vibr_metric)
peak_key = '{:s}_peak'.format(imu_vibr_metric)
if mean_key in imu_metrics and peak_key in imu_metrics:
if imu_metrics[mean_key] > check_levels[mean_metric] \
or imu_metrics[peak_key] > check_levels[peak_metric]:
imu_status['imu_vibration_check'] = 'Warning'

if imu_status['imu_vibration_check'] == 'Warning':
print('IMU vibration check warning.')
Expand Down
6 changes: 3 additions & 3 deletions Tools/ecl_ekf/analysis/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ def calculate_innov_fail_metrics(

# calculate innovation check fail metrics
for signal_id, signal, result in [('posv', 'reject_ver_pos', 'hgt_fail_percentage'),
('magx', 'reject_mag_x', 'magx_fail_percentage'),
('magy', 'reject_mag_y', 'magy_fail_percentage'),
('magz', 'reject_mag_z', 'magz_fail_percentage'),
('magx', 'fs_bad_mag_x', 'magx_fail_percentage'),
('magy', 'fs_bad_mag_y', 'magy_fail_percentage'),
('magz', 'fs_bad_mag_z', 'magz_fail_percentage'),
('yaw', 'reject_yaw', 'yaw_fail_percentage'),
('velh', 'reject_hor_vel', 'vel_fail_percentage'),
('velv', 'reject_ver_vel', 'vel_fail_percentage'),
Expand Down
2 changes: 1 addition & 1 deletion Tools/ecl_ekf/plotting/pdf_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def create_pdf_report(ulog: ULog, multi_instance: int, output_plot_filename: str
data_plot = CheckFlagsPlot(
status_flags_time, estimator_status_flags, [['reject_hor_vel', 'reject_hor_pos'], ['reject_ver_vel', 'reject_ver_pos',
'reject_hagl'],
['reject_mag_x', 'reject_mag_y', 'reject_mag_z',
['fs_bad_mag_x', 'fs_bad_mag_y', 'fs_bad_mag_z',
'reject_yaw'], ['reject_airspeed'], ['reject_sideslip'],
['reject_optflow_x',
'reject_optflow_y']], x_label='time (sec)',
Expand Down