改进避障逻辑,避免过度转向#3297
Merged
Merged
Conversation
donghaiwang
approved these changes
Dec 16, 2025
donghaiwang
reviewed
Dec 16, 2025
|
|
||
|
|
||
| # 在 ImprovedNeuralController 类的 apply_obstacle_avoidance 方法中,修改以下部分: | ||
| def apply_obstacle_avoidance(self, throttle, brake, steer, obstacle_info, speed): |
donghaiwang
reviewed
Dec 16, 2025
| if distance < self.emergency_brake_distance: | ||
| print(f"紧急刹车!距离障碍物: {distance:.1f}m") | ||
|
|
||
| return 0.0, 1.0, 0.0 # 紧急情况下保持直行,只刹车 |
Member
|
需要贴运行效果 |
donghaiwang
added a commit
that referenced
this pull request
Dec 16, 2025
This reverts commit 656fc55.
Merged
donghaiwang
pushed a commit
that referenced
this pull request
Dec 16, 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.
1.分级避障:近距急刹,中距减速转向
2.速度自适应:根据距离计算安全目标速度
3.转向平滑:避免过度转向,保持控制稳定性
4.角度阈值:正前方
Uploading 屏幕录制 2025-12-01 093506.mp4…
±15°内才触发避障转向