Compare commits

...

298 Commits

Author SHA1 Message Date
Jason Wen bb264b13a3 bump 2025-04-16 16:48:11 -04:00
Jason Wen d48e30bdec bump 2025-04-16 11:59:58 -04:00
Jason Wen d4a75bfaf4 bump 2025-04-16 07:22:55 -04:00
Jason Wen edf08124e7 fix 2025-04-16 07:19:55 -04:00
Jason Wen ec62d30439 aren't really used yet 2025-04-16 07:16:27 -04:00
Jason Wen 8c22dc8577 only CAN for now :) 2025-04-16 07:11:39 -04:00
Jason Wen 6623ee66d8 don't go zoom zoom if no lead 2025-04-16 07:09:03 -04:00
Jason Wen 8db09b7aec bump opendbc 2025-04-16 07:02:06 -04:00
Jason Wen a112fa86d2 what is math 2025-04-15 14:10:06 -04:00
discountchubbs 72c7ad547b missed a tuning here that instead calls itself to inf. 2025-04-15 09:54:46 -07:00
Discountchubbs 87c65bf55d Merge branch 'master-new' into HKG-long-tune 2025-04-15 09:21:46 -07:00
Jason Wen 7ea243bf59 try even smoother stopping 2025-04-15 12:19:38 -04:00
discountchubbs 7fd64d91f1 .01 here 2025-04-15 07:58:35 -07:00
discountchubbs 4e3b5c8714 .01 here 2025-04-15 07:46:34 -07:00
discountchubbs 2753b71159 Revert some scaling 2025-04-15 06:38:17 -07:00
Jason Wen 20abdbf724 Merge remote-tracking branch 'sunnypilot/sunnypilot/master-new' into HKG-long-tune
# Conflicts:
#	opendbc_repo
2025-04-15 00:06:47 -04:00
discountchubbs 937a9d69e0 Variable lower jerk minimum
planned_accel -> desired_acel
2025-04-14 19:34:12 -07:00
discountchubbs 41d9810048 Variable lower jerk minimum 2025-04-14 16:48:09 -07:00
discountchubbs ac79786c40 Variable lower dependency 2025-04-14 15:57:10 -07:00
discountchubbs 25ce4df654 Variable lower dependency 2025-04-14 15:52:26 -07:00
discountchubbs c96b21ce6c Merge remote-tracking branch 'origin/HKG-long-tune' into HKG-long-tune 2025-04-14 15:27:19 -07:00
discountchubbs 7ac3a9419f multiplier to 1.0 2025-04-14 15:27:01 -07:00
Discountchubbs cf7b80b10b Merge branch 'master-new' into HKG-long-tune 2025-04-14 11:57:31 -07:00
Discountchubbs 73412fcefb Merge branch 'master-new' into HKG-long-tune 2025-04-14 11:19:03 -07:00
Discountchubbs 389a653c33 Merge branch 'master-new' into HKG-long-tune 2025-04-14 11:10:04 -07:00
discountchubbs a4131bc3be Remove stoppingDecelRate **No need for this anymore** 2025-04-14 11:08:31 -07:00
discountchubbs de8e4d94c0 update test 2025-04-14 06:37:25 -07:00
discountchubbs 362b1d6d25 update config.py 2025-04-14 06:34:34 -07:00
discountchubbs 26114cac35 update test 2025-04-14 05:32:34 -07:00
discountchubbs af1b4bf9f3 update config 2025-04-14 05:22:47 -07:00
discountchubbs 499d0545ec update test 2025-04-14 05:21:26 -07:00
Jason Wen 495fa9fee8 back to default delay for now 2025-04-14 01:12:56 -04:00
Jason Wen b0f91d477b Merge remote-tracking branch 'sunnypilot/opendbc/master-new' into HKG-long-tune 2025-04-14 01:03:39 -04:00
discountchubbs 353d7d4718 test multiplier 2025-04-13 21:05:35 -07:00
Jason Wen d5942c3d18 even less 2025-04-13 23:18:12 -04:00
discountchubbs fae68525f7 step updates for parabolic accel/braking 2025-04-13 20:15:35 -07:00
discountchubbs fe2abfb1dd step updates for parabolic accel/braking 2025-04-13 19:22:51 -07:00
discountchubbs 71233eb9f3 multiplier to 1.5 2025-04-13 17:37:56 -07:00
Jason Wen 7e5bb5e530 nah 2025-04-13 20:02:37 -04:00
Jason Wen 41a1e6f679 constants 2025-04-13 19:39:50 -04:00
Jason Wen 038d9cebe1 step + threshold + first order filter to smooth 2025-04-13 19:38:00 -04:00
discountchubbs 2c1f558aa9 Change max jerk upper 2025-04-13 16:33:52 -07:00
discountchubbs dbf5a8309f Merge remote-tracking branch 'origin/HKG-long-tune' into HKG-long-tune 2025-04-13 16:27:49 -07:00
discountchubbs 4314b18425 Change max jerk upper 2025-04-13 16:27:28 -07:00
Discountchubbs 54f46385fc Merge branch 'master-new' into HKG-long-tune 2025-04-13 16:11:35 -07:00
discountchubbs a1a05feaca Change max jerk upper 2025-04-13 16:09:54 -07:00
discountchubbs 54451fab47 Change min jerk upper 2025-04-13 12:45:14 -07:00
discountchubbs 63b552309b Change min jerk 2025-04-13 11:26:44 -07:00
Jason Wen 17bb280b83 should be float 2025-04-13 13:59:30 -04:00
discountchubbs cc68c41b23 Change min jerk 2025-04-13 09:26:16 -07:00
Jason Wen 3f2ecd7f4a add lower jerk multiplier for HYUNDAI_IONIQ 2025-04-13 01:12:45 -04:00
Jason Wen 86cfc27490 align type hint 2025-04-13 00:44:04 -04:00
Jason Wen a63a1b4720 0.45 default long actuator delay 2025-04-13 00:40:38 -04:00
discountchubbs dae1d78ab3 we dont need such high accel jerk when above 20m/s. This is cruise control, not a racecar. 2025-04-12 20:26:41 -07:00
Jason Wen b78b77c53c match aReqVale 2025-04-12 21:13:10 -04:00
Jason Wen 32788471c9 bump 2025-04-12 21:09:45 -04:00
Jason Wen cebabe634d bump 2025-04-12 21:05:48 -04:00
Jason Wen c2f10d19aa allow jerk calculations at all times 2025-04-12 19:52:38 -04:00
discountchubbs d3b9d22274 bump opendbc test 2025-04-12 15:23:00 -07:00
discountchubbs 667ec04e20 raise off to stock 2025-04-12 15:15:16 -07:00
discountchubbs 9591fad8bb Merge remote-tracking branch 'origin/HKG-long-tune' into HKG-long-tune 2025-04-12 09:28:15 -07:00
discountchubbs c476addda2 Merge remote-tracking branch 'origin/master-new' into HKG-long-tune
# Conflicts:
#	opendbc_repo
2025-04-12 09:27:19 -07:00
Discountchubbs 42b7288fd7 Merge branch 'master-new' into HKG-long-tune 2025-04-12 07:56:00 -07:00
discountchubbs e204f38733 Elantra specific 2025-04-12 07:52:53 -07:00
discountchubbs 75ea72c7a0 Higher jerk for VOACC 2025-04-12 06:59:57 -07:00
discountchubbs a23f1ad2a8 Test a few things 2025-04-12 06:45:42 -07:00
DevTekVE 5b119ee854 Merge branch 'master-new' into HKG-long-tune 2025-04-12 12:59:26 +02:00
Discountchubbs 18a01ffb5e Merge branch 'master-new' into HKG-long-tune 2025-04-11 13:23:00 -07:00
Discountchubbs 36e9529b31 Merge branch 'master-new' into HKG-long-tune 2025-04-11 13:06:56 -07:00
Discountchubbs 0fb04ab520 Merge branch 'master-new' into HKG-long-tune 2025-04-11 12:35:05 -07:00
Jason Wen 7cb530e70c make sure it resets to 0, enforced in safety 2025-04-11 15:14:41 -04:00
Jason Wen 396516eaec fix logic 2025-04-11 14:24:52 -04:00
Jason Wen ae3c048034 abs it here 2025-04-11 14:06:33 -04:00
discountchubbs 586544c308 bump 2025-04-11 09:26:29 -07:00
Jason Wen c9d9e4b390 bump 2025-04-11 12:13:52 -04:00
Jason Wen 09c73f949d Merge remote-tracking branch 'sunnypilot/sunnypilot/HKG-long-tune' into HKG-long-tune
# Conflicts:
#	opendbc_repo
2025-04-11 12:13:22 -04:00
Jason Wen 9d6d505bac move desired accel force zero in tuning controller 2025-04-11 12:13:09 -04:00
discountchubbs 84dce5db42 Higher lower limit 2025-04-11 09:12:12 -07:00
discountchubbs 4e6f682c59 bump test 2025-04-11 09:09:38 -07:00
discountchubbs 8da1394106 bump test 2025-04-11 09:09:23 -07:00
Jason Wen 7a7dcc940d apply upper/lower dynamically 2025-04-11 11:53:02 -04:00
Jason Wen 53d36954d6 do our own clipping 2025-04-11 11:26:37 -04:00
Jason Wen 21a4b0436a match stock behavior for accel 2025-04-11 11:23:57 -04:00
discountchubbs f197c6f388 bump safety mutation test 2025-04-11 08:15:47 -07:00
Jason Wen 89e8e863c5 all should match 50 Hz 2025-04-11 11:10:55 -04:00
discountchubbs e687c96393 bump safety mutation test 2025-04-10 19:11:15 -07:00
discountchubbs 368cce7dae refactor that while passing internal tests 2025-04-10 19:08:49 -07:00
Discountchubbs 75ff611282 Merge branch 'master-new' into HKG-long-tune 2025-04-10 12:23:33 -07:00
discountchubbs 60d11012a8 bump submodules 2025-04-10 12:13:31 -07:00
discountchubbs 53353ea08f remove fw version as that was a test 2025-04-10 12:07:38 -07:00
discountchubbs 2ac9c70019 fw version for my car... 2025-04-10 10:36:20 -07:00
discountchubbs adc5d43a62 This is an internal test on my end. Disregard, for now 2025-04-10 09:44:05 -07:00
discountchubbs a634de4efa Trigger rebuild 2025-04-10 06:43:12 -07:00
discountchubbs 23d05e7648 Chronological order 2025-04-09 21:54:29 -07:00
discountchubbs 1a59ec2c9d Make it easier to read 2025-04-09 21:36:50 -07:00
discountchubbs 4997cfff81 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.
2025-04-09 21:21:49 -07:00
discountchubbs 23d95b55c4 Conditional flags 2025-04-09 20:32:41 -07:00
discountchubbs 4b92d90dfe Send these as a floating object. update comments to add TODO msg. 2025-04-09 12:37:12 -07:00
discountchubbs 742e92c83e Add higher limits for CANFD 2025-04-09 12:29:09 -07:00
discountchubbs 91388a6b82 Lower time 2025-04-09 10:03:46 -07:00
discountchubbs a2a1205301 Readability 2025-04-09 07:00:35 -07:00
discountchubbs 1ff826848a Fix test 2025-04-09 06:38:01 -07:00
discountchubbs 4f81e9c5c8 Update timestep 2025-04-09 06:33:01 -07:00
discountchubbs c409b74293 README.md 2025-04-09 05:58:50 -07:00
discountchubbs 4bb5895733 Update jerk calculation mimicking j_ego math. 2025-04-09 05:56:07 -07:00
discountchubbs af1e520165 Raise these to restart tests 2025-04-09 05:04:07 -07:00
discountchubbs b199faa239 Raise these to restart tests 2025-04-07 19:32:58 -07:00
discountchubbs 97b68fed03 use Sqrt for tiny values to increase factor. Oh, also add a test file. 2025-04-07 19:25:33 -07:00
discountchubbs 36b6f4318b use Sqrt for tiny values to increase factor. Oh, also add a test file. 2025-04-07 19:04:26 -07:00
discountchubbs 6b08700b79 Merge remote-tracking branch 'origin/master-new' into HKG-long-tune
# Conflicts:
#	opendbc_repo
2025-04-07 19:04:12 -07:00
discountchubbs 65444314f6 use Sqrt for tiny values to increase factor. Oh, also add a test file. 2025-04-07 19:02:13 -07:00
discountchubbs 20256c28f1 67:33 split 2025-04-06 20:10:11 -07:00
discountchubbs d66c157600 60/35 split 2025-04-06 18:22:47 -07:00
discountchubbs 0e4b5ae936 70/30 split 2025-04-06 17:54:28 -07:00
discountchubbs 7b720d4228 Maybe I was asleep but somehow it worked. 2025-04-06 17:02:22 -07:00
discountchubbs 09140b34c3 Maybe I was asleep but somehow it worked. 2025-04-06 16:31:19 -07:00
Discountchubbs 71e0ab957a Merge branch 'master-new' into HKG-long-tune 2025-04-06 06:59:46 -07:00
Discountchubbs d935b26f5d Merge branch 'master-new' into HKG-long-tune 2025-04-05 21:31:09 -07:00
discountchubbs edf5df11d8 Remove some unused vars 2025-04-05 12:35:18 -07:00
discountchubbs 494132d770 Remove some unused vars 2025-04-05 11:12:05 -07:00
discountchubbs 9a1910f18e Merge remote-tracking branch 'origin/master-new' into HKG-long-tune 2025-04-05 09:08:48 -07:00
discountchubbs 4b4aca33a0 bump opendbc_repo 2025-04-05 09:00:49 -07:00
discountchubbs ff90cd4cb2 Update README.md 2025-04-05 08:59:12 -07:00
discountchubbs 257bc8707c Blend with current accel for more parabolas 2025-04-05 08:37:55 -07:00
discountchubbs 2b2221d290 Blend with current accel for more parabolas 2025-04-05 08:12:39 -07:00
discountchubbs c3269d62e1 Try turning jerk into a parabola 2025-04-05 07:39:15 -07:00
discountchubbs 202d06f9f7 Try turning jerk into a parabola 2025-04-05 07:24:38 -07:00
discountchubbs ad9a79ee5d bump actuators 2025-04-04 21:45:17 -07:00
discountchubbs 51410b6e5b Actuators.accel makes a difference. Interesting.. 2025-04-04 19:32:00 -07:00
discountchubbs 3231108ae9 Actuators.accel makes a difference. Interesting.. 2025-04-04 19:10:43 -07:00
discountchubbs cb56413a2e Actuators.accel makes a difference. Interesting.. 2025-04-04 18:54:19 -07:00
discountchubbs 5c1a5faeeb README.md 2025-04-04 17:53:28 -07:00
discountchubbs 56b76cada3 Whoops 2025-04-04 17:27:07 -07:00
discountchubbs c7bea29cb2 MORE README.md 2025-04-04 17:23:48 -07:00
discountchubbs e2b0e06897 MORE README.md 2025-04-04 17:19:53 -07:00
discountchubbs 43bc55c9a2 Make upper conditional as well so we have MOAR POWER 2025-04-04 15:06:46 -07:00
Discountchubbs af9b2e8277 Merge branch 'master-new' into HKG-long-tune 2025-04-04 13:08:50 -07:00
discountchubbs 4e7b0cd425 8.33 m/s conditional 2025-04-04 11:48:29 -07:00
discountchubbs fd51c9e338 Conditionally higher minimum jerk threshold. 2025-04-04 11:34:26 -07:00
discountchubbs 56b54a6892 Conditionally higher minimum jerk threshold. 2025-04-04 09:46:40 -07:00
discountchubbs 36fe9374b3 Test 0.9 to see what's up. right now it slows amazing but gets within follow distance gap. Hopefully 0.9 isn't too much of a raise. 2025-04-04 07:56:33 -07:00
discountchubbs 4d68a832f8 Change velocity equation to represent 3.3 max sent over can and scale in a linear fashion. 2025-04-04 06:49:40 -07:00
discountchubbs e7f2286324 Increase factor 2025-04-04 05:26:10 -07:00
discountchubbs 7eb1e21604 bump submodules 2025-04-04 05:21:13 -07:00
discountchubbs 004fb01601 bump submodules 2025-04-03 22:09:18 -07:00
discountchubbs efed90d3ba Merge remote-tracking branch 'origin/HKG-long-tune' into HKG-long-tune 2025-04-03 21:32:24 -07:00
discountchubbs dfd2223482 **Minor** changes to acceleration 2025-04-03 21:31:55 -07:00
discountchubbs 485d4b859e bump opendbc 2025-04-03 20:46:39 -07:00
discountchubbs fbe4e7a411 Merge remote-tracking branch 'origin/master-new' into HKG-long-tune
# Conflicts:
#	opendbc_repo
2025-04-03 20:44:19 -07:00
discountchubbs 0a7db97edf Merge remote-tracking branch 'origin/HKG-long-tune' into HKG-long-tune 2025-04-03 05:34:47 -07:00
discountchubbs 5074197c01 Raise max 2025-04-03 05:34:15 -07:00
Discountchubbs d70eeefcb2 Invoke commit tests 2025-04-02 18:55:26 -07:00
discountchubbs 12f6857fde Calculate aReqValue for hyundaican.py 2025-04-02 15:44:12 -07:00
discountchubbs 784a769055 Adjust jerk ranges.
2.2 is gathered as maximum upper band jerk parsed from stock scc route data.

 .53 as jerk min is from the link in the readme about avg comfort jerk min.
