车辆状态显示器#6982
Open
choooooooovy wants to merge 17 commits into
Open
Conversation
Contributor
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.


修改概述:
修改的详细描述
在 source/carlaenv.py 中添加了多视角模式切换功能,实现了 set_spectator_mode 方法,支持三种视角模式切换,包括第三人称跟随视角、俯视视角和第一人称视角,用户可以根据需要自由切换观察角度。
在 source/carlaenv.py 中优化了镜头追踪机制,通过引入线性插值算法实现了平滑的镜头跟随效果,使用 smooth_factor 参数控制平滑程度,避免了镜头的突兀跳转,使画面过渡更加流畅自然。
在 source/carlaenv.py 中实现了速度仪表盘功能,添加了 get_speed 和 draw_speed_hud 方法,通过计算车辆速度向量的模长得到实时速度,并转换为 km/h 单位显示在车辆上方,便于直观观察车辆行驶速度。
在 source/carlaenv.py 中添加了奖励和碰撞信息显示功能,实现了 draw_reward_hud 方法,在车辆后方显示当前累积奖励值,当发生碰撞时会以红色高亮显示碰撞警告信息,提供即时的视觉反馈。
在 source/carlaenv.py 中实现了档位显示功能,通过 get_gear 和 draw_gear_hud 方法判断当前车辆的行驶状态,将档位分为前进档、倒车档和空档三类,并分别以绿色、红色和黄色的颜色编码在车顶显示对应的档位标识。
在 source/carlaenv.py 中添加了车辆状态显示器功能,实现了 draw_vehicle_status 方法,在车辆右侧显示完整的驾驶状态面板,包括当前行驶速度、档位状态、油门开度进度条、刹车踏板状态以及方向盘转向方向和角度,使车辆控制状态一目了然。
在 demo.py 演示脚本中添加了方向箭头指示功能,在车辆前方绘制青色方向箭头,箭头由主线和两侧的箭头头部组成,随车辆朝向动态变化,清晰指示车辆的前进方向。
在 config.yaml 配置文件中将 car_num 参数从 50 减少到 10,降低了模拟器中同时运行的交通车辆数量,减少了计算资源消耗,缓解了模拟器卡顿问题。
在 .gitignore 文件中添加了 checkpoints 目录和 pt 文件的忽略规则,防止训练产生的大型模型权重文件被错误提交到 Git 仓库,避免了因文件大小超过 GitHub 限制导致的推送失败问题。
经过了什么样的测试?
运行效果(动图、视频、图片、链接等)