modeld: frame delay (#37731)

* Frame delay

* Multiply

* If replay

* For long too

* DT_MDL / 2

* Shorten comment

* Just 50ms

* Remove REPLAY const
This commit is contained in:
Kacper Rączy
2026-04-06 14:15:38 -07:00
committed by GitHub
parent f37fd3ea34
commit 08401a96c2
+3 -1
View File
@@ -405,7 +405,9 @@ def main(demo=False):
drivingdata_send = messaging.new_message('drivingModelData')
posenet_send = messaging.new_message('cameraOdometry')
action = get_action_from_model(model_output, prev_action, lat_delay + DT_MDL, long_delay + DT_MDL, v_ego)
frame_delay = DT_MDL # compensate for time passed since the frame was captured: current_time - timestamp_eof is 50ms on average
action_delay = DT_MDL / 2 # middle of the interval between model output (current state) and next frame (expected state)
action = get_action_from_model(model_output, prev_action, lat_delay + frame_delay + action_delay, long_delay + frame_delay + action_delay, v_ego)
prev_action = action
fill_model_msg(drivingdata_send, modelv2_send, model_output, action,
publish_state, meta_main.frame_id, meta_extra.frame_id, frame_id,