添加倒车功能并增加最高速度限制到50km/h#1
Open
XieTJ wants to merge 1 commit into
Open
Conversation
### 功能改进 - 增加最高速度限制 :从30km/h提升到50km/h,提高车辆行驶速度 - 添加倒车功能 :实现按x键在速度接近停止时切换倒车模式 - 安全机制 :只有在速度<1km/h时才允许切换倒车模式 - 视觉反馈 :倒车模式下显示红色"REVERSE MODE"提示 ### 技术实现 - 修改 SimpleController 类,增加 manual_reverse 标志和 toggle_reverse() 方法 - 调整控制指令返回值,增加reverse参数 - 在主循环中添加x键处理逻辑 - 在显示界面添加倒车状态指示 - 保留原代码作为注释,便于回溯 ### 操作说明 1. 按s键减速到接近停止(速度<1km/h) 2. 按x键切换到倒车模式 3. 车辆会自动向后行驶 4. 再次按x键退出倒车模式,恢复前进 这些修改提升了系统的功能性和用户体验,同时保持了代码的可读性和可维护性。
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.
修改概述
修改的详细描述
最高速度限制提升
倒车功能实现
SimpleController类中添加manual_reverse标志toggle_reverse()方法用于切换倒车/前进模式reverse参数安全机制
用户界面优化
经过了什么样的测试?
运行效果
2026-04-15.213107.mp4
2026-04-15.213209.mp4