This commit is contained in:
havoc420ubuntu 2025-05-18 08:25:14 +00:00
parent f4eab6b296
commit 13c5ab360f
4 changed files with 16 additions and 10 deletions

4
.gitignore vendored
View File

@ -1,3 +1,5 @@
__pycache__/
*.py[cod]
*$py.class
*$py.class
/logs/image/*

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

View File

@ -43,7 +43,7 @@ def run_task_1(ctrl, msg):
section('任务1-2移动到横线', "移动")
# 执行常规的移动操作,不需要 QR 码扫描
move_to_hori_line(ctrl, msg, target_distance=0.8, observe=observe)
move_to_hori_line(ctrl, msg, target_distance=1, observe=observe)
section('任务1-3转弯', "旋转")
direction = False # if res['qr_result'] == 'A-2' else True
@ -68,11 +68,12 @@ def run_task_1(ctrl, msg):
section('任务1-4直线移动', "移动")
move_distance = 0.3
if direction:
move_speed = 0.5
if not direction:
# TODO 这里的校准不一定好用,需要优化
go_straight_by_hori_line(ctrl, msg, distance=move_distance, speed=0.5, observe=observe)
go_straight_by_hori_line(ctrl, msg, distance=move_distance, speed=move_speed, observe=observe)
else:
go_straight(ctrl, msg, distance=move_distance, speed=0.5, observe=observe)
go_straight(ctrl, msg, distance=move_distance, speed=move_speed, observe=observe)
section('任务1-5模拟装货', "停止")
info('机器人躺下,模拟装货过程', "信息")
@ -86,17 +87,20 @@ def run_task_1(ctrl, msg):
ctrl.base_msg.stand_up()
section('任务1-6返回', "移动")
go_straight(ctrl, msg, distance=-(move_distance + res['radius']), speed=0.5, observe=observe)
go_straight(ctrl, msg, distance=-(move_distance + res['radius'] * 2), speed=0.3, observe=observe)
# turn and back
turn_degree(ctrl, msg, degree=-90, absolute=True)
turn_degree(ctrl, msg, degree=-90)
section('任务1-790度转弯', "旋转")
turn_success, res = arc_turn_around_hori_line(
ctrl=ctrl,
msg=msg,
angle_deg=-85,
left=True,
radius=res['radius'] * 2,
angle_deg=85,
left=-direction,
#
pass_align=True,
observe=observe
)
@ -104,7 +108,7 @@ def run_task_1(ctrl, msg):
move_to_hori_line(ctrl, msg, target_distance=0.4, observe=observe)
section('任务1-990度旋转', "旋转")
turn_degree(ctrl, msg, degree=90, absolute=True)
turn_degree(ctrl, msg, degree=90)
section('任务1-10: y校准准备 task-2', "移动")
# TODO