fixed web-control path and watchdog stoping
This commit is contained in:
@@ -265,7 +265,22 @@
|
||||
lastL = L; lastR = R;
|
||||
readoutEl.textContent = `T ${throttle.toFixed(2)} | Turn ${turn.toFixed(2)} → L ${L} | R ${R}`;
|
||||
|
||||
sendLR(L, R, force);
|
||||
// sendLR(L, R, force);
|
||||
|
||||
// ---- Heartbeat: keep sending current values while driving ----
|
||||
setInterval(() => {
|
||||
// wenn nicht verbunden -> nix
|
||||
if (!connected) return;
|
||||
|
||||
// Wenn du NUR beim aktiven Fahren senden willst:
|
||||
const driving = (Math.abs(throttle) > 0.02) || (Math.abs(turn) > 0.02);
|
||||
|
||||
if (driving) {
|
||||
// erzwinge Senden auch wenn sich nichts geändert hat
|
||||
sendLR(lastL, lastR, true);
|
||||
}
|
||||
}, 400); // 40 Hz
|
||||
|
||||
}
|
||||
|
||||
function hardStop() {
|
||||
|
||||
Reference in New Issue
Block a user