24 changed files with 302 additions and 142 deletions
@ -0,0 +1,48 @@
@@ -0,0 +1,48 @@
|
||||
#! /usr/bin/env python3 |
||||
""" |
||||
function collection for handling different versions of log files |
||||
""" |
||||
from pyulog import ULog |
||||
|
||||
from analysis.detectors import PreconditionError |
||||
|
||||
def get_output_tracking_error_message(ulog: ULog) -> str: |
||||
""" |
||||
return the name of the message containing the output_tracking_error |
||||
:param ulog: |
||||
:return: str |
||||
""" |
||||
for elem in ulog.data_list: |
||||
if elem.name == "ekf2_innovations": |
||||
return "ekf2_innovations" |
||||
if elem.name == "estimator_innovations": |
||||
return "estimator_status" |
||||
|
||||
raise PreconditionError("Could not detect the message containing the output tracking error") |
||||
|
||||
def get_innovation_message(ulog: ULog, topic: str = 'innovation') -> str: |
||||
""" |
||||
return the name of the innovation message (old: ekf2_innovations; new: estimator_innovations) |
||||
:param ulog: |
||||
:return: str |
||||
""" |
||||
if topic == 'innovation': |
||||
for elem in ulog.data_list: |
||||
if elem.name == "ekf2_innovations": |
||||
return "ekf2_innovations" |
||||
if elem.name == "estimator_innovations": |
||||
return "estimator_innovations" |
||||
if topic == 'innovation_variance': |
||||
for elem in ulog.data_list: |
||||
if elem.name == "ekf2_innovations": |
||||
return "ekf2_innovations" |
||||
if elem.name == "estimator_innovations": |
||||
return "estimator_innovations" |
||||
if topic == 'innovation_test_ratio': |
||||
for elem in ulog.data_list: |
||||
if elem.name == "ekf2_innovations": |
||||
return "ekf2_innovations" |
||||
if elem.name == "estimator_innovations": |
||||
return "estimator_innovations" |
||||
|
||||
raise PreconditionError("Could not detect the message") |
@ -1,19 +0,0 @@
@@ -1,19 +0,0 @@
|
||||
uint64 timestamp # time since system start (microseconds) |
||||
float32[6] vel_pos_innov # velocity and position innovations |
||||
float32[3] mag_innov # earth magnetic field innovations |
||||
float32 heading_innov # heading innovation |
||||
float32 airspeed_innov # airspeed innovation |
||||
float32 beta_innov # synthetic sideslip innovation |
||||
float32[2] flow_innov # flow innovation |
||||
float32 hagl_innov # innovation from the terrain estimator for the height above ground level measurement (m) |
||||
float32[6] vel_pos_innov_var # velocity and position innovation variances |
||||
float32[3] mag_innov_var # earth magnetic field innovation variance |
||||
float32 heading_innov_var # heading innovation variance |
||||
float32 airspeed_innov_var # Airspeed innovation variance |
||||
float32 beta_innov_var # synthetic sideslip innovation variance |
||||
float32[2] flow_innov_var # flow innovation variance |
||||
float32 hagl_innov_var # innovation variance from the terrain estimator for the height above ground level measurement (m^2) |
||||
float32[3] output_tracking_error # return a vector containing the output predictor angular, velocity and position tracking error magnitudes (rad), (m/s), (m) |
||||
float32[2] drag_innov # drag specific force innovation (m/s/s) |
||||
float32[2] drag_innov_var # drag specific force innovation variance (m/s/s)**2 |
||||
float32[2] aux_vel_innov # auxiliary NE velocity innovations from landing target measurement (m/s) |
@ -0,0 +1,43 @@
@@ -0,0 +1,43 @@
|
||||
uint64 timestamp # time since system start (microseconds) |
||||
|
||||
# GPS |
||||
float32[2] gps_hvel # horizontal GPS velocity innovation (m/sec) and innovation variance ((m/sec)**2) |
||||
float32 gps_vvel # vertical GPS velocity innovation (m/sec) and innovation variance ((m/sec)**2) |
||||
float32[2] gps_hpos # horizontal GPS position innovation (m) and innovation variance (m**2) |
||||
float32 gps_vpos # vertical GPS position innovation (m) and innovation variance (m**2) |
||||
|
||||
# External Vision |
||||
float32[2] ev_hvel # horizontal external vision velocity innovation (m/sec) and innovation variance ((m/sec)**2) |
||||
float32 ev_vvel # vertical external vision velocity innovation (m/sec) and innovation variance ((m/sec)**2) |
||||
float32[2] ev_hpos # horizontal external vision position innovation (m) and innovation variance (m**2) |
||||
float32 ev_vpos # vertical external vision position innovation (m) and innovation variance (m**2) |
||||
|
||||
# Fake Position and Velocity |
||||
float32[2] fake_hvel # fake horizontal velocity innovation (m/s) and innovation variance ((m/s)**2) |
||||
float32 fake_vvel # fake vertical velocity innovation (m/s) and innovation variance ((m/s)**2) |
||||
float32[2] fake_hpos # fake horizontal position innovation (m) and innovation variance (m**2) |
||||
float32 fake_vpos # fake vertical position innovation (m) and innovation variance (m**2) |
||||
|
||||
# Height sensors |
||||
float32 rng_vpos # range sensor height innovation (m) and innovation variance (m**2) |
||||
float32 baro_vpos # barometer height innovation (m) and innovation variance (m**2) |
||||
|
||||
# Auxiliary velocity |
||||
float32[2] aux_hvel # horizontal auxiliar velocity innovation from landing target measurement (m/sec) and innovation variance ((m/sec)**2) |
||||
float32 aux_vvel # vertical auxiliar velocity innovation from landing target measurement (m/sec) and innovation variance ((m/sec)**2) |
||||
|
||||
# Optical flow |
||||
float32[2] flow # flow innvoation (rad/sec) and innovation variance ((rad/sec)**2) |
||||
|
||||
# Various |
||||
float32 heading # heading innovation (rad) and innovation variance (rad**2) |
||||
float32[3] mag_field # earth magnetic field innovation (Gauss) and innovation variance (Gauss**2) |
||||
float32[2] drag # drag specific force innovation (m/sec**2) and innovation variance ((m/sec)**2) |
||||
float32 airspeed # airspeed innovation (m/sec) and innovation variance ((m/sec)**2) |
||||
float32 beta # synthetic sideslip innovation (rad) and innovation variance (rad**2) |
||||
float32 hagl # height of ground innovation (m) and innovation variance (m**2) |
||||
|
||||
# The innovation test ratios are scalar values. In case the field is a vector, |
||||
# the test ratio will be put in the first component of the vector. |
||||
|
||||
# TOPICS estimator_innovations estimator_innovation_variances estimator_innovation_test_ratios |
Loading…
Reference in new issue