fix up 820
This commit is contained in:
parent
fbe9f67a4f
commit
ddae35c69a
29
main.py
29
main.py
@ -125,18 +125,18 @@ def main():
|
||||
# arrow_direction = run_task_2(Ctrl, msg, xy_flag=False)
|
||||
# print('🏹 arrow_direction: ', arrow_direction)
|
||||
|
||||
arrow_direction='right'
|
||||
arrow_direction='left'
|
||||
|
||||
|
||||
#TAG task - 2.5
|
||||
run_task_2_5(Ctrl, msg, direction=arrow_direction)
|
||||
# run_task_2_5(Ctrl, msg, direction=arrow_direction)
|
||||
|
||||
|
||||
#TAG task - 3 / 4 - part I
|
||||
if arrow_direction == 'left':
|
||||
run_task_4(Ctrl, msg)
|
||||
else:
|
||||
run_task_3(Ctrl, msg, time_sleep=TIME_SLEEP) # 直接上下坡,然后走到 黄灯前原地踏步的部分
|
||||
# #TAG task - 3 / 4 - part I
|
||||
# if arrow_direction == 'left':
|
||||
# run_task_4(Ctrl, msg)
|
||||
# else:
|
||||
# run_task_3(Ctrl, msg, time_sleep=TIME_SLEEP) # 直接上下坡,然后走到 黄灯前原地踏步的部分
|
||||
|
||||
|
||||
# TAG task - 5
|
||||
@ -145,15 +145,15 @@ def main():
|
||||
# print(success)
|
||||
# print(qr)
|
||||
|
||||
# # TAG task - 3 / 4 - part II
|
||||
# if arrow_direction == 'left':
|
||||
# run_task_4_back(Ctrl, msg)
|
||||
# else:
|
||||
# run_task_3_back(Ctrl, msg)
|
||||
# TAG task - 3 / 4 - part II
|
||||
if arrow_direction == 'left':
|
||||
run_task_4_back(Ctrl, msg)
|
||||
else:
|
||||
run_task_3_back(Ctrl, msg)
|
||||
|
||||
|
||||
#TAG task - 2.5 - back
|
||||
# run_task_2_5_back(Ctrl, msg, direction=arrow_direction)
|
||||
run_task_2_5_back(Ctrl, msg, direction=arrow_direction)
|
||||
|
||||
|
||||
# TAG task - 2 - back
|
||||
@ -176,7 +176,6 @@ def main():
|
||||
print("\n程序被用户中断")
|
||||
except Exception as e:
|
||||
import traceback
|
||||
import sys
|
||||
exc_type, exc_value, exc_tb = sys.exc_info()
|
||||
tb = traceback.extract_tb(exc_tb)
|
||||
if tb:
|
||||
@ -311,7 +310,7 @@ class Robot_Ctrl(object):
|
||||
self.runing = 0
|
||||
self.rec_thread.join()
|
||||
self.send_thread.join()
|
||||
self.image_processor.destroy()
|
||||
# self.image_processor.destroy()
|
||||
# 销毁 MarkerRunner
|
||||
if hasattr(self, 'marker_runner') and self.marker_runner is not None:
|
||||
try:
|
||||
|
@ -163,7 +163,7 @@ def run_task_2(ctrl, msg, xy_flag=False):
|
||||
#第一个圆弧
|
||||
(0.45, 0, 0.72,0,0,0,6),
|
||||
#微调路径
|
||||
# (0.3,0,0,0,0,0,0.8),
|
||||
(0.3,0,0,0,0,0,0.8),
|
||||
# #第二个圆弧
|
||||
(0.4,0,-0.65,0,0,0,7.9),
|
||||
# #微调路径
|
||||
@ -171,13 +171,13 @@ def run_task_2(ctrl, msg, xy_flag=False):
|
||||
# # 第三个圆弧
|
||||
(0.4,0,0.73,0,0,0,6),
|
||||
# #微调路径
|
||||
# (0.3,0,0,0,0,0,1.3),
|
||||
(0.3,0,0,0,0,0,1.3),
|
||||
# #第四个圆弧
|
||||
(0.4,0,-0.72,0,0,0,3.6),
|
||||
# #绕出来
|
||||
# (0.3,0,0.6,0,0,0,1),
|
||||
(0.3,0,0.6,0,0,0,1),
|
||||
# #前走一点
|
||||
# (0.3,0,0,0,0,0,0.5)
|
||||
(0.3,0,0,0,0,0,0.5)
|
||||
] # [vel_x, vel_z] 对应 [左转, 右转, 左转]
|
||||
|
||||
gotoxy=[
|
||||
|
@ -21,6 +21,7 @@ from base_move.go_to_xy import go_to_x_v2
|
||||
from base_move.center_on_dual_tracks import center_on_dual_tracks
|
||||
from file_send_lcmt import file_send_lcmt
|
||||
from utils.yellow_area_analyzer import analyze_yellow_area_ratio
|
||||
from utils.detect_dual_track_lines import detect_dual_track_lines
|
||||
|
||||
# 创建本模块特定的日志记录器
|
||||
logger = get_logger("任务3")
|
||||
|
@ -28,6 +28,9 @@ STONE_DISTANCE = 4.0 # TODO 距离参数需要微调
|
||||
RED_RATIO_THRESHOLD = 0.35 # TODO 红色区域比例阈值需要微调
|
||||
|
||||
def run_task_4(ctrl, msg):
|
||||
info('开始执行任务4...', "启动")
|
||||
turn_degree_v2(ctrl, msg, 90, absolute=True)#wzl:8.20新增,右转90度
|
||||
|
||||
section('任务4-1:直线移动', "移动")
|
||||
pass_stone(ctrl, msg, distance=STONE_DISTANCE)
|
||||
|
||||
|
@ -15,6 +15,9 @@
|
||||
# ros2 lifecycle set /stereo_camera configure
|
||||
# ros2 lifecycle set /stereo_camera activate
|
||||
|
||||
# 启动AI相机
|
||||
# ros2 run camera_test camera_server
|
||||
|
||||
#/image_left
|
||||
#/image_right
|
||||
#/image_rgb
|
||||
|
Loading…
x
Reference in New Issue
Block a user