Fix odd interval of waiting predictor

This commit is contained in:
Ruben van de Ven 2023-10-17 13:11:51 +02:00
parent ec31810d80
commit 4751d02229

View file

@ -211,9 +211,9 @@ class PredictionServer:
while self.is_running.is_set(): while self.is_running.is_set():
timestep += 1 timestep += 1
this_run_time = time.time() 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)) 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): # for timestep in range(init_timestep + 1, eval_scene.timesteps):
# input_dict = eval_scene.get_clipped_input_dict(timestep, hyperparams['state']) # input_dict = eval_scene.get_clipped_input_dict(timestep, hyperparams['state'])