Permalink
Browse files

Add shitty LFT error handling

  • Loading branch information...
Henfau committed Nov 14, 2017
1 parent c8e0981 commit 2eb9cbcdd0e8ca987d1de3d4cc96b5f5d5fb2581
Showing with 18 additions and 14 deletions.
  1. +18 −14 basic_robot/lineFollowerTest.py
@@ -29,20 +29,24 @@ def calculate_error(sens_values):
m.forward()
running = True
while running:
value = sens.update()
print("Value: "+str(value))
error = calculate_error(value)
print(str(time())+" : "+str(error))
sleep(0.1)
m.stop()
if error > 0.1:
m.turn_left(error*10)
pass
elif error <-0.1:
m.turn_right(-error*10)
pass
m.forward()
try:
while running:
value = sens.update()
print("Value: "+str(value))
error = calculate_error(value)
print(str(time())+" : "+str(error))
sleep(0.1)
m.stop()
if error > 0.1:
m.turn_left(error*10)
pass
elif error <-0.1:
m.turn_right(-error*10)
pass
m.forward()
except:
pass
#m.stop()

0 comments on commit 2eb9cbc

Please sign in to comment.