Ch-10 TR feedback

This commit is contained in:
Danny Staple
2022-12-17 16:05:25 +00:00
parent b2228889e8
commit 45ba981386
4 changed files with 20 additions and 19 deletions
+2 -1
View File
@@ -25,7 +25,8 @@ while True:
current_time = time.monotonic()
deflection = distance_controller.calculate(error, current_time - prev_time)
prev_time = current_time
uart.write(f"{error},{deflection}\n".encode()) # ,{distance_controller.derivative}
uart.write(f"{error},{deflection},"
f"{distance_controller.derivative}\n".encode())
if motors_active:
robot.set_left(speed - deflection)
robot.set_right(speed + deflection)