ao-bringup: test-baro should accept altitudes a bit below sea level
authorKeith Packard <keithp@keithp.com>
Tue, 13 May 2014 05:48:45 +0000 (22:48 -0700)
committerKeith Packard <keithp@keithp.com>
Tue, 13 May 2014 05:48:45 +0000 (22:48 -0700)
Testing baro sensors on a particularly high pressure day at Keith's
house yields altitudes down to -20m or so.

Signed-off-by: Keith Packard <keithp@keithp.com>
ao-bringup/test-baro

index 2116dce4c750b0d357ebcb31b009f1d51ca6dcd3..ce5b7f80a24806b3507fe292f2d42d2a8a489d4a 100755 (executable)
@@ -71,7 +71,7 @@ do_baro(file f) {
        real temperature = string_to_integer(temp[2]) / 100.0;
        real altitude = string_to_integer(alt[1]);
 
        real temperature = string_to_integer(temp[2]) / 100.0;
        real altitude = string_to_integer(alt[1]);
 
-       if (altitude < 0 || 3000 < altitude) {
+       if (altitude < -50 || 3000 < altitude) {
                printf ("weird altitude %f\n", altitude);
                return false;
        }
                printf ("weird altitude %f\n", altitude);
                return false;
        }