def calc_estimator_status_metrics(self) -> Dict[str, list]: """ calculates the estimator status metrics :return: """ estimator_status_metrics = dict() estimator_status_data = self.ulog.get_dataset('estimator_status').data # add windowed metrics estimator_status_metrics['{:s}_percentage_red_windowed'.format(self._check_id)] = \ calculate_windowed_mean_per_airphase( estimator_status_data, 'estimator_status', self._test_ratio_name, self._in_air_detector, threshold=params.ecl_red_thresh(), window_len_s=params.ecl_window_len_s()) estimator_status_metrics['{:s}_percentage_amber_windowed'.format(self._check_id)] = \ calculate_windowed_mean_per_airphase( estimator_status_data, 'estimator_status', self._test_ratio_name, self._in_air_detector, threshold=params.ecl_amb_thresh(), window_len_s=params.ecl_window_len_s()) estimator_status_metrics['{:s}_test_windowed_mean'.format(self._check_id)] = \ calculate_windowed_mean_per_airphase( estimator_status_data, 'estimator_status', self._test_ratio_name, self._in_air_detector, window_len_s=params.ecl_window_len_s()) return estimator_status_metrics
def calculate_metrics(self) -> Dict[str, list]: """ calculates the estimator status metrics :return: """ estimator_status_data = self.ulog.get_dataset("estimator_status").data imu_metrics = dict() # calculates peak and mean for IMU vibration checks for signal, result in [ ("vibe[0]", "imu_coning"), ("vibe[1]", "imu_hfdang"), ("vibe[2]", "imu_hfdvel"), ]: imu_metrics["{:s}_windowed_mean".format( result)] = calculate_windowed_mean_per_airphase( estimator_status_data, "estimator_status", signal, self._in_air_detector_no_ground_effects, window_len_s=params.ecl_window_len_s(), ) return imu_metrics
def calculate_metrics(self) -> Dict[str, list]: """ calculates the estimator status metrics :return: """ estimator_states_data = self.ulog.get_dataset( self._estimator_states_msg).data imu_metrics = dict() for signal in [ "states[10]", "states[11]", "states[12]", "states[13]", "states[14]", "states[15]", ]: imu_metrics["{:s}_windowed_mean".format( signal)] = calculate_windowed_mean_per_airphase( estimator_states_data, self._estimator_states_msg, signal, self._in_air_detector_no_ground_effects, window_len_s=params.ecl_window_len_s(), ) return imu_metrics
def calculate_metrics(self) -> Dict[str, list]: """ calculates the estimator status metrics :return: """ output_tracking_error_msg = get_output_tracking_error_message( self.ulog) output_tracking_error_data = self.ulog.get_dataset( output_tracking_error_msg).data imu_metrics = dict() # calculates the median of the output tracking error ekf innovations for signal, result in [ ("output_tracking_error[0]", "output_obs_ang_err_median"), ("output_tracking_error[1]", "output_obs_vel_err_median"), ("output_tracking_error[2]", "output_obs_pos_err_median"), ]: # calculate a windowed version of the stat: # TODO: currently takes the mean instead of median imu_metrics["{:s}_windowed_mean".format( result)] = calculate_windowed_mean_per_airphase( output_tracking_error_data, output_tracking_error_msg, signal, self._in_air_detector_no_ground_effects, window_len_s=params.ecl_window_len_s(), ) return imu_metrics
def calc_innovation_metrics(self) -> Dict[str, list]: """ calculates the innovation metrics :return: """ innovation_metrics = dict() for innov_fail_name in self._innov_fail_names: innovation_metrics['{:s}_fail_short_window_mean'.format(innov_fail_name)] = \ calculate_windowed_mean_per_airphase( self._innov_flags, 'estimator_status', innov_fail_name, self._in_air_detector_no_ground_effects, threshold=0.5, window_len_s=params.ecl_short_rolling_window_len_s()) innovation_metrics['{:s}_fail_long_window_mean'.format(innov_fail_name)] = \ calculate_windowed_mean_per_airphase( self._innov_flags, 'estimator_status', innov_fail_name, self._in_air_detector_no_ground_effects, threshold=0.5, window_len_s=params.ecl_long_rolling_window_len_s()) return innovation_metrics
def calculate_metrics(self) -> Dict[str, list]: """ calculates the estimator status metrics :return: """ estimator_status_data = self.ulog.get_dataset('estimator_status').data imu_metrics = dict() for signal in [ 'states[10]', 'states[11]', 'states[12]', 'states[13]', 'states[14]', 'states[15]' ]: imu_metrics['{:s}_windowed_mean'.format(signal)] = \ calculate_windowed_mean_per_airphase( estimator_status_data, 'estimator_status', signal, self._in_air_detector_no_ground_effects, window_len_s=params.ecl_window_len_s()) return imu_metrics
def calculate_metrics(self) -> Dict[str, list]: """ calculates the estimator status metrics :return: """ estimator_status_data = self.ulog.get_dataset('estimator_status').data imu_metrics = dict() # calculates peak and mean for IMU vibration checks for signal, result in [('vibe[0]', 'imu_coning'), ('vibe[1]', 'imu_hfdang'), ('vibe[2]', 'imu_hfdvel')]: imu_metrics['{:s}_windowed_mean'.format(result)] = \ calculate_windowed_mean_per_airphase( estimator_status_data, 'estimator_status', signal, self._in_air_detector_no_ground_effects, window_len_s=params.ecl_window_len_s()) return imu_metrics
def calculate_metrics(self) -> Dict[str, list]: """ calculates the estimator status metrics :return: """ ekf2_innovation_data = self.ulog.get_dataset('ekf2_innovations').data imu_metrics = dict() # calculates the median of the output tracking error ekf innovations for signal, result in [ ('output_tracking_error[0]', 'output_obs_ang_err_median'), ('output_tracking_error[1]', 'output_obs_vel_err_median'), ('output_tracking_error[2]', 'output_obs_pos_err_median') ]: # calculate a windowed version of the stat: # TODO: currently takes the mean instead of median imu_metrics['{:s}_windowed_mean'.format(result)] = \ calculate_windowed_mean_per_airphase( ekf2_innovation_data, 'ekf2_innovations', signal, self._in_air_detector_no_ground_effects, window_len_s=params.ecl_window_len_s()) return imu_metrics