chore(scripts): warn if we don't respect the target FPS (#2986)

This commit is contained in:
Steven Palma
2026-02-18 18:22:35 +01:00
committed by GitHub
parent b22e0315b0
commit 89bd58a9a2
+8 -1
View File
@@ -398,7 +398,14 @@ def record_loop(
)
dt_s = time.perf_counter() - start_loop_t
precise_sleep(max(1 / fps - dt_s, 0.0))
sleep_time_s: float = 1 / fps - dt_s
if sleep_time_s < 0:
logging.warning(
f"Record loop is running slower ({1 / dt_s:.1f} Hz) than the target FPS ({fps} Hz). Dataset frames might be dropped and robot control might be unstable. Common causes are: 1) Camera FPS not keeping up 2) Policy inference taking too long 3) CPU starvation"
)
precise_sleep(max(sleep_time_s, 0.0))
timestamp = time.perf_counter() - start_episode_t