From 4406040db5eaaf132f2a006cfa2bdb7ee8403d55 Mon Sep 17 00:00:00 2001 From: Mark Jessop Date: Sat, 25 May 2019 21:04:14 +0930 Subject: [PATCH] Update readme, move map zoom control to top-right. --- README.md | 8 ++++---- horusmapper.cfg.example | 7 ++++--- log_parse.py | 13 ++++++++++--- templates/index.html | 2 ++ 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 7628035..6a0f222 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # Project Horus - Browser-Based HAB Chase Map -**Note: This is a work-in-progress. Features may be incomplete or non-functional!** - This folder contains code to display payload (and chase car!) position data in a web browser: ![ChaseMapper Screenshot](https://github.com/projecthorus/chasemapper/raw/master/doc/chasemapper.jpg) @@ -16,7 +14,7 @@ On other OSes the required packages should be named something similar. You also need flask-socketio, which can be installed using pip: ``` -$ sudo pip install flask-socketio +$ sudo pip install flask-socketio pytz ``` You can then clone this repository with: @@ -44,7 +42,9 @@ Edit this file with your preferred text editor. The configuration file is fairly * At least one telemetry 'profile', which defines where payload and (optionally) car position telemetry data is sourced from. * A default latitude and longitude for the map to centre on. -You can then start-up the horusmapper server with: +The example configuration file includes profiles suitable for receiving data from radiosonde_auto_rx, and from OziMux messages. + +Once configured, you can start-up the horusmapper server with: ``` $ python horusmapper.py ``` diff --git a/horusmapper.cfg.example b/horusmapper.cfg.example index 9c4ad83..e5a1eda 100644 --- a/horusmapper.cfg.example +++ b/horusmapper.cfg.example @@ -37,12 +37,13 @@ car_source_port = 55672 # Other profiles can be defined in sections like the following: [profile_2] # Example source to take telemetry data from an instance of radiosonde_auto_rx -# emitting Horus UDP packets on port 55673, but still accept car positions via the -# 'standard' Horus UDP port 55672 +# emitting Horus UDP packets on port 55673, and accepts car positions from a local +# instance of GPSD profile_name = auto_rx telemetry_source_type = horus_udp telemetry_source_port = 55673 -car_source_type = horus_udp +car_source_type = gpsd +# Since we are using GPSD, the car_source_port argument is unused, but still has to be defined. car_source_port = 55672 diff --git a/log_parse.py b/log_parse.py index a81e9d4..fcc0050 100644 --- a/log_parse.py +++ b/log_parse.py @@ -313,12 +313,12 @@ def plot_predictor_error(flight_stats, predictor_errors, abort_predictor_errors= _abort_predict_error.append(_entry[1]) plt.plot(_abort_predict_time, _abort_predict_error, label='Abort Prediction') + plt.legend() plt.xlabel("Time (minutes)") plt.ylabel("Landing Prediction Error (km)") plt.title("Landing Prediction Error - %s" % callsign) plt.grid() - plt.legend() @@ -328,6 +328,7 @@ if __name__ == "__main__": parser.add_argument("-c", "--config", type=str, default="horusmapper.cfg", help="Configuration file.") parser.add_argument("-v", "--verbose", action="store_true", default=False, help="Verbose output.") parser.add_argument("--predict-error", action="store_true", default=False, help="Calculate Prediction Error.") + parser.add_argument("--abort-predict-error", action="store_true", default=False, help="Calculate Abort Prediction Error.") parser.add_argument("--landing-lat", type=float, default=None, help="Override Landing Latitude") parser.add_argument("--landing-lon", type=float, default=None, help="Override Landing Longitude") args = parser.parse_args() @@ -356,7 +357,10 @@ if __name__ == "__main__": if args.predict_error: if (args.landing_lat) != None and (args.landing_lon != None): _predict_errors = calculate_predictor_error(_telemetry[_call]['predictions'], None, args.landing_lat, args.landing_lon, 0) - _abort_predict_errors = calculate_abort_error(_telemetry[_call]['predictions'], None, args.landing_lat, args.landing_lon, 0) + if args.abort_predict_error: + _abort_predict_errors = calculate_abort_error(_telemetry[_call]['predictions'], None, args.landing_lat, args.landing_lon, 0) + else: + _abort_predict_errors = None plot_predictor_error(_stats, _predict_errors, _abort_predict_errors, _call) elif 'landing' in _stats: @@ -365,7 +369,10 @@ if __name__ == "__main__": _lon = _stats['landing'][2] _alt = _stats['landing'][3] _predict_errors = calculate_predictor_error(_telemetry[_call]['predictions'], _time, _lat, _lon, _alt) - _abort_predict_errors = calculate_abort_error(_telemetry[_call]['predictions'], _time, _lat, _lon, _alt) + if args.abort_predict_error: + _abort_predict_errors = calculate_abort_error(_telemetry[_call]['predictions'], _time, _lat, _lon, _alt) + else: + _abort_predict_errors = None plot_predictor_error(_stats, _predict_errors, _abort_predict_errors, _call) diff --git a/templates/index.html b/templates/index.html index 13a0033..b7d60be 100644 --- a/templates/index.html +++ b/templates/index.html @@ -309,6 +309,8 @@ } ).addTo(map); + map.zoomControl.setPosition('topright'); + // Experimental routing control // Currently disabled, as there is currently not enough control around how the map is re-panned // after a route is calculated.