From 02a35949dcaefff912d1c25bca5e56195e14da71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20R=C4=85czy?= Date: Sat, 29 Jun 2024 02:31:55 -0700 Subject: [PATCH] drivingModelData: frameDropPerc (#32871) * Smokes! lets go! * Ignore it in model replay old-commit-hash: 417f1e2139ba6037c9fd6494f68194e36e243540 --- cereal/log.capnp | 1 + selfdrive/modeld/fill_model_msg.py | 4 +++- selfdrive/test/process_replay/model_replay.py | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cereal/log.capnp b/cereal/log.capnp index 20b033196e..3a53db9cc4 100644 --- a/cereal/log.capnp +++ b/cereal/log.capnp @@ -871,6 +871,7 @@ struct ControlsState @0x97ff69c53601abf1 { struct DrivingModelData { frameId @0 :UInt32; frameIdExtra @1 :UInt32; + frameDropPerc @6 :Float32; action @2 :ModelDataV2.Action; diff --git a/selfdrive/modeld/fill_model_msg.py b/selfdrive/modeld/fill_model_msg.py index 2f719c1ee6..03f6d1b016 100644 --- a/selfdrive/modeld/fill_model_msg.py +++ b/selfdrive/modeld/fill_model_msg.py @@ -53,6 +53,7 @@ def fill_model_msg(base_msg: capnp._DynamicStructBuilder, extended_msg: capnp._D vipc_frame_id: int, vipc_frame_id_extra: int, frame_id: int, frame_drop: float, timestamp_eof: int, model_execution_time: float, valid: bool) -> None: frame_age = frame_id - vipc_frame_id if frame_id > vipc_frame_id else 0 + frame_drop_perc = frame_drop * 100 extended_msg.valid = valid base_msg.valid = valid @@ -60,6 +61,7 @@ def fill_model_msg(base_msg: capnp._DynamicStructBuilder, extended_msg: capnp._D driving_model_data.frameId = vipc_frame_id driving_model_data.frameIdExtra = vipc_frame_id_extra + driving_model_data.frameDropPerc = frame_drop_perc action = driving_model_data.action action.desiredCurvature = float(net_output_data['desired_curvature'][0,0]) @@ -68,7 +70,7 @@ def fill_model_msg(base_msg: capnp._DynamicStructBuilder, extended_msg: capnp._D modelV2.frameId = vipc_frame_id modelV2.frameIdExtra = vipc_frame_id_extra modelV2.frameAge = frame_age - modelV2.frameDropPerc = frame_drop * 100 + modelV2.frameDropPerc = frame_drop_perc modelV2.timestampEof = timestamp_eof modelV2.modelExecutionTime = model_execution_time diff --git a/selfdrive/test/process_replay/model_replay.py b/selfdrive/test/process_replay/model_replay.py index 9a7b9695ff..0e43cad820 100755 --- a/selfdrive/test/process_replay/model_replay.py +++ b/selfdrive/test/process_replay/model_replay.py @@ -105,6 +105,7 @@ if __name__ == "__main__": ignore = [ 'logMonoTime', + 'drivingModelData.frameDropPerc', 'modelV2.frameDropPerc', 'modelV2.modelExecutionTime', 'driverStateV2.modelExecutionTime',