From 19c1ae82a2e8cc964b74dfa9b2edf06e907c72a1 Mon Sep 17 00:00:00 2001 From: Pax1601 Date: Sat, 6 Apr 2024 15:47:27 +0200 Subject: [PATCH] Configurable wait period added --- scripts/python/map_generator/main.py | 4 ++-- scripts/python/map_generator/map_generator.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/python/map_generator/main.py b/scripts/python/map_generator/main.py index 6e44ec79..439094bc 100644 --- a/scripts/python/map_generator/main.py +++ b/scripts/python/map_generator/main.py @@ -26,8 +26,8 @@ parser.add_argument('-e', '--extraction_only', action='store_true', help='if pro parser.add_argument('-m', '--merging_only', action='store_true', help='if provided, the script will only run the tiles merging algorithm.') parser.add_argument('-c', '--compression_only', action='store_true', help='if provided, the script will only run the compression algorithm.') parser.add_argument('-n', '--colors_number', type=int, default=256, help='number of colors used by the png quantization algorithm. By default, 256. Must be less than 256.') - - +parser.add_argument('-w', '--wait_period', type=float, default=5.0, help='sleep time, in seconds, the algorithm will wait when a large jump is done in the map. To allow texture loading.') + args = parser.parse_args() # Port on which the camera control module is listening diff --git a/scripts/python/map_generator/map_generator.py b/scripts/python/map_generator/map_generator.py index 4a887b23..ddf52e4d 100644 --- a/scripts/python/map_generator/map_generator.py +++ b/scripts/python/map_generator/map_generator.py @@ -232,7 +232,7 @@ def take_screenshot(XY, n_width, n_height, map_config, zoom, screenshots_folder, geo_data = json.loads(r.text) if last_screenshot_position is None or distance.geodesic(last_screenshot_position, (lat, lng)).km > SLEEP_DISTANCE: - time.sleep(5.0) + time.sleep(map_config['wait_period']) else: time.sleep(0.2)