Skip to content

无人车键盘控制方向 - #4192

Closed
yuboyyy wants to merge 27 commits into
OpenHUTB:mainfrom
yuboyyy:main
Closed

yuboyyy wants to merge 27 commits into
OpenHUTB:mainfrom
yuboyyy:main

Conversation

@yuboyyy

@yuboyyy yuboyyy commented Dec 21, 2025

Copy link
Copy Markdown
Contributor

修改概述:

修改的详细描述

1.新增基于 Pygame 的无人车键盘控制可视化仿真功能,实现虚拟车辆前进 / 后退 / 左转 / 右转 / 停止的交互控制,可直接运行生成效果图
2.实现道路场景渲染(灰色背景 + 白色网格)、带朝向的车辆绘制(红色车身 + 黑色车头标识),补充实时状态显示(位置、朝向角度、控制提示)
3.增加 60 帧帧率控制、边界检测(防止车辆驶出窗口)及 Q 键退出 / 空格停止功能,优化交互流畅度与使用体验
代码结构清晰,支持参数灵活调整(移动速度、转向灵敏度、车辆颜色),预留障碍物绘制、轨迹记录等扩展空间

经过了什么样的测试?

  1. 操作系统
  2. Python版本等

运行效果

动图、视频、截图等
屏幕截图 2025-12-21 103356
屏幕截图 2025-12-21 103725

Comment thread src/Smart_car/path.py
def draw_car(x, y, angle):
"""绘制带方向的无人车(三角形+矩形,直观显示朝向)"""
# 保存当前坐标系
pygame.draw.rect(screen, GRAY, (0, 0, WINDOW_WIDTH, WINDOW_HEIGHT))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

依约定需要用carla进行车辆的模拟

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants