first attempt at true striker
This commit is contained in:
@@ -415,29 +415,29 @@ if __name__ == '__main__':
|
|||||||
striker.mover.wait()
|
striker.mover.wait()
|
||||||
state = 'tracking'
|
state = 'tracking'
|
||||||
|
|
||||||
# elif state == 'align':
|
|
||||||
# striker.mover.set_head_angles(0, 0.25, 0.3)
|
|
||||||
# sleep(0.5)
|
|
||||||
# try:
|
|
||||||
# success = striker.align_to_ball()
|
|
||||||
# sleep(0.3)
|
|
||||||
# if success:
|
|
||||||
# state = 'kick'
|
|
||||||
# except ValueError:
|
|
||||||
# striker.mover.set_head_angles(0, 0, 0.3)
|
|
||||||
# state = 'tracking'
|
|
||||||
|
|
||||||
elif state == 'goal_align':
|
elif state == 'goal_align':
|
||||||
# print(striker.ball_and_goal_search())
|
# print(striker.ball_and_goal_search())
|
||||||
try:
|
try:
|
||||||
if striker.align_to_goal():
|
if striker.align_to_goal():
|
||||||
state="simple_kick"
|
state = "align"
|
||||||
except ValueError:
|
except ValueError:
|
||||||
state = 'tracking'
|
state = 'tracking'
|
||||||
|
|
||||||
|
elif state == 'align':
|
||||||
|
striker.mover.set_head_angles(0, 0.25, 0.3)
|
||||||
|
sleep(0.5)
|
||||||
|
try:
|
||||||
|
success = striker.align_to_ball()
|
||||||
|
sleep(0.3)
|
||||||
|
if success:
|
||||||
|
state = 'kick'
|
||||||
|
except ValueError:
|
||||||
|
striker.mover.set_head_angles(0, 0, 0.3)
|
||||||
|
state = 'tracking'
|
||||||
|
|
||||||
elif state == 'kick':
|
elif state == 'kick':
|
||||||
print('KICK!')
|
print('KICK!')
|
||||||
striker.mover.kick()
|
striker.mover.kick(fancy=True)
|
||||||
break
|
break
|
||||||
|
|
||||||
loop_end = time()
|
loop_end = time()
|
||||||
|
|||||||
Reference in New Issue
Block a user