Update folkrace.py
This commit is contained in:
parent
04552995d7
commit
05f48e8a3e
1 changed files with 1 additions and 1 deletions
|
|
@ -66,7 +66,7 @@ def turnleft():
|
||||||
while True:
|
while True:
|
||||||
print("F=", f"{front.distance:.2f}", "R=", f"{right.distance:.2f}", "L=", f"{left.distance:.2f}")
|
print("F=", f"{front.distance:.2f}", "R=", f"{right.distance:.2f}", "L=", f"{left.distance:.2f}")
|
||||||
try:
|
try:
|
||||||
if front.distance >= 20: # What to do when there is an obstacle ahead
|
if front.distance <= 20: # What to do when there is an obstacle ahead
|
||||||
if left.distance > right.distance: # Diagonally left
|
if left.distance > right.distance: # Diagonally left
|
||||||
dgleft()
|
dgleft()
|
||||||
if right.distance > left.distance: # Diagonally right
|
if right.distance > left.distance: # Diagonally right
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue