Skip to content
Snippets Groups Projects
Commit a25f2830 authored by Zhiying Li's avatar Zhiying Li
Browse files

update main control

parent ec6be7fb
No related merge requests found
...@@ -294,15 +294,15 @@ def main_control(gbx, gby, gb_dist, tx, ty, tz, rx, ry, rz, LIDAR_dist, debugM): ...@@ -294,15 +294,15 @@ def main_control(gbx, gby, gb_dist, tx, ty, tz, rx, ry, rz, LIDAR_dist, debugM):
ballDetect = ball_detect(gbx, gby) ballDetect = ball_detect(gbx, gby)
ballCapture = ball_capture(LIDAR_dist) ballCapture = ball_capture(LIDAR_dist)
goalDetect = goal_detect(tx,ty) goalDetect = goal_detect(tx,ty)
# debug # debug
ballCapture = 0
if ballCapture: # Ball captured if ballCapture: # Ball captured
if goalDetect: # Goal detected if goalDetect: # Goal detected
stop_all() #stop_all()
#pwm1, pwm2, pwm3, pwm4, dir1, dir2, dir3, dir4 = move2goal(tx, ty) pwm1, pwm2, pwm3, pwm4, dir1, dir2, dir3, dir4 = move2goal(tx, ty)
else: # Goal not detected else: # Goal not detected
stop_all() #stop_all()
#pwm1, pwm2, pwm3, pwm4, dir1, dir2, dir3, dir4 = seeking() pwm1, pwm2, pwm3, pwm4, dir1, dir2, dir3, dir4 = seeking()
else: # Ball not captured else: # Ball not captured
if ballDetect: # Ball detected if ballDetect: # Ball detected
pwm1, pwm2, pwm3, pwm4, dir1, dir2, dir3, dir4 = move2ball(gbx,gby,gb_dist) pwm1, pwm2, pwm3, pwm4, dir1, dir2, dir3, dir4 = move2ball(gbx,gby,gb_dist)
...@@ -338,7 +338,7 @@ if __name__ == '__main__': ...@@ -338,7 +338,7 @@ if __name__ == '__main__':
gb_dist = -1 # by default (-1 means no found green ball) gb_dist = -1 # by default (-1 means no found green ball)
# Serial Port In # Serial Port In
tx, ty, tz = 0, 0, 0 # by default (0 means no found AirTag) tx, ty, tz = 100000, 100000, 100000 # by default (0 means no found AirTag)
rx, ry, rz = 0, 0, 0 rx, ry, rz = 0, 0, 0
LIDAR_dist = 0 LIDAR_dist = 0
debugM = 'Testing' debugM = 'Testing'
......
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