Repository navigation
无人车防刮车底系统 - #3850
Merged
Merged
无人车防刮车底系统#3850
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修改概述:
给无人车地盘安装一个测量距离,地面距离的器件以后。当无人车底盘距离地面距离大于10cm时,系统显示安全两个绿色的字。当无人车底盘距离地面距离为5~10cm时,系统显示注意安全,两个黄色的字。当无人车底盘距离地面距离小于5cm时,系统显示危险两个红色的字
修改的详细描述
模拟底盘测距传感器:通过获取车辆离地间隙估算距离(实际项目可替换为激光雷达 / 超声波传感器数据)。
距离阈值判断:
>10cm → 绿色 安全
5~10cm → 黄色 注意安全
<5cm → 红色 危险
HUD 实时渲染:使用 PyGame 在窗口中绘制状态文本
经过了什么样的测试?
启动 CARLA 模拟器:在终端执行 ./CarlaUE4.sh(Linux)或 CarlaUE4.exe(Windows)。
运行代码:在 PyCharm 中直接运行该脚本,会自动生成车辆并弹出 HUD 窗口。
交互测试:可通过 CARLA 自带的 manual_control.py 脚本控制车辆移动,观察不同地形下的距离变化和状态提示。
运行效果
动图、视频、截图等
2025-12-19.144934.mp4