Skip to content
Snippets Groups Projects
Commit b20516d8 authored by Zhaoliang Zheng's avatar Zhaoliang Zheng
Browse files

add manual control option into auto_control

parent 48ef135b
Branches
No related merge requests found
......@@ -667,6 +667,18 @@ def test_function1():
print("tx,ty,tz:{},{},{}".format(tx,ty,tz))
print("rx,ry,rz:{},{},{}".format(rx,ry,rz))
def manual_in_auto(Ctl_com, serial_port):
if get_key('m'):
flag = 12
while (flag == 12):
manual_control(Ctl_com, serial_port)
flag = manual_return2auto('r')
return flag
def manual_return2auto(key_press):
if get_key(key_press):
flag_r = 1
return flag_r
# ===== Main Function =====
......@@ -725,6 +737,8 @@ if __name__ == '__main__':
print('auto_control')
auto_control(serial_port,gbx, gby, gb_dist, tx, ty, tz, rx, ry, rz, LIDAR_dist1, LIDAR_dist2, debugM,count_h)
flag, print_count = keyboard_stop(flag,print_count)
flag = manual_in_auto(Ctl_com, serial_port)
elif get_key('s'):
pwm1, pwm2, pwm3, pwm4, dir1, dir2, dir3, dir4 = stop_all()
serial_port_out(serial_port, pwm1, pwm2, pwm3, pwm4, dir1, dir2, dir3, dir4)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment