pid steering

This commit is contained in:
tymek 2025-07-31 18:31:02 +02:00
parent 7d6f5df82d
commit 83264ef11f

View file

@ -77,9 +77,6 @@ for chunk in stream.iter_content(chunk_size=1024):
cv2.circle(frame, center, radius, (255, 0, 0), 2) cv2.circle(frame, center, radius, (255, 0, 0), 2)
cv2.circle(frame, center, 5, (0, 0, 255), -1) cv2.circle(frame, center, 5, (0, 0, 255), -1)
# (Opcjonalnie) Wypisz pozycję
cv2.putText(frame, f"X:{int(x)} Y:{int(y)} R:{int(radius)}", (10, 30),
cv2.FONT_HERSHEY_SIMPLEX, 0.6, (0, 255, 0), 2)
if int(radius) >= 100: if int(radius) >= 100:
motorL.stop() motorL.stop()
@ -114,6 +111,10 @@ for chunk in stream.iter_content(chunk_size=1024):
xp = x xp = x
ip += i ip += i
# (Opcjonalnie) Wypisz pozycję
cv2.putText(frame, f"P:{int(p)} I:{int(i)} D:{int(d)}", (10, 30),
cv2.FONT_HERSHEY_SIMPLEX, 0.6, (0, 255, 0), 2)
# ============================ # ============================
# 👆 KONIEC DETEKCJI PIŁKI 👆 # 👆 KONIEC DETEKCJI PIŁKI 👆
# ============================ # ============================