Skip to content

Curvature Smoothing - #189

Open
Praeuner wants to merge 5 commits into
BluePilotDev:bp-devfrom
Praeuner:bp-curve-gain-interp
Open

Curvature Smoothing#189
Praeuner wants to merge 5 commits into
BluePilotDev:bp-devfrom
Praeuner:bp-curve-gain-interp

Conversation

@Praeuner

Copy link
Copy Markdown
Contributor

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.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant