mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-12-02 01:03:44 +08:00
Process replay: remove the cruise jerk RMS check (#39489)
* Process replay: measure jerk over recorded cruise windows * Process replay: remove the cruise jerk RMS check
This commit is contained in:
@@ -1,33 +0,0 @@
|
||||
import numpy as np
|
||||
|
||||
from openpilot.tools.lib.logreader import LogIterable
|
||||
|
||||
|
||||
def check_jerk_rms(inputs: LogIterable, outputs: LogIterable) -> None:
|
||||
msgs = [m for m in inputs if m.which() == 'carControl']
|
||||
msgs += [m for m in outputs if m.which() == 'longitudinalPlan']
|
||||
active = False
|
||||
prev = None
|
||||
jerks = []
|
||||
for m in sorted(msgs, key=lambda m: m.logMonoTime):
|
||||
if m.which() == 'carControl':
|
||||
active = m.carControl.longActive
|
||||
if not active:
|
||||
prev = None
|
||||
continue
|
||||
plan = m.longitudinalPlan
|
||||
if not (m.valid and active and plan.longitudinalPlanSource == 'cruise' and not plan.hasLead):
|
||||
prev = None
|
||||
continue
|
||||
if prev is not None:
|
||||
jerks.append((plan.aTarget - prev.aTarget) / ((plan.modelMonoTime - prev.modelMonoTime) / 1e9))
|
||||
prev = plan
|
||||
|
||||
if jerks:
|
||||
jerk_rms = np.sqrt(np.mean(np.square(jerks)))
|
||||
assert jerk_rms < 0.15, f'{jerk_rms=:.5f}'
|
||||
|
||||
|
||||
PROCESS_CHECKS = {
|
||||
'plannerd': [check_jerk_rms],
|
||||
}
|
||||
@@ -14,7 +14,6 @@ from openpilot.selfdrive.test.process_replay.compare_logs import compare_logs, f
|
||||
from openpilot.selfdrive.test.process_replay.diff_report import diff_process, diff_report
|
||||
from openpilot.selfdrive.test.process_replay.process_replay import CONFIGS, PROC_REPLAY_DIR, FAKEDATA, replay_process, \
|
||||
check_most_messages_valid
|
||||
from openpilot.selfdrive.test.process_replay.sanity_checks import PROCESS_CHECKS
|
||||
from openpilot.tools.lib.filereader import FileReader
|
||||
from openpilot.tools.lib.logreader import LogReader, save_log
|
||||
from openpilot.tools.lib.url_file import URLFile
|
||||
@@ -123,8 +122,6 @@ def test_process(cfg, lr, segment, ref_log_msgs, new_log_path, ignore_fields=Non
|
||||
return f"Expected messages: {expected_msgs}, but got: {seen_msgs}", log_msgs
|
||||
|
||||
try:
|
||||
for check in PROCESS_CHECKS.get(cfg.proc_name, []):
|
||||
check(lr, log_msgs)
|
||||
return compare_logs(ref_log_msgs, log_msgs, ignore_fields + cfg.ignore, ignore_msgs, cfg.tolerance), log_msgs
|
||||
except Exception as e:
|
||||
return str(e), log_msgs
|
||||
|
||||
Reference in New Issue
Block a user