mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-08-05 16:25:41 +08:00
dragonpilot beta3
date: 2023-08-22T14:21:17 commit: 6148ce3d77530281f890970718e9c42b2acc5ff1
This commit is contained in:
@@ -70,7 +70,7 @@ class FuzzyGenerator:
|
||||
def generate_struct(self, schema: capnp.lib.capnp._StructSchema, event: Optional[str] = None) -> st.SearchStrategy[Dict[str, Any]]:
|
||||
full_fill: List[str] = list(schema.non_union_fields)
|
||||
single_fill: List[str] = [event] if event else [self.draw(st.sampled_from(schema.union_fields))] if schema.union_fields else []
|
||||
return st.fixed_dictionaries(dict((field, self.generate_field(schema.fields[field])) for field in full_fill + single_fill))
|
||||
return st.fixed_dictionaries({field: self.generate_field(schema.fields[field]) for field in full_fill + single_fill})
|
||||
|
||||
@classmethod
|
||||
def get_random_msg(cls, draw: DrawType, struct: capnp.lib.capnp._StructModule, real_floats: bool = False) -> Dict[str, Any]:
|
||||
|
||||
@@ -42,6 +42,13 @@ while true; do
|
||||
if ! sudo systemctl is-active -q ssh; then
|
||||
sudo systemctl start ssh
|
||||
fi
|
||||
|
||||
if ! pgrep -f 'ciui.py' > /dev/null 2>&1; then
|
||||
echo 'starting UI'
|
||||
cp $SOURCE_DIR/selfdrive/test/ciui.py /data/
|
||||
/data/ciui.py &
|
||||
fi
|
||||
|
||||
sleep 5s
|
||||
done
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ PROCS.update({
|
||||
"./boardd": 19.0,
|
||||
"system.sensord.rawgps.rawgpsd": 1.0,
|
||||
}
|
||||
}[HARDWARE.get_device_type()])
|
||||
}.get(HARDWARE.get_device_type(), {}))
|
||||
|
||||
TIMINGS = {
|
||||
# rtols: max/min, rsd
|
||||
@@ -258,7 +258,7 @@ class TestOnroad(unittest.TestCase):
|
||||
cpu_ok = False
|
||||
|
||||
# Ensure there's no missing procs
|
||||
all_procs = set([p.name for p in self.service_msgs['managerState'][0].managerState.processes if p.shouldBeRunning])
|
||||
all_procs = {p.name for p in self.service_msgs['managerState'][0].managerState.processes if p.shouldBeRunning}
|
||||
for p in all_procs:
|
||||
with self.subTest(proc=p):
|
||||
assert any(p in pp for pp in PROCS.keys()), f"Expected CPU usage missing for {p}"
|
||||
@@ -282,7 +282,7 @@ class TestOnroad(unittest.TestCase):
|
||||
result += "-------------- Debayer Timing ------------------\n"
|
||||
result += "------------------------------------------------\n"
|
||||
|
||||
ts = [getattr(getattr(m, m.which()), "processingTime") for m in self.lr if 'CameraState' in m.which()]
|
||||
ts = [getattr(m, m.which()).processingTime for m in self.lr if 'CameraState' in m.which()]
|
||||
self.assertLess(min(ts), 0.025, f"high execution time: {min(ts)}")
|
||||
result += f"execution time: min {min(ts):.5f}s\n"
|
||||
result += f"execution time: max {max(ts):.5f}s\n"
|
||||
@@ -297,7 +297,7 @@ class TestOnroad(unittest.TestCase):
|
||||
result += "----------------- SoF Timing ------------------\n"
|
||||
result += "------------------------------------------------\n"
|
||||
for name in ['roadCameraState', 'wideRoadCameraState', 'driverCameraState']:
|
||||
ts = [getattr(getattr(m, m.which()), "timestampSof") for m in self.lr if name in m.which()]
|
||||
ts = [getattr(m, m.which()).timestampSof for m in self.lr if name in m.which()]
|
||||
d_ms = np.diff(ts) / 1e6
|
||||
d50 = np.abs(d_ms-50)
|
||||
self.assertLess(max(d50), 1.0, f"high sof delta vs 50ms: {max(d50)}")
|
||||
@@ -315,7 +315,7 @@ class TestOnroad(unittest.TestCase):
|
||||
|
||||
cfgs = [("lateralPlan", 0.05, 0.05), ("longitudinalPlan", 0.05, 0.05)]
|
||||
for (s, instant_max, avg_max) in cfgs:
|
||||
ts = [getattr(getattr(m, s), "solverExecutionTime") for m in self.service_msgs[s]]
|
||||
ts = [getattr(m, s).solverExecutionTime for m in self.service_msgs[s]]
|
||||
self.assertLess(max(ts), instant_max, f"high '{s}' execution time: {max(ts)}")
|
||||
self.assertLess(np.mean(ts), avg_max, f"high avg '{s}' execution time: {np.mean(ts)}")
|
||||
result += f"'{s}' execution time: min {min(ts):.5f}s\n"
|
||||
@@ -335,7 +335,7 @@ class TestOnroad(unittest.TestCase):
|
||||
("driverStateV2", 0.050, 0.026),
|
||||
]
|
||||
for (s, instant_max, avg_max) in cfgs:
|
||||
ts = [getattr(getattr(m, s), "modelExecutionTime") for m in self.service_msgs[s]]
|
||||
ts = [getattr(m, s).modelExecutionTime for m in self.service_msgs[s]]
|
||||
self.assertLess(max(ts), instant_max, f"high '{s}' execution time: {max(ts)}")
|
||||
self.assertLess(np.mean(ts), avg_max, f"high avg '{s}' execution time: {np.mean(ts)}")
|
||||
result += f"'{s}' execution time: min {min(ts):.5f}s\n"
|
||||
|
||||
Reference in New Issue
Block a user