Commit d8c4e691 authored by Léo-Paul Géneau's avatar Léo-Paul Géneau 👾

bouncy-flight.js: Fix missing function altitudeReached

parent 08d37fad
/*jslint nomen: true, indent: 2, maxerr: 3, maxlen: 80 */ /*jslint nomen: true, indent: 2, maxerr: 3, maxlen: 80 */
/*global console, me*/ /*global console, me*/
(function (console, me) { (function (console, me) {
"use strict"; "use strict";
var EPSILON = 9, var EPSILON = 9,
...@@ -90,6 +90,13 @@ ...@@ -90,6 +90,13 @@
} }
]; ];
function altitudeReached(altitude, target_altitude) {
console.log(
`[DEMO] Waiting for altitude... (${altitude} , ${target_altitude})`
);
return Math.abs(altitude - target_altitude) < EPSILON_ALTITUDE;
}
function distance(lat1, lon1, lat2, lon2) { function distance(lat1, lon1, lat2, lon2) {
var R = 6371e3, // meters var R = 6371e3, // meters
la1 = lat1 * Math.PI / 180, // la, lo in radians la1 = lat1 * Math.PI / 180, // la, lo in radians
...@@ -197,5 +204,4 @@ ...@@ -197,5 +204,4 @@
me.exit(0); me.exit(0);
} }
}; };
}(console, me)); }(console, me));
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment