- Add support for two versions of horizontal line detection functions - Update move_base_hori_line.py to use the selected detection version - Modify example_robot_log.py and test/main.py to use the new detection version - Update image saving path in rgb-camera/img-raw-get.py - Improve logging and error handling in detect_track.py
51 lines
1.1 KiB
Python
51 lines
1.1 KiB
Python
import time
|
||
import sys
|
||
import os
|
||
|
||
# 添加父目录到路径,以便能够导入utils
|
||
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||
|
||
from base_move.turn_degree import turn_degree
|
||
from base_move.move_base_hori_line import arc_turn_around_hori_line, align_to_horizontal_line
|
||
from utils.log_helper import LogHelper, get_logger, section, info, debug, warning, error, success, timing
|
||
|
||
observe = True
|
||
|
||
def run_task_2_5(Ctrl, msg):
|
||
section('任务2.5:预备进入任务3', "启动")
|
||
|
||
# TEST
|
||
turn_degree(Ctrl, msg, 90, absolute=observe)
|
||
|
||
align_to_horizontal_line(
|
||
Ctrl,
|
||
msg,
|
||
detect_func_version=2,
|
||
observe=observe,
|
||
)
|
||
|
||
return
|
||
|
||
section('任务2.5-1:第一次旋转', "移动")
|
||
|
||
arc_turn_around_hori_line(
|
||
Ctrl,
|
||
msg,
|
||
angle_deg=-90,
|
||
target_distance=0.5,
|
||
detect_func_version=2,
|
||
observe=observe,
|
||
)
|
||
|
||
section('任务2.5-2:第二次旋转', "移动")
|
||
|
||
arc_turn_around_hori_line(
|
||
Ctrl,
|
||
msg,
|
||
angle_deg=90,
|
||
target_distance=0.5,
|
||
detect_func_version=2,
|
||
observe=observe,
|
||
)
|
||
|
||
|