From f3b8e031c116a00fc1ab88798561790334c17e1a Mon Sep 17 00:00:00 2001 From: Ruben van de Ven Date: Wed, 6 Dec 2023 10:25:01 +0100 Subject: [PATCH] Fix dt --- trap/prediction_server.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/trap/prediction_server.py b/trap/prediction_server.py index f28e084..f56408c 100644 --- a/trap/prediction_server.py +++ b/trap/prediction_server.py @@ -270,10 +270,10 @@ class PredictionServer: x = history[:, 0] y = history[:, 1] # TODO: calculate dt based on input - vx = derivative_of(x, 0.2) #eval_scene.dt - vy = derivative_of(y, 0.2) - ax = derivative_of(vx, 0.2) - ay = derivative_of(vy, 0.2) + vx = derivative_of(x, 0.1) #eval_scene.dt + vy = derivative_of(y, 0.1) + ax = derivative_of(vx, 0.1) + ay = derivative_of(vy, 0.1) data_dict = {('position', 'x'): x[:], ('position', 'y'): y[:], @@ -325,7 +325,7 @@ class PredictionServer: dists, preds = trajectron.incremental_forward(input_dict, maps, prediction_horizon=25, # TODO: make variable - num_samples=20, # TODO: make variable + num_samples=5, # TODO: make variable robot_present_and_future=robot_present_and_future, full_dist=True) end = time.time() @@ -343,6 +343,7 @@ class PredictionServer: # prediction_dict provides the actual predictions # histories_dict provides the trajectory used for prediction # futures_dict is the Ground Truth, which is unvailable in an online setting + prediction_dict, histories_dict, futures_dict = prediction_output_to_trajectories({timestep: preds}, eval_scene.dt, hyperparams['maximum_history_length'], @@ -371,6 +372,8 @@ class PredictionServer: response[node.id] = { 'id': node.id, + 'det_conf': trajectory_data[node.id]['det_conf'], + 'bbox': trajectory_data[node.id]['bbox'], 'history': history.tolist(), 'predictions': predictions[0].tolist() # use batch 0 }