Skip to content

Commit

Permalink
process replay: regen routes (commaai#32464)
Browse files Browse the repository at this point in the history
* regen

* regen

* update

* undo

* update refs

* fix

* real fix

* test

* test2

* test3

* stash

* Revert "stash"

This reverts commit bf6765f.

* rk.lagging can not be trusted. BODY segment has radarFault while modelV2 is not valid, causing radarState to not be valid

* order

* update refs again

* we never logged carOutput!

* bump

* add back checks
  • Loading branch information
sshane authored May 19, 2024
1 parent 075176f commit 220fcc1
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 24 deletions.
2 changes: 1 addition & 1 deletion selfdrive/controls/controlsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def update_events(self, CS):
self.events.add(EventName.cameraFrameRate)
if not REPLAY and self.rk.lagging:
self.events.add(EventName.controlsdLagging)
if len(self.sm['radarState'].radarErrors) or (not self.rk.lagging and not self.sm.all_checks(['radarState'])):
if len(self.sm['radarState'].radarErrors) or ((not self.rk.lagging or REPLAY) and not self.sm.all_checks(['radarState'])):
self.events.add(EventName.radarFault)
if not self.sm.valid['pandaStates']:
self.events.add(EventName.usbError)
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/test/process_replay/process_replay.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ def locationd_config_pubsub_callback(params, cfg, lr):
"modelV2", "driverCameraState", "roadCameraState", "wideRoadCameraState", "managerState",
"testJoystick", "liveTorqueParameters", "accelerometer", "gyroscope"
],
subs=["controlsState", "carState", "carControl", "sendcan", "onroadEvents", "carParams"],
subs=["controlsState", "carState", "carControl", "carOutput", "sendcan", "onroadEvents", "carParams"],
ignore=["logMonoTime", "controlsState.startMonoTime", "controlsState.cumLagMs"],
config_callback=controlsd_config_callback,
init_callback=controlsd_fingerprint_callback,
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/test/process_replay/ref_commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f1ecdf9048fb12e289baf4933cb3ef12e486252c
cc4e23ca0fceb300a3048c187ae9bc793794c095
40 changes: 19 additions & 21 deletions selfdrive/test/process_replay/test_processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,23 @@
]

segments = [
("BODY", "regen997DF2697CB|2023-10-30--23-14-29--0"),
("HYUNDAI", "regen2A9D2A8E0B4|2023-10-30--23-13-34--0"),
("HYUNDAI2", "regen6CA24BC3035|2023-10-30--23-14-28--0"),
("TOYOTA", "regen5C019D76307|2023-10-30--23-13-31--0"),
("TOYOTA2", "regen5DCADA88A96|2023-10-30--23-14-57--0"),
("TOYOTA3", "regen7204CA3A498|2023-10-30--23-15-55--0"),
("HONDA", "regen048F8FA0B24|2023-10-30--23-15-53--0"),
("HONDA2", "regen7D2D3F82D5B|2023-10-30--23-15-55--0"),
("CHRYSLER", "regen7125C42780C|2023-10-30--23-16-21--0"),
("RAM", "regen2731F3213D2|2023-10-30--23-18-11--0"),
("SUBARU", "regen86E4C1B4DDD|2023-10-30--23-18-14--0"),
("GM", "regenF6393D64745|2023-10-30--23-17-18--0"),
("GM2", "regen220F830C05B|2023-10-30--23-18-39--0"),
("NISSAN", "regen4F671F7C435|2023-10-30--23-18-40--0"),
("VOLKSWAGEN", "regen8BDFE7307A0|2023-10-30--23-19-36--0"),
("MAZDA", "regen2E9F1A15FD5|2023-10-30--23-20-36--0"),
("FORD", "regen6D39E54606E|2023-10-30--23-20-54--0"),
("BODY", "regen02ECB79BACC|2024-05-18--04-29-29--0"),
("HYUNDAI", "regen845DC1916E6|2024-05-18--04-30-52--0"),
("HYUNDAI2", "regenBAE0915FE22|2024-05-18--04-33-11--0"),
("TOYOTA", "regen1108D19FC2E|2024-05-18--04-34-34--0"),
("TOYOTA2", "regen846521F39C7|2024-05-18--04-35-58--0"),
("TOYOTA3", "regen788C3623D11|2024-05-18--04-38-21--0"),
("HONDA", "regenDE43F170E99|2024-05-18--04-39-47--0"),
("HONDA2", "regen1EE0FA383C3|2024-05-18--04-41-12--0"),
("CHRYSLER", "regen9C5A30F471C|2024-05-18--04-42-36--0"),
("RAM", "regenCCA313D117D|2024-05-18--04-44-53--0"),
("SUBARU", "regenA41511F882A|2024-05-18--04-47-14--0"),
("GM", "regen9D7B9CE4A66|2024-05-18--04-48-36--0"),
("GM2", "regen07CECA52D41|2024-05-18--04-50-55--0"),
("NISSAN", "regen2D6B856D0AE|2024-05-18--04-52-17--0"),
("VOLKSWAGEN", "regen2D3AC6A6F05|2024-05-18--04-53-41--0"),
("MAZDA", "regen0D5A777DD16|2024-05-18--04-56-02--0"),
("FORD", "regen235D0937965|2024-05-18--04-58-16--0"),
]

# dashcamOnly makes don't need to be tested until a full port is done
Expand Down Expand Up @@ -107,11 +107,9 @@ def test_process(cfg, lr, segment, ref_log_path, new_log_path, ignore_fields=Non
# check to make sure openpilot is engaged in the route
if cfg.proc_name == "controlsd":
if not check_openpilot_enabled(log_msgs):
# FIXME: these segments should work, but the replay enabling logic is too brittle
if segment not in ("regen6CA24BC3035|2023-10-30--23-14-28--0", "regen7D2D3F82D5B|2023-10-30--23-15-55--0"):
return f"Route did not enable at all or for long enough: {new_log_path}", log_msgs
return f"Route did not enable at all or for long enough: {new_log_path}", log_msgs

if cfg.proc_name != 'ubloxd' or segment != 'regen6CA24BC3035|2023-10-30--23-14-28--0':
if cfg.proc_name != 'ubloxd' or segment != 'regenBAE0915FE22|2024-05-18--04-33-11--0':
seen_msgs = {m.which() for m in log_msgs}
expected_msgs = set(cfg.subs)
if seen_msgs != expected_msgs:
Expand Down

0 comments on commit 220fcc1

Please sign in to comment.