Merged
Conversation
sshane reviewed Jul 7, 2025
Comment on lines +18 to +37
| def anti_overshoot(new_curvature, last_curvature, v_ego): | ||
| diff = 0.05 | ||
| tau = 5 # 5s smooths over the overshoot | ||
| dt = DT_CTRL * CarControllerParams.STEER_STEP | ||
| alpha = 1 - np.exp(-dt/tau) | ||
| | ||
| lataccel = new_curvature * (v_ego ** 2) | ||
| last_lataccel = last_curvature * (v_ego ** 2) | ||
| | ||
| if lataccel > last_lataccel + diff: | ||
| last_lataccel = lataccel - diff | ||
| elif lataccel < last_lataccel - diff: | ||
| last_lataccel = lataccel + diff | ||
| last_lataccel = alpha * lataccel + (1 - alpha) * last_lataccel | ||
| | ||
| output_curvature = last_lataccel / (v_ego ** 2 + 1e-6) | ||
| | ||
| return np.interp(v_ego, [5, 10], [new_curvature, output_curvature]) | ||
| | ||
| |
Contributor
There was a problem hiding this comment.
incorrect indentation (2 spaces)
sshane reviewed Jul 8, 2025
| last_lataccel = lataccel + diff | ||
| last_lataccel = alpha * lataccel + (1 - alpha) * last_lataccel | ||
| | ||
| output_curvature = last_lataccel / (v_ego ** 2 + 1e-6) |
Contributor
There was a problem hiding this comment.
we use max below this in this file. better to keep things consistent:
MAX_LATERAL_ACCEL / (max(v_ego_raw, 1) ** 2) ssysm pushed a commit to MOTIF-lab/opendbc that referenced this pull request Jul 9, 2025
* Bronco special * ignore low speed * fixes * less smooth * typo * better names * typo
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.
Validation