🎏 add readme

This commit is contained in:
Havoc 2025-05-13 22:32:03 +08:00
parent 765be6d547
commit 88df535378
17 changed files with 66 additions and 9 deletions

54
README.md Normal file
View File

@ -0,0 +1,54 @@
# 任务模块
## top
1. “装货 / qrcode”
2. 曲线赛道
3.上下坡
c.存在两种可能性
4. 石板道
5. 栅栏 / 栏杆
## Task-1出生点 - 取货
![alt text](./res/readme/image.png)
从二维码取货完,然后走到弯道入口。
![alt text](./res/readme/image-1.png)
## Task-2弯道任务
过去,以及回来。两个方向都需要。
![alt text](./res/readme/image-2.png)
![alt text](./res/readme/image-3.png)
## Task-2.5:识别
根据二维码决定方向。
## Task-3上下坡
同样需要考虑两个方向。(正式计时各有一半的概率)
> 感觉两个坡度稍微有一点点区别。
![alt text](./res/readme/image-4.png)
![alt text](./res/readme/image-5.png)
以及反方向。
## Task-4石板路
![alt text](./res/readme/image-6.png)
![alt text](./res/readme/image-7.png)
## Task-5过栅栏
![alt text](./res/readme/image-8.png)
## Task-5.5:走向卸货
从上一个赛道结束到 B 二维码。
## Task-6卸货
也可能在另一边。
这里是感觉在走过去的过程中就能判断二维码。
![alt text](./res/readme/image-9.png)
![alt text](./res/readme/image-10.png)

View File

@ -9,7 +9,7 @@ def turn_degree(ctrl, msg, degree=90, absolute=False):
ctrl: Robot_Ctrl 对象包含里程计信息
msg: robot_control_cmd_lcmt 对象用于发送命令
degree: 要旋转的角度正值表示逆时针负值表示顺时针默认为90度
absolute: 是否绝对角度默认为True
absolute: 是否绝对角度默认为 False
返回:
Bool: 是否成功旋转到指定角度

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

BIN
res/readme/image-1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
res/readme/image-10.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
res/readme/image-2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
res/readme/image-3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

BIN
res/readme/image-4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

BIN
res/readme/image-5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
res/readme/image-6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

BIN
res/readme/image-7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

BIN
res/readme/image-8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
res/readme/image-9.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
res/readme/image.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View File

@ -5,18 +5,20 @@ import sys
import cv2
import argparse
# 添加工作目录到路径
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
# 添加项目根目录到路径
current_dir = os.path.dirname(os.path.abspath(__file__))
project_root = os.path.dirname(os.path.dirname(current_dir))
sys.path.append(project_root)
from utils.decode_arrow import detect_arrow_direction, visualize_arrow_detection
def main():
# 创建参数解析器
parser = argparse.ArgumentParser(description='箭头方向检测测试')
parser.add_argument('--image', default="image_20250511_121219.png",
parser.add_argument('--image', default="res/arrows/left/image-2.png",
help='图像文件路径 (默认: image_20250511_121219.png)')
parser.add_argument('--save', default="arrow_detection_result.jpg",
help='保存可视化结果的路径 (默认: arrow_detection_result.jpg)')
parser.add_argument('--save', default="res/arrows/test/arrow_detection_result.jpg",
help='保存可视化结果的路径 (默认: res/arrows/test/arrow_detection_result.jpg)')
parser.add_argument('--show', action='store_true',
help='显示可视化结果')

1
utils/__init__.py Normal file
View File

@ -0,0 +1 @@
# 使 utils 作为一个 Python 包

View File

@ -163,9 +163,9 @@ def visualize_arrow_detection(image, save_path=None):
resized = cv2.resize(result, dim, interpolation=cv2.INTER_AREA)
# 显示结果
cv2.imshow('Arrow Detection Process', resized)
cv2.waitKey(0)
cv2.destroyAllWindows()
# cv2.imshow('Arrow Detection Process', resized)
# cv2.waitKey(0)
# cv2.destroyAllWindows()
# 用法示例
if __name__ == "__main__":