Repository navigation
无人车安全气囊触发系统 - #3741
Merged
Merged
无人车安全气囊触发系统#3741
Conversation
donghaiwang
approved these changes
Dec 19, 2025
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.
修改概述:
无人车安全气囊触发系统。给无人车前端安装一个碰撞压力器,压力器能够测量0到200万牛的压力。当压力为0到4万牛时,系统显示车辆碰撞,四个黄色的字。当压力大于4万牛,小于200万牛时,系统显示“危险,安全气囊已打开”几个红色的字
修改的详细描述
1.压力传感器模拟 生成 0
200 万牛的压力数据 Carla Python API + 随机值 / 物理碰撞检测4 万牛 / 4 万~200 万牛区间 Python 条件分支语句2.阈值判断逻辑 区分 0
3.可视化显示 黄色 “车辆碰撞” / 红色 “危险,安全气囊已打开” PyGame 绘制 HUD 文字
4.无人车控制 可选:让车辆自动行驶 / 手动控制触发碰撞 Carla 车辆控制 API
经过了什么样的测试?
1.启动 CARLA 服务端后,运行上述 Python 代码。
2.弹出 PyGame 窗口,控制台实时打印压力值。
3.当压力进入 4 万~200 万牛 区间时,窗口文字变为红色,表示安全气囊打开;否则为黄色,表示车辆碰撞
运行效果
动图、视频、截图等
2025-12-18.200249.mp4