2025-04-02 11:49:32 -07:00
discountchubbs 9f7b974042 Adjust jerk ranges.
2.2 is gathered as maximum upper band jerk parsed from stock scc route data.

 .53 as jerk min is from the link in the readme about avg comfort jerk min.
2025-04-02 11:48:17 -07:00
discountchubbs bed4ef8a9d add standstill check:
if (CS.out.brakeLightsDEPRECATED and CS.out.standstill) and not CS.out.brakePressed:
2025-04-02 09:42:31 -07:00
discountchubbs f4dcba464d Try SPSS lower jerk cal
** Note: May need to revert so keep that in mind **
2025-04-02 07:56:35 -07:00
discountchubbs 6e2571f850 Change access from private to public, allow call from card once again, due to the fact that the flags were being set after interface init, leading to no value being returned, leading to no tune being applied.
Change interfaces accordingly to remove the now unneeded variable in get_params_sp.

Changed private local method _get_longitudinal_tuning, to a publically accessible get_longitudinal_tuning method.

Added one line call in card.
2025-04-02 04:47:09 -07:00
discountchubbs 9c82f1bf6a Clean up a bit more 2025-04-01 18:41:17 -07:00
discountchubbs 08ec905aaf Clean up a bit more 2025-04-01 18:32:56 -07:00
discountchubbs 5dceeaa019 Update README.md 2025-04-01 18:23:02 -07:00
discountchubbs 006298392c Merge branch 'HKG-long-tune-split' into HKG-long-tune
# Conflicts:
#	opendbc_repo
2025-04-01 18:15:38 -07:00
discountchubbs fb022229f6 Red diff parts in readme.md 2025-04-01 12:55:23 -07:00
Jason Wen f1bd9d8304 oops 2025-04-01 15:47:27 -04:00
Jason Wen 5bbcbbbae9 oops 2025-04-01 15:45:11 -04:00
Jason Wen 6e09c7dc05 TCS allows actuations after brakes are released, some red diff 2025-04-01 15:42:59 -04:00
Jason Wen 9fb45f5f66 let's move it up 2025-04-01 15:17:10 -04:00
discountchubbs b1f88730d9 remove unused imports 2025-04-01 08:03:24 -07:00
discountchubbs 9e126d94a5 Nuke calculate limited acceleration in favor of better jerk division which leads to much better drive comfort.
tie jerk to LONGTUNING_BRAKING flag so it is still set
2025-04-01 08:02:56 -07:00
discountchubbs db84e8c04f Fix return statement to allow carparamssp to still be properly returned even if flags are not set, so a None type object error isn't created.
TLDR: Properly return ret that _get_params_sp expects in opendbc/Interfaces.py
2025-04-01 06:35:45 -07:00
discountchubbs faf59baf88 Lets try 0.32 for both. 2025-04-01 05:09:08 -07:00
discountchubbs c7edef89d9 @sunnyhaiben pointed out this typo lol 2025-04-01 05:01:31 -07:00
Jason Wen ea1212e08c ICE -> DEFAULT 2025-03-31 21:19:49 -04:00
Jason Wen e2987349ed more rename 2025-03-31 21:13:59 -04:00
Jason Wen 398f57837d rename 2025-03-31 21:12:28 -04:00
Jason Wen a0b63c8536 unused 2025-03-31 21:11:32 -04:00
Jason Wen fa5469bfa0 unused 2025-03-31 21:09:15 -04:00
Jason Wen 3126ab773c license 2025-03-31 21:05:21 -04:00
Jason Wen 4307fc49cc bump opendbc 2025-03-31 21:03:45 -04:00
Jason Wen e35b51ea0f bump opendbc 2025-03-31 21:00:56 -04:00
discountchubbs 29b901e068 Track two separate factors 2025-03-31 14:41:09 -07:00
discountchubbs 6899346c6c Test 0.5 division 2025-03-31 14:30:48 -07:00
discountchubbs 3b35f13799 This is an internal test of 50hz timestep. refer to long-tune split for real code. Direct test of controller. revert/ apply the split opendbc_repo instead when ready. 2025-03-31 13:31:35 -07:00
Jason Wen c41ff47f43 staticmethod and all in 1 place only 2025-03-31 15:51:22 -04:00
discountchubbs 3cfec97618 This is an internal test of 50hz timestep. refer to long-tune split for real code 2025-03-31 09:14:36 -07:00
discountchubbs 67bf560486 This is an internal test of 50hz timestep. refer to long-tune split for real code 2025-03-31 09:00:45 -07:00
discountchubbs 9568e9781d Update README.md 2025-03-31 06:38:58 -07:00
discountchubbs 0fc1489d2d Update README.md 2025-03-30 21:28:09 -07:00
discountchubbs cacbb42e69 Update README.md 2025-03-30 21:25:10 -07:00
discountchubbs d2dc7c61c8 Add README.md 2025-03-30 21:22:32 -07:00
discountchubbs 3c7e4c96c7 Remove unused interpolation function. 2025-03-29 20:52:26 -07:00
discountchubbs 71e1940c0c Remove ~600 lines of code for maintainability. 2025-03-29 20:45:26 -07:00
Jason Wen 32088b5a96 bump opendbc 2025-03-29 23:39:27 -04:00
Jason Wen 3a1756679d more rename 2025-03-29 23:27:13 -04:00
Jason Wen 42ca551876 rename 2025-03-29 23:26:40 -04:00
discountchubbs 2adcbcd775 bump opendbc_repo 2025-03-29 20:10:46 -07:00
discountchubbs ef8b72cfcb Merge remote-tracking branch 'origin/master-new' into HKG-long-tune
# Conflicts:
#	sunnypilot/selfdrive/car/interfaces.py
2025-03-29 20:10:19 -07:00
Discountchubbs 1981a17ffa Merge branch 'master-new' into HKG-long-tune 2025-03-29 15:12:46 -07:00
discountchubbs 8bf269ec8c Merge remote-tracking branch 'origin/HKG-long-tune' into HKG-long-tune 2025-03-29 07:17:54 -07:00
discountchubbs db9a7a9104 Clip upper jerk during experimental mode to 1.0m/s^3. This allows for less abrupt accel takeoffs while in experimental mode. 2025-03-29 07:17:46 -07:00
discountchubbs 2aeb886cb7 Merge remote-tracking branch 'origin/HKG-long-tune' into HKG-long-tune 2025-03-29 07:17:01 -07:00
Discountchubbs 6e4d36b14c Clip upper jerk during experimental mode to 1.0m/s^3. This allows for less abrupt accel takeoffs while in experimental mode. 2025-03-29 07:16:42 -07:00
Discountchubbs 5f99eb565e Merge branch 'master-new' into HKG-long-tune 2025-03-29 06:52:25 -07:00
discountchubbs d3bbbca800 Clip upper jerk during experimental mode to 1.0m/s^3. This allows for less abrupt accel takeoffs while in experimental mode. 2025-03-28 13:51:16 -07:00
discountchubbs 539c9bf024 Clean up notes for clarity. 2025-03-28 06:18:26 -07:00
discountchubbs 057fcf4a73 Min jerk lowered to 0.6 per:
Horn, S., Rossner, P., Madigan, R., Bieg, H.-J., & Merat, N. (2024). User evaluation of comfortable deceleration profiles for highly automated driving: Findings from a test track study. Transportation Research Part F Traffic Psychology and Behaviour, 105(3), 206–221. https://doi.org/10.1016/j.trf.2024.05.025
2025-03-28 05:56:48 -07:00
discountchubbs 92a8d11f7e Conform to ISO 15622 calculations for jerk lower limits 2025-03-27 15:04:33 -07:00
discountchubbs 69cd4f5065 add clarity and chronological order. 2025-03-26 07:50:14 -07:00
discountchubbs 840c383833 Fix comments 2025-03-26 07:39:08 -07:00
discountchubbs 0a7a4586ac Merge remote-tracking branch 'origin/HKG-long-tune' into HKG-long-tune 2025-03-26 07:04:44 -07:00
discountchubbs 1a93be18a0 Fix comments 2025-03-26 07:04:24 -07:00
Discountchubbs 3519b9669c Merge branch 'master-new' into HKG-long-tune 2025-03-26 07:03:36 -07:00
discountchubbs b1fbede11b Merge remote-tracking branch 'origin/HKG-long-tune' into HKG-long-tune
# Conflicts:
#	opendbc_repo
2025-03-26 07:02:47 -07:00
discountchubbs f098ff34be Fix comments 2025-03-26 07:02:31 -07:00
discountchubbs e321be0637 Fix comments 2025-03-26 06:59:55 -07:00
discountchubbs cbe0d27774 Merge remote-tracking branch 'origin/HKG-long-tune' into HKG-long-tune
# Conflicts:
#	opendbc_repo
2025-03-25 16:02:18 -07:00
discountchubbs 62bb93d953 Refactor longitudinal_tuning.py 2025-03-25 16:01:09 -07:00
discountchubbs ce53c51a99 Refactor longitudinal_tuning.py 2025-03-25 15:47:03 -07:00
discountchubbs 8b81380a9b Refactor interfaces.py 2025-03-25 15:28:07 -07:00
discountchubbs 45e8b84032 place under CP.brand =='hyundai' 2025-03-25 13:42:49 -07:00
discountchubbs efa382f66c bump opendbc_repo 2025-03-25 12:52:44 -07:00
discountchubbs 78b90ad0f2 apply from car interface 2025-03-25 11:52:19 -07:00
discountchubbs 9f4b068909 Update UI 2025-03-25 11:38:43 -07:00
Discountchubbs 73581243fe Update card.py
Co-authored-by: DevTekVE <devtekve@gmail.com>
2025-03-25 11:03:47 -07:00
discountchubbs 65c12b45f5 strip 2025-03-25 09:34:03 -07:00
discountchubbs 64e946ee35 simplify 2025-03-25 08:03:39 -07:00
discountchubbs e16bd21069 Merge remote-tracking branch 'origin/HKG-long-tune' into HKG-long-tune 2025-03-25 06:57:47 -07:00
discountchubbs f853be5c1c Fix DevTekVE's comments 2025-03-25 06:55:50 -07:00
discountchubbs cdbe4d08ec Fix DevTekVE's comments 2025-03-25 06:49:46 -07:00
Discountchubbs a307c06195 Merge branch 'master-new' into HKG-long-tune 2025-03-25 06:41:44 -07:00
Discountchubbs 668cebca0f Merge branch 'master-new' into HKG-long-tune 2025-03-24 21:43:27 -07:00
Jason Wen 4659274faa Merge branch 'master-new' into HKG-long-tune 2025-03-24 23:05:46 -04:00
discountchubbs 640649d55b ABC extraction 2025-03-24 19:45:59 -07:00
discountchubbs 504b270ae4 Create dict for problem variables so they aren't used by carcontroller.py when we don't want them to be. 2025-03-24 15:34:34 -07:00
discountchubbs 1c547c09bc Create dict for problem variables so they aren't used by carcontroller.py when we don't want them to be. 2025-03-24 15:27:20 -07:00
discountchubbs 1e40bf348d bump 2025-03-24 11:58:32 -07:00
discountchubbs 3144d66405 Merge remote-tracking branch 'origin/HKG-long-tune' into HKG-long-tune 2025-03-24 11:57:18 -07:00
discountchubbs c932266485 Remove unused variable 2025-03-24 11:55:55 -07:00
discountchubbs a15273c389 Merge remote-tracking branch 'origin/HKG-long-tune' into HKG-long-tune 2025-03-24 11:39:20 -07:00
discountchubbs c434889f8f In initialization of longitudinal_tuning.py we define self.accel_last which is used on canfd. is this a discriminate 2025-03-24 11:38:14 -07:00
discountchubbs d711020ff6 In initialization of longitudinal_tuning.py we define self.accel_last which is used on canfd. is this a discriminate? 2025-03-24 09:59:33 -07:00
discountchubbs d37bcf5421 In initialization of longitudinal_tuning.py we define self.accel_last which is used on canfd. is this a discriminate? 2025-03-24 08:05:28 -07:00
discountchubbs 6fc315b594 Refine Hyundai longitudinal tuning logic. 2025-03-24 05:38:23 -07:00
Discountchubbs 25fe21d766 Merge branch 'master-new' into HKG-long-tune 2025-03-23 21:45:00 -07:00
Discountchubbs b378708049 Merge branch 'master-new' into HKG-long-tune 2025-03-23 21:21:58 -07:00
discountchubbs 5df9a05095 Merge remote-tracking branch 'origin/HKG-long-tune' into HKG-long-tune 2025-03-23 19:20:08 -07:00
discountchubbs fa44bae501 Adjust starting parameters to ensure jerk limits are zero'd out when transitioning out of stop requested 2025-03-23 19:19:36 -07:00
Discountchubbs ec52c06b49 Merge branch 'master-new' into HKG-long-tune 2025-03-23 13:16:22 -07:00
discountchubbs 4422522bf2 Adjust starting parameters to ensure jerk limits are zero'd out when transitioning out of stop requested 2025-03-23 13:14:03 -07:00
discountchubbs 45903cb9a2 Merge remote-tracking branch 'origin/HKG-long-tune' into HKG-long-tune 2025-03-23 08:23:16 -07:00
discountchubbs 5efbe0178e Removed gasPressed as a condition for 0 acceleration to address misidentification issues in some CANFD vehicles. 2025-03-23 08:22:31 -07:00
Discountchubbs 6cc0f4c510 Merge branch 'master-new' into HKG-long-tune 2025-03-22 22:51:28 -07:00
discountchubbs 9b02a5bc88 Merge remote-tracking branch 'origin/HKG-long-tune' into HKG-long-tune 2025-03-22 22:50:37 -07:00
discountchubbs 6b385a0a5e Update wording on HKGLongTune UI 2025-03-22 22:49:59 -07:00
Discountchubbs 72260980ae Merge branch 'master-new' into HKG-long-tune 2025-03-22 13:26:33 -07:00
Discountchubbs 0b86d7ddd1 Merge branch 'master-new' into HKG-long-tune 2025-03-22 08:58:27 -07:00
discountchubbs dd36a0aa7f bump opendbc_repo 2025-03-22 08:57:43 -07:00
discountchubbs 42f907321b Merge remote-tracking branch 'origin/master-new' into HKG-long-tune
Merge remote-tracking branch 'origin/master-new' into HKG-long-tune
2025-03-22 08:54:41 -07:00
discountchubbs 123f63515e Moved longitudinal tuning logic to a dedicated method in the Hyundai interface. 2025-03-22 08:49:01 -07:00
discountchubbs 22d6ce674c Merge remote-tracking branch 'origin/HKG-long-tune' into HKG-long-tune 2025-03-21 22:08:01 -07:00
discountchubbs c1be4ce996 Merge remote-tracking branch 'origin/HKG-long-tune' into HKG-long-tune 2025-03-21 21:58:13 -07:00
discountchubbs 7e476521f3 Merge remote-tracking branch 'origin/HKG-long-tune' into HKG-long-tune
# Conflicts:
#	opendbc_repo
2025-03-21 21:43:26 -07:00
discountchubbs 19f98b6b23 Previously, the CP_SP parameter was mandatory.. This change allows the CP_SP parameter to default to None, improving compatibility 2025-03-21 21:42:26 -07:00
discountchubbs 7a1cd3de9d Previously, the CP_SP parameter was mandatory.. This change allows the CP_SP parameter to default to None, improving compatibility 2025-03-21 21:29:13 -07:00
discountchubbs 2605b99b95 Refactor Hyundai long tuning logic to use CP_SP flags.
Moved Hyundai-specific flag handling logic to utilize CP_SP flags instead of CP flags. This ensures better separation of parameters and aligns with the updated parameter structure. Updated related functions and class initializations for consistency.
2025-03-21 21:04:06 -07:00
discountchubbs a10445b148 Fix argument order in HKGLongitudinalController.update
This resolves the issues caused by the incorrect sequence.
2025-03-21 18:34:06 -07:00
discountchubbs 9978d628eb Update 2025-03-21 18:06:54 -07:00
discountchubbs 53638a9ee7 Params logic 2025-03-21 16:22:22 -07:00
discountchubbs 60d1e96838 Params logic 2025-03-21 15:10:38 -07:00
Jason Wen 130331ece8 Revert "Controls: Neural Network Lateral Control (NNLC) for Torque Lateral Accel Control" (#694)
Revert "Controls: Neural Network Lateral Control (NNLC) for Torque Lateral Ac…"

This reverts commit ecb4026269.
2025-03-21 13:24:30 -07:00
discountchubbs 1499d47279 Revert NNLC master-new merge 2025-03-21 13:22:41 -07:00
discountchubbs a17710c117 Revert NNLC master-new merge 2025-03-21 13:19:00 -07:00
discountchubbs 63a57d2538 CP 2025-03-21 13:15:26 -07:00
discountchubbs cacc4c6060 merge branch master-new into HKG-long-tune 2025-03-21 12:45:22 -07:00
discountchubbs f0432d4be9 fix this 2025-03-21 12:34:45 -07:00
discountchubbs fee4c08cd7 Revert NNLC temporarily as it isnt fully merged to master-new 2025-03-21 11:39:00 -07:00
discountchubbs 5a4724e383 CP to carcontroller.py 2025-03-21 10:06:24 -07:00
discountchubbs ae5fe3a6fc CP to carcontroller.py 2025-03-21 07:01:04 -07:00
discountchubbs 5a44f5aaaa Merge remote-tracking branch 'origin/master-new' into HKG-long-tune 2025-03-21 05:05:16 -07:00
discountchubbs 585ca1dc89 CP to carcontroller.py 2025-03-20 19:34:46 -07:00
discountchubbs 40a51b96c4 CP to carcontroller.py 2025-03-20 19:33:50 -07:00
discountchubbs b0e81088fe Merge remote-tracking branch 'origin/HKG-long-tune' into HKG-long-tune 2025-03-20 19:26:21 -07:00
discountchubbs 9b52532342 CP 2025-03-20 19:25:58 -07:00
Discountchubbs 39e62f3879 Merge branch 'master-new' into HKG-long-tune 2025-03-20 16:46:49 -07:00
discountchubbs 1eddc75541 Not sure what happened 2025-03-20 16:37:18 -07:00
discountchubbs d1f0c1b07c Fixed that. 2025-03-20 16:20:46 -07:00
discountchubbs dc2551b431 Fixed that. 2025-03-20 16:13:07 -07:00
discountchubbs 85c9ae56cc Adjust longitudinal tuning and introduce Hyundai params.
Increased jerk limits and adjusted brake response parameters for various Hyundai and Genesis models

@sunnyhaiben
2025-03-20 15:59:11 -07:00
discountchubbs 5d7a5a465f bump 2025-03-20 06:43:23 -07:00
discountchubbs f93fe71c42 bump 2025-03-20 06:31:43 -07:00
discountchubbs 0bd4817d6e Merge remote-tracking branch 'origin/master-new' into HKG-long-tune
# Conflicts:
#	opendbc_repo
2025-03-20 06:09:21 -07:00
discountchubbs edc3deef1f bump opendbc for interpolation_utils 2025-03-14 06:41:07 -07:00
discountchubbs a8703b54a3 bump opendbc 2025-03-13 20:40:59 -07:00
discountchubbs e6738b9458 bump opendbc 2025-03-13 19:46:21 -07:00
discountchubbs 5ec9d8aed6 model manager comma splice 2025-03-13 11:59:13 -07:00
discountchubbs 6a250b792e Update Name 2025-03-13 11:35:05 -07:00
discountchubbs 4d83033a12 update params 2025-03-13 11:19:51 -07:00
discountchubbs b078dc0204 HKG longitudinal tuning 2025-03-13 11:14:04 -07:00
7 changed files with 106 additions and 7 deletions
+2
View File
@@ -166,6 +166,8 @@ inline static std::unordered_map<std::string, uint32_t> keys = {
{"HyundaiRadarTracksConfirmed", PERSISTENT},
{"HyundaiRadarTracksPersistent", PERSISTENT},
{"HyundaiRadarTracksToggle", PERSISTENT},
{"HyundaiLongTune", PERSISTENT},
{"HyundaiSmootherBraking", PERSISTENT},
{"DynamicExperimentalControl", PERSISTENT},
};
+1
View File
@@ -112,6 +112,7 @@ class Car:
self.RI = interfaces[self.CI.CP.carFingerprint].RadarInterface(self.CI.CP, self.CI.CP_SP)
self.CP = self.CI.CP
self.CP_SP = self.CI.CP_SP
self.CP_SP = self.CI.get_longitudinal_tuning(self.CP, self.CP_SP)
# continue onto next fingerprinting step in pandad
self.params.put_bool("FirmwareQueryDone", True)
@@ -6,9 +6,19 @@
*/
#include "selfdrive/ui/sunnypilot/qt/offroad/settings/vehicle_panel.h"
#include <QFile>
#include <QJsonDocument>
#include <QJsonObject>
#include "common/util.h"
#include "selfdrive/ui/sunnypilot/qt/widgets/scrollview.h"
enum HyundaiLongTuneOption {
Off = 0,
LongTune = 1,
EvenSmootherBraking = 2,
};
VehiclePanel::VehiclePanel(QWidget *parent) : QFrame(parent) {
main_layout = new QStackedLayout(this);
ListWidget *list = new ListWidget(this);
@@ -20,21 +30,80 @@ VehiclePanel::VehiclePanel(QWidget *parent) : QFrame(parent) {
platformSelector = new PlatformSelector();
list->addItem(platformSelector);
QObject::connect(uiState(), &UIState::offroadTransition, this, [=](bool offroad_transition) {
offroad = offroad_transition;
updatePanel(offroad);
updateCarToggles();
});
ScrollViewSP *scroller = new ScrollViewSP(list, this);
vlayout->addWidget(scroller);
QObject::connect(uiState(), &UIState::offroadTransition, this, &VehiclePanel::updatePanel);
QObject::connect(platformSelector, &PlatformSelector::clicked, [=]() {
QTimer::singleShot(100, this, &VehiclePanel::updateCarToggles);
});
std::vector<QString> tuning_buttons { tr("Off"), tr("Long Tune"), tr("Tune + Even Smoother Braking") };
hkgtuningToggle = new ButtonParamControlSP(
"HyundaiLongTune",
tr("HKG Custom Longitudinal Tuning"),
tr("Select a tuning mode. 'Off' means no custom tuning is applied. "
"'Long Tune' is a dynamic acceleration/brake tune to smoothen out braking. "
"'Tune + Smoother Braking' is the tuning, but with even smoother braking thanks to dynamic jerk."),
"../assets/offroad/icon_shell.png",
tuning_buttons
);
hkgtuningToggle->showDescription();
hkgtuningToggle->setProperty("originalDesc", hkgtuningToggle->getDescription());
connect(hkgtuningToggle, &ButtonParamControlSP::buttonToggled, this, [=](int index) {
hkg_state = index;
params.put("HyundaiLongTune", QString::number(index).toStdString());
params.putBool("HyundaiSmootherBraking", index == EvenSmootherBraking);
updateCarToggles();
});
// Add the tuning toggle to the layout
vlayout->addWidget(hkgtuningToggle);
// Add the vehicle screen to the main layout
main_layout->addWidget(vehicleScreen);
main_layout->setCurrentWidget(vehicleScreen);
}
void VehiclePanel::showEvent(QShowEvent *event) {
updatePanel(offroad);
updateCarToggles();
}
void VehiclePanel::updatePanel(bool _offroad) {
platformSelector->refresh(_offroad);
offroad = _offroad;
}
void VehiclePanel::updateCarToggles() {
bool openpilotLong = params.getBool("ExperimentalLongitudinalEnabled");
QString brand = platformSelector->getPlatformBundle("brand").toString();
if (brand == "hyundai") {
hkgtuningToggle->setVisible(true);
// Set enabled state/description based on openpilotLong
hkgtuningToggle->setEnabled(openpilotLong);
hkgtuningToggle->setDescription(openpilotLong ?
hkgtuningToggle->property("originalDesc").toString() :
tr("Enable openpilot longitudinal control first."));
// If not enabled, show disabled description.
if (!openpilotLong) {
hkgtuningToggle->showDescription();
return;
}
int tuningOption = QString::fromStdString(params.get("HyundaiLongTune")).toInt();
hkg_state = tuningOption; // Off=0, LongTune=1, EvenSmootherBraking=2
hkgtuningToggle->setCheckedButton(hkg_state);
hkgtuningToggle->showDescription();
} else {
// Hide toggle if not hyundai.
params.put("HyundaiLongTune", "0");
params.putBool("HyundaiSmootherBraking", false);
hkgtuningToggle->setVisible(false);
}
}
@@ -22,8 +22,17 @@ public slots:
void updatePanel(bool _offroad);
private:
// UI elements
QStackedLayout* main_layout = nullptr;
QWidget* vehicleScreen = nullptr;
PlatformSelector *platformSelector = nullptr;
bool offroad;
PlatformSelector* platformSelector = nullptr;
ButtonParamControlSP* hkgtuningToggle = nullptr;
// State tracking
bool offroad = false;
Params params;
int hkg_state = 0;
private slots:
void updateCarToggles();
};
+17 -1
View File
@@ -4,7 +4,6 @@ Copyright (c) 2021-, Haibin Wen, sunnypilot, and a number of other contributors.
This file is part of sunnypilot and is licensed under the MIT License.
See the LICENSE.md file in the root directory for more details.
"""
from opendbc.car import Bus, structs
from opendbc.car.can_definitions import CanRecvCallable, CanSendCallable
from opendbc.car.car_helpers import can_fingerprint
@@ -25,6 +24,22 @@ def log_fingerprint(CP: structs.CarParams) -> None:
else:
sentry.capture_fingerprint(CP.carFingerprint, CP.brand)
def _initialize_custom_longitudinal_tuning(CP: structs.CarParams, CP_SP: structs.CarParamsSP, params: Params = None) -> None:
if params is None:
params = Params()
# Hyundai Custom Longitudinal Tuning
if CP.brand == 'hyundai':
tuning_option_str = params.get("HyundaiLongTune")
if tuning_option_str is not None:
if isinstance(tuning_option_str, bytes):
tuning_option_str = tuning_option_str.decode('utf-8')
tuning_option_str = tuning_option_str.strip()
if tuning_option_str != "0":
CP_SP.flags |= HyundaiFlagsSP.LONG_TUNING.value
if params.get_bool("HyundaiSmootherBraking"):
CP_SP.flags |= HyundaiFlagsSP.LONG_TUNING_BRAKING.value
def _initialize_neural_network_lateral_control(CP: structs.CarParams, CP_SP: structs.CarParamsSP, params: Params = None,
enabled: bool = False) -> None:
@@ -62,6 +77,7 @@ def _initialize_radar_tracks(CP: structs.CarParams, CP_SP: structs.CarParamsSP,
def setup_interfaces(CP: structs.CarParams, CP_SP: structs.CarParamsSP, params: Params = None):
_initialize_custom_longitudinal_tuning(CP, CP_SP, params)
_initialize_neural_network_lateral_control(CP, CP_SP, params)
_initialize_radar_tracks(CP, CP_SP, params)
+2
View File
@@ -46,6 +46,8 @@ def manager_init() -> None:
("AutoLaneChangeTimer", "0"),
("AutoLaneChangeBsmDelay", "0"),
("DynamicExperimentalControl", "0"),
("HyundaiLongTune", "0"),
("HyundaiSmootherBraking", "0"),
("Mads", "1"),
("MadsMainCruiseAllowed", "1"),
("MadsPauseLateralOnBrake", "0"),