From 4751d022293643a0482bc8d063ab9c7301b2db20 Mon Sep 17 00:00:00 2001 From: Ruben van de Ven Date: Tue, 17 Oct 2023 13:11:51 +0200 Subject: [PATCH] Fix odd interval of waiting predictor --- trap/prediction_server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trap/prediction_server.py b/trap/prediction_server.py index b9467a5..84b9178 100644 --- a/trap/prediction_server.py +++ b/trap/prediction_server.py @@ -211,9 +211,9 @@ class PredictionServer: while self.is_running.is_set(): timestep += 1 this_run_time = time.time() - logger.debug('test') + logger.debug(f'test {prev_run_time - this_run_time}') time.sleep(max(0, prev_run_time - this_run_time + .5)) - prev_run_time = this_run_time + prev_run_time = time.time() # for timestep in range(init_timestep + 1, eval_scene.timesteps): # input_dict = eval_scene.get_clipped_input_dict(timestep, hyperparams['state'])