Enhance main.py and task_3.py by enabling task execution in main and adjusting target y-coordinate for improved performance. Add additional logging for arrow direction recognition in main.py.

This commit is contained in:
havoc420ubuntu 2025-06-01 07:35:30 +00:00
parent 9ce1a04fb4
commit dfb114257d
2 changed files with 6 additions and 2 deletions

View File

@ -51,11 +51,15 @@ def main():
Ctrl.base_msg.stop() # BUG 垃圾指令 for eat Ctrl.base_msg.stop() # BUG 垃圾指令 for eat
# time.sleep(100) # TEST, # time.sleep(100) # TEST,
# run_task_1(Ctrl, msg, time_sleep=TIME_SLEEP) run_task_1(Ctrl, msg, time_sleep=TIME_SLEEP)
arrow_direction = run_task_2(Ctrl, msg, xy_flag=False) arrow_direction = run_task_2(Ctrl, msg, xy_flag=False)
# arrow_direction = 'right' # TEST # arrow_direction = 'right' # TEST
info(f"识别到箭头方向: {arrow_direction}", "info")
info(f"识别到箭头方向: {arrow_direction}", "info")
info(f"识别到箭头方向: {arrow_direction}", "info")
info(f"识别到箭头方向: {arrow_direction}", "info")
info(f"识别到箭头方向: {arrow_direction}", "info") info(f"识别到箭头方向: {arrow_direction}", "info")
run_task_2_5(Ctrl, msg, direction=arrow_direction) run_task_2_5(Ctrl, msg, direction=arrow_direction)

View File

@ -205,7 +205,7 @@ def pass_up_down(ctrl, msg):
descent_speed_threshold = -0.05 # 检测到开始下坡的速度阈值(负值表示下降) descent_speed_threshold = -0.05 # 检测到开始下坡的速度阈值(负值表示下降)
max_iterations = 200 # 最大循环次数,作为安全保障 max_iterations = 200 # 最大循环次数,作为安全保障
start_height = ctrl.odo_msg.xyz[2] # 记录起始高度 start_height = ctrl.odo_msg.xyz[2] # 记录起始高度
y_target = 4 # 目标y坐标达到此值时停止 y_target = 4.5 # 目标y坐标达到此值时停止
# 阶段控制 # 阶段控制
descending_detected = False # 是否检测到正在下坡 descending_detected = False # 是否检测到正在下坡