added motion detection

This commit is contained in:
Martin Donnelly 2018-11-04 12:48:54 +00:00
parent af7091e0cc
commit 2536505cee

View File

@ -106,6 +106,9 @@ const LocationModel = Backbone.Model.extend({
motion.cur.ts = ts;
const dist = distance(motion.prev.lat, motion.prev.lon, latitude, longitude);
console.log('Prev', motion.prev);
console.log('Cur', motion.cur);
const timeS = (motion.cur.ts - motion.prev.ts) / 1000.0;
const speedMps = dist / timeS;