From 05d2f2384d7c3bfc7da778c929789419ca6ad843 Mon Sep 17 00:00:00 2001 From: Mark Jessop Date: Fri, 26 Apr 2019 16:43:47 +0930 Subject: [PATCH] Only log car position data when moving > 10kph. --- horusmapper.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/horusmapper.py b/horusmapper.py index f7f7054..68ca11c 100644 --- a/horusmapper.py +++ b/horusmapper.py @@ -601,8 +601,11 @@ def udp_listener_car_callback(data): if habitat_uploader != None: habitat_uploader.update_position(data) - # Add the car position to the logger. - chase_logger.add_car_position(_car_position_update) + # Add the car position to the logger, but only if we are moving (>10kph = ~3m/s) + if _speed > 3.0: + _car_position_update['speed'] = _speed + _car_position_update['heading'] = _heading + chase_logger.add_car_position(_car_position_update) # Add other listeners here...