mi-task/task_1/task_1.py
havoc420ubuntu f484dab840 refactor(base_move): simplify arc turn logic and remove precise turn functions
- Simplified arc_turn_around_hori_line function:
  - Removed smooth stop method call
  - Added print statements for debugging
- Removed unused arc_turn_precise and arc_turn_around_hori_line_precise functions
- Updated task_1.py to use simplified arc_turn_around_hori_line
-
2025-05-15 14:37:53 +00:00

31 lines
763 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import time
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
print('😺 task 1 - 1')
arc_turn_around_hori_line(ctrl, msg, angle_deg=70, left=False, observe=observe)
print('😺 task 1 - 2')
move_to_hori_line(ctrl, msg, target_distance=1, observe=observe)
return
print('😺 task 1 - 3')
arc_turn_around_hori_line(ctrl, msg, angle_deg=160, left=True, observe=observe)
print('😺 task 1 - 4')
move_to_hori_line(ctrl, msg, observe=observe)