- Replace direct stop command with ctrl.base_msg.stop_force() in move_base_hori_line - Enable observation mode in task_1 by setting observe to True - Remove unnecessary return statement in task_1
26 lines
640 B
Python
26 lines
640 B
Python
import time
|
||
import cv2
|
||
import sys
|
||
import os
|
||
|
||
# 添加父目录到路径,以便能够导入utils
|
||
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||
from base_move.move_base_hori_line import move_to_hori_line, arc_turn_around_hori_line
|
||
|
||
observe = True
|
||
|
||
def run_task_1(ctrl, msg):
|
||
print('Running task 1...')
|
||
|
||
# v2
|
||
arc_turn_around_hori_line(ctrl, msg, angle_deg=90, left=False, observe=observe)
|
||
|
||
move_to_hori_line(ctrl, msg, target_distance=1, observe=observe)
|
||
|
||
arc_turn_around_hori_line(ctrl, msg, angle_deg=180, left=True, observe=observe)
|
||
|
||
move_to_hori_line(ctrl, msg, observe=observe)
|
||
|
||
|
||
|