Curvature Smoothing - #189
Open
Praeuner wants to merge 5 commits into
Open
Conversation
Adds self.kappa_gain_filt that is a low pass filtered kappa_cmd used for the input of the curvature_gain interpolation. Reduces noise from road imperfections and other sudden wheel movements for setting gain.
Increase range of interpolation to .0005 - .002 (2000m rad to 500m rad).
Prevents rapid switching between .125 and .5 predicted curvature weight on curve exit due to _desired_falling flipping back and forth.
forgot init on stall
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.
Purpose: Reduce oscillations through curves and coming out of curves. Allows larger gaps between high tuned high speed gain and low tuned dampening factors.
curvature_gain interp range:
Previous interpolation range was small enough (1600m rad to 1000m rad) that in many situations, the car would go through the whole range at the very start of a curve. Depending on gap between low_gain_calc and high_gain_calc, this could cause a large, fast swing in gain resulting in a noticeable jerk. Further oscillations could occur through curves that fell close to previous interp range as the car attempted to correct.
kappa_gain_filt:
This, along with the interp range increase, should reduce oscillations that start due to road imperfections or other sudden movements. Effectively sets curve gain based on average of last 300ms of kappa_cmd.
b_blend steps:
While coming out of curves, _desired_falling can rapidly switch between true/false due to road imperfections. This would cause b_blend value to swap between .125 and .5, causing balance between predicted_curvature and desired_curvature to flap back and forth. Step function prevents b_blend from increasing or decreasing by more than .1 per cycle.
Notes: I tested this over ~1.5 hours of highway driving and it made a fairly large difference for my car, particularly smoothing out curve entrances and lane changes. Did not have the new lane-centering enabled. Not sure how you do road testing nor what the test file folder does, but would be willing to learn/do more.