Refactor main execution flow to enable task execution based on arrow direction detection. Integrate new movement functions for improved control and clarity, while removing commented-out code for better readability.
This commit is contained in:
parent
4db80baf9b
commit
37cf8f3106
35
main.py
35
main.py
@ -32,6 +32,7 @@ from task_5.task_5 import run_task_5
|
||||
|
||||
from base_move.turn_degree import turn_degree, turn_degree_v2
|
||||
from base_move.center_on_dual_tracks import center_on_dual_tracks
|
||||
from base_move.go_to_xy import go_to_x_v2, go_to_y_v2
|
||||
|
||||
from utils.log_helper import info
|
||||
|
||||
@ -48,32 +49,32 @@ def main():
|
||||
info("Recovery stand", "info")
|
||||
Ctrl.base_msg.stand_up()
|
||||
Ctrl.base_msg.stop() # BUG 垃圾指令 for eat
|
||||
|
||||
|
||||
# time.sleep(100) # TEST,
|
||||
run_task_1(Ctrl, msg, time_sleep=TIME_SLEEP)
|
||||
|
||||
# arrow_direction = run_task_2(Ctrl, msg, xy_flag=False)
|
||||
arrow_direction = 'right' # TEST
|
||||
arrow_direction = run_task_2(Ctrl, msg, xy_flag=False)
|
||||
# arrow_direction = 'right' # TEST
|
||||
|
||||
# info(f"识别到箭头方向: {arrow_direction}", "info")
|
||||
# run_task_2_5(Ctrl, msg, direction=arrow_direction)
|
||||
info(f"识别到箭头方向: {arrow_direction}", "info")
|
||||
run_task_2_5(Ctrl, msg, direction=arrow_direction)
|
||||
|
||||
# if arrow_direction == 'left':
|
||||
# run_task_4(Ctrl, msg)
|
||||
# else:
|
||||
# run_task_3(Ctrl, msg, time_sleep=TIME_SLEEP)
|
||||
if arrow_direction == 'left':
|
||||
run_task_4(Ctrl, msg)
|
||||
else:
|
||||
run_task_3(Ctrl, msg, time_sleep=TIME_SLEEP)
|
||||
|
||||
# turn_degree_v2(Ctrl, msg, degree=90, absolute=True)
|
||||
# run_task_5(Ctrl, msg, direction=arrow_direction, time_sleep=TIME_SLEEP)
|
||||
turn_degree_v2(Ctrl, msg, degree=90, absolute=True)
|
||||
run_task_5(Ctrl, msg, direction=arrow_direction, time_sleep=TIME_SLEEP)
|
||||
|
||||
# if arrow_direction == 'left':
|
||||
# run_task_3_back(Ctrl, msg)
|
||||
# else:
|
||||
# run_task_4_back(Ctrl, msg)
|
||||
if arrow_direction == 'left':
|
||||
run_task_3_back(Ctrl, msg)
|
||||
else:
|
||||
run_task_4_back(Ctrl, msg)
|
||||
|
||||
# run_task_2_5_back(Ctrl, msg, direction=arrow_direction)
|
||||
run_task_2_5_back(Ctrl, msg, direction=arrow_direction)
|
||||
|
||||
# run_task_2_back(Ctrl, msg)
|
||||
run_task_2_back(Ctrl, msg)
|
||||
|
||||
run_task_1_back(Ctrl, msg, time_sleep=TIME_SLEEP)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user