* Add enhanced HyundaiCAN extension
Introduced HyundaiCanEXT for improved object parsing and control integration, leveraging new fields like lead distance and relative speed in CarControlSP.
Refactored controlsd to utilize a modular design with ControlsdExt for additional sunnypilot specific functionality.
* self.cc_sp
* Refactor CarControlSP handling for improved state updates
* Add HyundaiCanFDEXTParams for CANFD ACC control parameters
* hud_control.leadVisible
* hysteresis for lead visible
* add lead car & distance indicators
* Revert "add lead car & distance indicators"
This reverts commit 89dc6c6a75a1aa321bc6fc84f4a77a11f32df899.
* Remove canfd
* Hysteresis parameters
* staticmethod for internal methods without self instance.
Break up long line in hyundaican_ext for readability
* add support for can-fd
* add comments & values for new dbc signals
* cleanup - keep only regen related stuff
* CLEAN!!
* not needed for this PR
* reduce duplicate code
* better hysteresis
* combine hysteresis variables
* refactor(hyundai): replace HyundaiCanEXT with LeadDataCarController
- Introduced a modular `LeadDataCarController` replacing `HyundaiCanEXT` to simplify lead data handling.
- Improved maintainability by abstracting lead-related data into reusable components.
- Added unit tests for `LeadDataCarController` to ensure correctness.
* Refactor: Consolidate lead vehicle data into `LeadData` struct
- Replaced separate `leadDistance`, `leadRelSpeed`, and `leadVisible` with `LeadData` struct for cleaner organization.
- Updated references and logic to use the new `LeadData` structure across modules.
* Refactor: Update tests to use `LeadData` struct in `make_carcontrolsp`
- Replaced individual lead attributes with `leadData` struct to align with recent refactor.
- Improves consistency and code clarity.
* introduce leadOne and leadTwo from radard
* update to use that instead
---------
Co-authored-by: nayan8teen <nayan8teen@gmail.com>
Co-authored-by: DevTekVE <devtekve@gmail.com>
Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
* preview
* fmt
* fix formatting!
* Revert "fix formatting!"
This reverts commit 559d291cfa27c3500e5fa3105ffdea809bdd1b27.
* some of these are good, but can enable in steps
* and
* ruff check --fix
* preview
* format
* Make upper conditional as well so we have MOAR POWER
* MORE README.md
* MORE README.md
* Whoops
* README.md
* Actuators.accel makes a difference. Interesting..
* Actuators.accel makes a difference. Interesting..
* Actuators.accel makes a difference. Interesting..
* bump actuators
* Try turning jerk into a parabola
* Try turning jerk into a parabola
* Blend with current accel for more parabolas
* Blend with current accel for more parabolas
* Update README.md
* Remove some unused vars
* Remove some unused vars
* Maybe I was asleep but somehow it worked.
* Maybe I was asleep but somehow it worked.
* 70/30 split
* 60/35 split
* 67:33 split
* use Sqrt for tiny values to increase factor. Oh, also add a test file.
* use Sqrt for tiny values to increase factor. Oh, also add a test file.
* Raise these to restart tests
* Raise these to restart tests
* Update jerk calculation mimicking j_ego math.
* README.md
* Update timestep
* Fix test
* Readability
* Lower time
* Add higher limits for CANFD
* Send these as a floating object. update comments to add TODO msg.
* Conditional flags
* yes its a little weird but heres why:
` "aReqValue": long_state.accel_value if enabled else a_val`
its only to not have merge conflicts with syncs from this file, because if not enabled a_val is already at 0 anyways.
* Make it easier to read
* Chronological order
* Trigger rebuild
* This is an internal test on my end. Disregard, for now
* fw version for my car...
* remove fw version as that was a test
* refactor that while passing internal tests
* bump safety mutation test
* no longer need this
* all should match 50 Hz
* jerk limits are 0 when not enabled
* bump safety mutation test
* match stock behavior for accel
* do our own clipping
* apply upper/lower dynamically
* bump test
* bump test
* Higher lower limit
* move desired accel force zero in tuning controller
* bump
* abs it here
* fix logic
* make sure it resets to 0, enforced in safety
* Test a few things
* Higher jerk for VOACC
* Elantra specific
* raise `off` to stock
* bump opendbc test
* allow jerk calculations at all times
* no more starting state
* higher seems better for elantra ice
* update defaults
* no need for elantra specific
* more default
* more
* match aReqVale
* we dont need such high accel jerk when above 20m/s. This is cruise control, not a racecar.
* 0.45 default long actuator delay
* align type hint
* add lower jerk multiplier for HYUNDAI_IONIQ
* Change min jerk
* should be float
* Change min jerk
* Change min jerk upper
* Change max jerk upper
* Change max jerk upper
* Change max jerk upper
* step + threshold + first order filter to smooth
* spacing
* constants
* Revert "constants"
This reverts commit 442b0c8c75d7dfe30ee04a6239a3afcb1077872b.
* Revert "spacing"
This reverts commit 771d2dacfd230bb901fbe98fbd52ba9650139350.
* Revert "step + threshold + first order filter to smooth"
This reverts commit 9efb28b25550f7f3643fd28fe375eb0f2a66b536.
* multiplier to 1.5
* step updates for parabolic accel/braking
* step updates for parabolic accel/braking
* even less
* test multiplier
* higher threshold
* back to default delay for now
* update test
* update config
* update test
* update config.py
* update test
* Remove stoppingDecelRate **No need for this anymore**
* multiplier to 1.0
* Variable lower dependency
* Variable lower dependency
* Variable lower jerk minimum
* Variable lower jerk minimum
planned_accel -> desired_acel
* Revert some scaling
* .01 here
* .01 here
* try even smoother stopping
* missed a `tuning` here that instead calls itself to inf.
* what is math
* they're the same
* Adjust lower jerk condition by comparing desired and actual accel
Updated the condition for `min_lower_jerk` to account for the difference between desired and actual acceleration, improving precision in jerk calculations. This ensures smoother transitions and enhances overall longitudinal control logic.
* use existing rate_limit
* reset
* Refactor longitudinal controller for better jerk handling
Revised `calculate_a_value` and jerk processing logic to improve acceleration and jerk handling, particularly under dynamic conditions. Adjusted test cases to cover the new logic.
* Refactor longitudinal controller for better jerk handling
Revised `calculate_a_value` and jerk processing logic to improve acceleration and jerk handling, particularly under dynamic conditions. Adjusted test cases to cover the new logic.
* Refactor longitudinal controller for better jerk handling
Revised `calculate_a_value` and jerk processing logic to improve acceleration and jerk handling, particularly under dynamic conditions. Adjusted test cases to cover the new logic.
* Adjust lower_jerk interpolation for improved accuracy
* Lowered the acceleration error threshold from -0.01 to -0.001
* Adjust jerk interpolation thresholds for Hyundai tuning.
Updated the interpolation range for smaller acceleration errors.
* Move it up
* -.03 not -.05
* radarUnavailable = higher limit patch
* Commit the real change
* Updated the interpolation values and logic for lower_jerk to refine acceleration behavior.
* Updated the interpolation values and logic for lower_jerk to refine acceleration behavior.
* Updated the interpolation values and logic for lower_jerk to refine acceleration behavior.
* Updated the interpolation values and logic for lower_jerk to refine acceleration behavior.
* THIS. THIS WILL STOP FOR LEADS
* Higher for VOACC
* Higher for VOACC
* make sure to stop when transition from off state
* rearrange
* rename
* Rename `make_jerk` to `calculate_jerk` in test cases.
* Adjust jerk tuning for Hyundai longitudinal control
Updated the interpolation table for lower jerk values to improve deceleration handling. This adjustment refines control behavior during higher deceleration requests.
* Updated the interpolation breakpoint from -0.03 to -0.025
* Adjust longitudinal control jerk tuning for smoother response
Updated interpolation values in the jerk tuning logic to improve acceleration smoothing in Hyundai longitudinal control. These changes aim to provide a more consistent and predictable driving experience, particularly during deceleration scenarios.
* Handle radar unavailability in longitudinal tuning check
* `Refactor longitudinal control acceleration and jerk handling`
Removed unused `FirstOrderFilter` and simplified acceleration and jerk calculations for improved clarity and maintainability. Adjusted logic to replace redundant return statements, streamline jerk computation, and reduce unnecessary dependencies.
* `Refactor longitudinal control acceleration and jerk handling`
Removed unused `FirstOrderFilter` and simplified acceleration and jerk calculations for improved clarity and maintainability. Adjusted logic to replace redundant return statements, streamline jerk computation, and reduce unnecessary dependencies.
* Simplify test to be straight to the point.
* split stopping logic out
* Adjust upper_speed_factor and integrate ramp_update logic
* Adjust upper_speed_factor and integrate ramp_update logic
* Adjust upper_speed_factor and integrate ramp_update logic
* Refine acceleration and jerk tuning logic.
* greater than 0
* constant
* add deadzone
* bring back ramp update for jerk upper
* no more ramp update for jerk lower
* use accel_error instead for better comfort and control
* new tune
* bring back ramp update for now for lower jerk
* make sure it goes into stopping
* drag it out
* using count seems to work better
* Refine jerk tuning logic and expand test coverage
* bump vals
* fix logic
* blended aego
* update lower jerk tuning
* spacing
* rename
* fix
* no need for PID yet as we don't have p or i
* Adjust jerk tuning parameters for Hyundai longitudinal control
* retry lfs check
* unused
* tuning diff
* Fix acceleration blending and enhance test coverage
* Update lower_jerk breakpoints
* bump
* Adjust lower jerk parameters and include accel_cmd condition
* Adjust vars
* "Adjust Hyundai longitudinal jerk limits and tuning logic"
* Adjust jerk limits and tuning logic for better control
* lookahead with a_ego_blended
* switch over to planner intent vs car state
* get future jerk limits and variable with velocity
* some cleanup
* more
* Adjusted future jerk lookahead interpolations to utilize dynamic car-specific jerk limit
* Update Hyundai longitudinal tuning and add dynamic jerk logic
Refactored longitudinal configuration to include "lookahead" parameters and revised "jerk_limits" for improved tuning flexibility. Implemented dynamic jerk adaptation logic (Gen1) for smoother braking and acceleration transitions.
* getExperimentallong -> getAlphalong
* bump to original branch
* do not ramp up upper jerk if TCS is not responding
* snap to target when closer
* tunable lookahead values
* more aggressive for the elantra ice
* Still allow ramp while in standstill for EV
* Adjust Kia Niro EV tuning parameters for smoother control
* self.cp.flags
* Update longitudinal_config.py
* ICE tune
* use base
* not too hot about this, fine for now
* Remove ramp for lower desired jerk
* Update tuning_controller.py
* Update longitudinal_config.py
* Update longitudinal_config.py
* update README.md
* update README.md
* Adjust lookahead_jerk_lower_v values in Hyundai longitudinal config.
* update tuning
* Update tune one last time to vals from device which are much smoother.
* Accel error
* unused
* stopping state diff
* accel diff
* do this instead
* start simplifying
* set it from the start
* jerk diff
* update directly
* update tests
* fix
* rename flag and slight cleanup
* long_state -> tuning
* Prep for clean up
* some more
* more
* less in main
* actually modify CP_SP
* extra
* move
* rename
* start
* refactor
* static comfort band (CAN for now)
* directly in can send
* final
---------
Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
* restart
* fix
* missing
* remove stuff we don't use
* huh
* fix
* fix fix fix
* we haven't seen LKAS with angle yet
* this is missing from the new message
* ...
* more explicit
* flip
* import
* Hyundai CAN FD: Steering API updates
* comments
* comments
* keep it for now
* not used
* should use DBC spec
* consistent
---------
Co-authored-by: Shane Smiskol <shane@smiskol.com>
* Hyundai CAN-FD Longitudinal: Enable for radar-based SCC platforms (non-HDA2)
* port safety to opendbc
* fix tests?
* more
* fix tests
* more
* add condition to radar disable tests
* simplify
* more explicit tx checks
* deleted for some reason, caused some models to fail tests
* merge them
* removed openpilot.common.numpy_fast
* used numpy in place of openpilot.common.numpy_fast
* fixed numpy data type error
* Update opendbc/car/__init__.py
---------
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
* fix
* clearer
* cleanup
* more fix
* hkg dbc
* typo!
* Add Custom MIT License (#26)
* missed
* better
* more fixes
* try this out
* inherit in carcontroller properly
* hyundai: main button handling
* always disable
* add main check for pcm cruise
* revert
* sunnyParams
* Move car-specific changes to opendbc
* no need
* more fixes
* more!
* final?
* static analysis
* use new cereal
* rename to lkas_button
* rename
* mads base for cars
* add lkas for ford
* enabled <-> active
* MUST REMOVE test process replay
* Revert "MUST REMOVE test process replay"
This reverts commit 6dde2c8435b0e09158ab455aa215a573f5212c11.
* subaru
* ruff
* more subaru
* toyota
* add them
* mypy
* fix
* update name
* FCA
* assign directly
* init directly
* missing
* not yet
* missed
* no longer needed
* missed hd
* fix
* move to generator
* more nissan
* Apply suggestions from code review
* no need
* Revert "no need"
This reverts commit 6156c62113d9abb626014947a9066b5580f6460a.
* hyundai: move main logic out of main carstate
* move around
* move lkas and lfa icon logic to mads base
* Parse more flags from alt exp, more tests, hyundai main cruise allowed
* license
* add code spell ignore
* fix icon
* remove toyota lta status for lkas, causes weird behaviors
* parse signals inside mads methods
* more codes in mads childs
* Update opendbc/sunnypilot/car/hyundai/escc.py
* revert
* type hint
* test type hint
* more type hint
* no
* needs to be in carstate
* in another PR
---------
Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
* Hyundai CAN-FD: Add CAN fingerprint fallback checks for HDA2 detection
* fix test
* just 1 source
* update unit test
* comment
* simplify
* move hda2 to the end of arg so it's cleaner
* Update opendbc/car/hyundai/interface.py
Co-authored-by: Jason Young <46612682+jyoung8607@users.noreply.github.com>
---------
Co-authored-by: Jason Young <46612682+jyoung8607@users.noreply.github.com>
* move most of /car
* rename selfdrive.car imports to opendbc.car
* move some car tests
move some car tests
* fix car tests
* fix actions?
* add panda ignore to pytest
* need these ignores from openpilot
* fix tests for outside pip install (openpilot/local)
forgot