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 */
/*global console, me*/
(function (console, me) {
(function (console, me) {
"use strict";
var EPSILON = 9,
......@@ -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) {
var R = 6371e3, // meters
la1 = lat1 * Math.PI / 180, // la, lo in radians
......@@ -197,5 +204,4 @@
me.exit(0);
}
};
}(console, me));
\ No newline at end of file
}(console, me));
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