mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-02 03:51:35 +08:00
ecl-ekf tools: clean up - move code to correct scope
- move code that is needed for general analysis out of plot scope
This commit is contained in:
@@ -75,13 +75,13 @@ if ('accel_inconsistency_m_s_s' in sensor_preflight.keys()) and ('gyro_inconsist
|
|||||||
pp.savefig()
|
pp.savefig()
|
||||||
plt.close(0)
|
plt.close(0)
|
||||||
|
|
||||||
# vertical velocity and position innovations
|
|
||||||
plt.figure(1,figsize=(20,13))
|
|
||||||
|
|
||||||
# generate max, min and 1-std metadata
|
# generate max, min and 1-std metadata
|
||||||
innov_time = 1e-6*ekf2_innovations['timestamp']
|
innov_time = 1e-6*ekf2_innovations['timestamp']
|
||||||
status_time = 1e-6*estimator_status['timestamp']
|
status_time = 1e-6*estimator_status['timestamp']
|
||||||
|
|
||||||
|
# vertical velocity and position innovations
|
||||||
|
plt.figure(1,figsize=(20,13))
|
||||||
|
|
||||||
# generate metadata for velocity innovations
|
# generate metadata for velocity innovations
|
||||||
innov_2_max_arg = np.argmax(ekf2_innovations['vel_pos_innov[2]'])
|
innov_2_max_arg = np.argmax(ekf2_innovations['vel_pos_innov[2]'])
|
||||||
innov_2_max_time = innov_time[innov_2_max_arg]
|
innov_2_max_time = innov_time[innov_2_max_arg]
|
||||||
@@ -784,7 +784,7 @@ pp.savefig()
|
|||||||
plt.close(10)
|
plt.close(10)
|
||||||
|
|
||||||
# innovation_check_flags summary
|
# innovation_check_flags summary
|
||||||
plt.figure(11,figsize=(20,13))
|
|
||||||
# 0 - true if velocity observations have been rejected
|
# 0 - true if velocity observations have been rejected
|
||||||
# 1 - true if horizontal position observations have been rejected
|
# 1 - true if horizontal position observations have been rejected
|
||||||
# 2 - true if true if vertical position observations have been rejected
|
# 2 - true if true if vertical position observations have been rejected
|
||||||
@@ -808,6 +808,9 @@ hagl_innov_fail = ((2**8 & estimator_status['innovation_check_flags']) > 0)*1
|
|||||||
ofx_innov_fail = ((2**9 & estimator_status['innovation_check_flags']) > 0)*1
|
ofx_innov_fail = ((2**9 & estimator_status['innovation_check_flags']) > 0)*1
|
||||||
ofy_innov_fail = ((2**10 & estimator_status['innovation_check_flags']) > 0)*1
|
ofy_innov_fail = ((2**10 & estimator_status['innovation_check_flags']) > 0)*1
|
||||||
|
|
||||||
|
# plot innovation_check_flags summary
|
||||||
|
plt.figure(11,figsize=(20,13))
|
||||||
|
|
||||||
plt.subplot(5,1,1)
|
plt.subplot(5,1,1)
|
||||||
plt.title('EKF Innovation Test Fails')
|
plt.title('EKF Innovation Test Fails')
|
||||||
plt.plot(status_time,vel_innov_fail,'b',label='vel NED')
|
plt.plot(status_time,vel_innov_fail,'b',label='vel NED')
|
||||||
|
|||||||
Reference in New Issue
Block a user