summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-03-22 21:51:52 +0900
committerKeith Packard <keithp@keithp.com>2011-03-22 21:53:34 +0900
commit7d7b476564a16eda81ab3406f70a21995e1b464e (patch)
tree0a34206783b74fd2a80e921b5fe3bf29d3ed4caa /src/test
parenta80d3836cfce3d4cfa7a71068539415c2dc421cd (diff)
altos: Fix up flight code testing
This automates flight code testing by reporting mis-detected apogee or main events. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/test')
-rwxr-xr-xsrc/test/run-one26
-rwxr-xr-xsrc/test/run-tests34
-rw-r--r--src/test/test-flights1
3 files changed, 32 insertions, 29 deletions
diff --git a/src/test/run-one b/src/test/run-one
index f9d21576..d661abec 100755
--- a/src/test/run-one
+++ b/src/test/run-one
@@ -1,17 +1,24 @@
#!/bin/sh
-./ao_flight_test "$1" > run-out.full
-./ao_flight_test_baro "$1" > run-out.baro
-./ao_flight_test_accel "$1" > run-out.accel
+for i in "$@"; do
+./ao_flight_test "$i" > run-out.full
+./ao_flight_test_baro "$i" > run-out.baro
+#./ao_flight_test_accel "$i" > run-out.accel
-gnuplot -persist << EOF
+#"run-out.accel" using 1:9 with lines lt 4 axes x1y1 title "accel height",\
+#"run-out.accel" using 1:11 with lines lt 4 axes x1y2 title "accel speed",\
+#"run-out.accel" using 1:13 with lines lt 4 axes x1y2 title "accel accel",\
+#"run-out.accel" using 1:15 with lines lt 4 axes x1y1 title "accel drogue",\
+#"run-out.accel" using 1:17 with lines lt 4 axes x1y1 title "accel main",\
+
+gnuplot << EOF
set ylabel "altitude (m)"
set y2label "velocity (m/s), acceleration(m/s²)"
set xlabel "time (s)"
set xtics border out nomirror
set ytics border out nomirror
set y2tics border out nomirror
-set title "$1"
+set title "$i"
plot "run-out.full" using 1:3 with lines lw 2 lt 1 axes x1y1 title "raw height",\
"run-out.full" using 1:5 with lines lw 2 lt 1 axes x1y2 title "raw accel",\
"run-out.full" using 1:9 with lines lt 2 axes x1y1 title "full height",\
@@ -23,10 +30,7 @@ plot "run-out.full" using 1:3 with lines lw 2 lt 1 axes x1y1 title "raw height",
"run-out.baro" using 1:11 with lines lt 3 axes x1y2 title "baro speed",\
"run-out.baro" using 1:13 with lines lt 3 axes x1y2 title "baro accel",\
"run-out.baro" using 1:15 with lines lt 3 axes x1y1 title "baro drogue",\
-"run-out.baro" using 1:17 with lines lt 3 axes x1y1 title "baro main",\
-"run-out.accel" using 1:9 with lines lt 4 axes x1y1 title "accel height",\
-"run-out.accel" using 1:11 with lines lt 4 axes x1y2 title "accel speed",\
-"run-out.accel" using 1:13 with lines lt 4 axes x1y2 title "accel accel",\
-"run-out.accel" using 1:15 with lines lt 4 axes x1y1 title "accel drogue",\
-"run-out.accel" using 1:17 with lines lt 4 axes x1y1 title "accel main"
+"run-out.baro" using 1:17 with lines lt 3 axes x1y1 title "baro main"
+pause mouse close
EOF
+done \ No newline at end of file
diff --git a/src/test/run-tests b/src/test/run-tests
index ec279776..11b4c95c 100755
--- a/src/test/run-tests
+++ b/src/test/run-tests
@@ -2,21 +2,21 @@
DIR=~/src/cc1111/flights
+bad_baro=0
+bad_full=0
while read flight; do
- baro=`./ao_flight_test_baro -s $DIR/$flight |
- awk '/drogue/ { printf "%s ", $4 }
- /main/ { printf "%s\n", $4 }'`
- full=`./ao_flight_test -s $DIR/$flight |
- awk '/drogue/ { printf "%s ", $4 }
- /main/ { printf "%s\n", $4 }'`
- echo $flight $baro $full
-done < test-flights |
-awk '{ name = $1;
- drogue_error = $2 - $4;
- if (drogue_error < 0) drogue_error = -drogue_error;
- main_error = $3 - $5;
- if (main_error < 0) main_error = -main_error;
- if (drogue_error > 4 || main_error > 4)
- printf ("%s: baro drogue %f main %f. full drogue %f main %f\n",
- name, $2, $3, $4, $5);
- }'
+ if ./ao_flight_test_baro -s $DIR/$flight; then
+ :
+ else
+ ((bad_baro++))
+ fi
+ if ./ao_flight_test -s $DIR/$flight; then
+ :
+ else
+ ((bad_full++))
+ fi
+done < test-flights
+echo baro errors $bad_baro
+echo full errors $bad_full
+((bad = bad_baro + bad_full))
+exit $bad \ No newline at end of file
diff --git a/src/test/test-flights b/src/test/test-flights
index afdaba5a..0b90d9e0 100644
--- a/src/test/test-flights
+++ b/src/test/test-flights
@@ -63,7 +63,6 @@
2010-09-24-serial-236-flight-006.eeprom
2010-09-25-serial-223-flight-001.eeprom
2010-10-17-serial-215-flight-006.eeprom
-2010-10-23-serial-236-flight-008.eeprom
2011-01-30-serial-056-flight-001.eeprom
2011-01-30-serial-250-flight-002.eeprom
2011-02-19-serial-215-flight-007.eeprom