-
Notifications
You must be signed in to change notification settings - Fork 1.9k
HKG: Car Port for Genesis GV80 2025-26 (HDA2, LFA2) #1646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sunnyhaibin
wants to merge
88
commits into
commaai:master
Choose a base branch
from
sunnypilot:gv80-2025
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
88 commits
Select commit
Hold shift + click to select a range
42c98d6
2025-26 gv80/gv80 coupe init
sunnyhaibin 37d100d
Merge branch 'master' into gv80-2025
sunnyhaibin 7ab9364
update them manually
sunnyhaibin 745d32e
dbc
sunnyhaibin f835a71
Merge remote-tracking branch 'sunnypilot/opendbc/gv80-2025' into gv80…
sunnyhaibin cfc8649
more
sunnyhaibin d555422
more
sunnyhaibin 07fbf00
more
sunnyhaibin 0d5e62d
fix
sunnyhaibin af31fc3
small fixes
sunnyhaibin c92883e
no
sunnyhaibin 1477eef
Merge remote-tracking branch 'commaai/opendbc/master' into gv80-2025
sunnyhaibin c24b917
not this one
sunnyhaibin 18303a1
better?
sunnyhaibin 40bb5cc
new parameterized
sunnyhaibin a593957
more
sunnyhaibin 6fd7354
more
sunnyhaibin 3302ad9
Merge remote-tracking branch 'commaai/opendbc/master' into gv80-2025
sunnyhaibin 4e69afd
Update fingerprints.py
royjr cc26bae
Merge branch 'master' into gv80-2025
royjr 2fb5784
Merge remote-tracking branch 'commaai/opendbc/master' into gv80-2025
sunnyhaibin 8f8cbf2
fix
sunnyhaibin 42cb0b7
new route
sunnyhaibin 953a7b4
Merge remote-tracking branch 'commaai/opendbc/master' into gv80-2025
sunnyhaibin ce9b040
Merge branch 'master' into gv80-2025
sunnyhaibin 8be9d7c
new harness
sunnyhaibin 71cd2bf
no json hehe
sunnyhaibin 8fa43d9
more
sunnyhaibin 338a82f
bump steer threshold to 250
sunnyhaibin 2080542
Merge remote-tracking branch 'commaai/opendbc/master' into gv80-2025
sunnyhaibin f313acd
try this out
sunnyhaibin 1863512
fix
sunnyhaibin 4cf852d
test fix
sunnyhaibin 53556e8
update torque reduction gain logic and parameters
sunnyhaibin e588db6
different ramp up and down
sunnyhaibin 32b5d41
ignore road noise
sunnyhaibin c317232
separate gains
sunnyhaibin 55fbcdd
Revert "separate gains"
sunnyhaibin 2dc40c1
Revert "ignore road noise"
sunnyhaibin 2f9b492
Revert "different ramp up and down"
sunnyhaibin f484cbf
Revert "update torque reduction gain logic and parameters"
sunnyhaibin 0d1ac6c
Revert "test fix"
sunnyhaibin ad84956
Revert "fix"
sunnyhaibin 8bb2720
Revert "try this out"
sunnyhaibin 9cffacc
don't do this
sunnyhaibin 5e36ac0
Merge branch 'master' into gv80-2025
sunnyhaibin e413ea3
slight cleanup
sunnyhaibin f1afb32
Revert "no json hehe"
sunnyhaibin 331ed02
Revert "more"
sunnyhaibin 16f0853
add angle smoothing factor for now for live tuning
sunnyhaibin 1c5617b
add ramp up/down for live tuning
sunnyhaibin 41d26f8
gain based EPS force control
sunnyhaibin 9e677f8
Revert "slight cleanup"
sunnyhaibin 083518d
mdps angle just angle steering for now
sunnyhaibin 2e0d5a2
adjust override factor and dangle handling for smoother EPS control
sunnyhaibin dc8d41b
refine dangle handling with adjusted breakpoints and added winding logic
sunnyhaibin 4bde0d7
update speed-based EPS gain ceiling and override factor for improved …
sunnyhaibin dd67aee
implement error-based EPS gain scaling with updated breakpoints for i…
sunnyhaibin f6926d8
todo
sunnyhaibin acd8e77
revert
sunnyhaibin f87d5fd
Revert "revert"
sunnyhaibin ab8543d
Revert "implement error-based EPS gain scaling with updated breakpoin…
sunnyhaibin ef3f455
new smoothing
sunnyhaibin 48149a5
Merge branch 'master' into gv80-2025
sunnyhaibin 06e5874
interface cleanup
sunnyhaibin e10bfd2
Merge remote-tracking branch 'sunnypilot/opendbc/gv80-2025' into gv80…
sunnyhaibin 9d6df3a
safety: torque reduction gain sanity check
sunnyhaibin 4a9689b
refine low-speed angle smoothing logic to reduce EPS noise
sunnyhaibin 808966e
code review suggestions
sunnyhaibin 0d74b9c
Merge branch 'master' into gv80-2025
sunnyhaibin 92dac6e
no ev yet
sunnyhaibin a386849
refine low-speed angle smoothing breakpoints for improved EPS behavior
sunnyhaibin e9e83d7
360 and tests
sunnyhaibin 5a2d1ae
refine low-speed smoothing logic to reduce EPS jitter and overshoot
sunnyhaibin 6904a8c
steer limit by safety for hyundai and round incoming desired angle to…
sunnyhaibin 67c7703
needs to be 360
sunnyhaibin 8e3d9bd
s0mple
sshane 0044e2b
rate limit
sshane d72b018
compute_torque_reduction_gain
sshane 00fd615
testing
886f79d
best fit
sshane fd38b08
Merge remote-tracking branch 'commaai/opendbc/master' into gv80-2025
2886019
unused
17f1f21
Merge remote-tracking branch 'commaai/opendbc/master' into gv80-2025
d934a1e
update name
a937e6a
ruff
699c170
should be 1
d0c76cb
signed
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,50 @@ | ||||||||||||||
| import numpy as np | ||||||||||||||
| from opendbc.car.common.conversions import Conversions as CV | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| class TorqueReductionGainController: | ||||||||||||||
| """ | ||||||||||||||
| Controls the ADAS_ACIAnglTqRedcGainVal signal for HKG CAN-FD angle steering. | ||||||||||||||
|
|
||||||||||||||
| The gain controls how hard the EPS tries to track the commanded angle: | ||||||||||||||
| - Speed-dependent ceiling: higher at highway speed for precision, | ||||||||||||||
| lower at low speed to reduce EPS internal PID oscillation. | ||||||||||||||
| - Override: drops gain when steeringPressed for easy driver takeover. | ||||||||||||||
| - Smooth ramp: prevents sudden gain changes that jerk the steering. | ||||||||||||||
| """ | ||||||||||||||
|
|
||||||||||||||
| SPEED_BP = [0., 10., 30., 50., 80.] # km/h | ||||||||||||||
| SPEED_CEILING = [0.55, 0.55, 0.75, 0.90, 1.0] | ||||||||||||||
|
|
||||||||||||||
| OVERRIDE_FACTOR = 0.1 | ||||||||||||||
|
|
||||||||||||||
| RAMP_RATE = 0.008 | ||||||||||||||
| RECOVERY_RATE = 0.02 | ||||||||||||||
| OVERRIDE_DROP_RATE = 0.05 | ||||||||||||||
|
Comment on lines
+21
to
+23
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
store in reduction per seconds, or just divide by steer step |
||||||||||||||
|
|
||||||||||||||
| def __init__(self): | ||||||||||||||
| self.gain = 0.0 | ||||||||||||||
| self._was_overriding = False | ||||||||||||||
|
|
||||||||||||||
| def update(self, steering_pressed: bool, lat_active: bool, v_ego: float) -> float: | ||||||||||||||
| if not lat_active: | ||||||||||||||
| target = 0.0 | ||||||||||||||
| self._was_overriding = False | ||||||||||||||
| else: | ||||||||||||||
| speed_kmh = v_ego * CV.MS_TO_KPH | ||||||||||||||
| ceiling = float(np.interp(speed_kmh, self.SPEED_BP, self.SPEED_CEILING)) | ||||||||||||||
| target = ceiling * self.OVERRIDE_FACTOR if steering_pressed else ceiling | ||||||||||||||
|
|
||||||||||||||
| if steering_pressed: | ||||||||||||||
| self._was_overriding = True | ||||||||||||||
| elif self._was_overriding and lat_active and self.gain >= target - 0.001: | ||||||||||||||
| self._was_overriding = False | ||||||||||||||
|
|
||||||||||||||
| if target < self.gain: | ||||||||||||||
| rate = self.OVERRIDE_DROP_RATE if steering_pressed else self.RAMP_RATE | ||||||||||||||
| self.gain = max(self.gain - rate, target) | ||||||||||||||
| else: | ||||||||||||||
| rate = self.RECOVERY_RATE if self._was_overriding else self.RAMP_RATE | ||||||||||||||
| self.gain = min(self.gain + rate, target) | ||||||||||||||
|
|
||||||||||||||
| return self.gain | ||||||||||||||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.