mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-03-23 15:34:18 +08:00
[tools] calibrate.py: plot measurements if no remaining after filtering
This commit is contained in:
@@ -112,7 +112,10 @@ def main():
|
||||
if options.verbose:
|
||||
print("remaining "+str(len(flt_meas))+" after filtering")
|
||||
if len(flt_meas) == 0:
|
||||
print("Error: found zero IMU_"+options.sensor+"_RAW measurements for aircraft with id "+options.ac_id+" in log file after filtering!")
|
||||
print("Error: found zero IMU_" + options.sensor + "_RAW measurements for aircraft with id " + options.ac_id +
|
||||
" in log file after filtering!\nMaybe try the --auto_threshold option.")
|
||||
if options.plot:
|
||||
calibration_utils.plot_measurements(options.sensor, measurements)
|
||||
sys.exit(1)
|
||||
|
||||
# get an initial min/max guess
|
||||
|
||||
@@ -163,6 +163,13 @@ def print_imu_scaled(sensor, measurements, attrs):
|
||||
print("StDev " + str(measurements[:,1:].std(axis=0)*attrs[0]) + " " + attrs[1])
|
||||
|
||||
|
||||
def plot_measurements(sensor, measurements):
|
||||
plt.plot(measurements[:, 0])
|
||||
plt.plot(measurements[:, 1])
|
||||
plt.plot(measurements[:, 2])
|
||||
plt.ylabel('ADC')
|
||||
plt.title("Raw %s measurements" % sensor)
|
||||
plt.show()
|
||||
|
||||
def plot_results(sensor, measurements, flt_idx, flt_meas, cp0, np0, cp1, np1, sensor_ref, blocking=True):
|
||||
"""Plot calibration results."""
|
||||
|
||||
Reference in New Issue
Block a user