diff --git a/openpilot/selfdrive/ui/translations/app.pot b/openpilot/selfdrive/ui/translations/app.pot index 5dfda0cc2c..61495377f9 100644 --- a/openpilot/selfdrive/ui/translations/app.pot +++ b/openpilot/selfdrive/ui/translations/app.pot @@ -23519,6 +23519,10 @@ msgstr "" msgid "Jaguar F-Type" msgstr "" +#: openpilot/starpilot/engine_sound/profiles.py +msgid "Nissan Super GT" +msgstr "" + #: openpilot/starpilot/engine_sound/profiles.py msgid "Supra Turbo" msgstr "" diff --git a/openpilot/selfdrive/ui/translations/app_de.po b/openpilot/selfdrive/ui/translations/app_de.po index cb37390cc5..4b7a35ae2c 100644 --- a/openpilot/selfdrive/ui/translations/app_de.po +++ b/openpilot/selfdrive/ui/translations/app_de.po @@ -23538,6 +23538,10 @@ msgstr "Hellcat" msgid "Jaguar F-Type" msgstr "Jaguar F-Type" +#: openpilot/starpilot/engine_sound/profiles.py +msgid "Nissan Super GT" +msgstr "Nissan Super GT" + #: openpilot/starpilot/engine_sound/profiles.py msgid "Supra Turbo" msgstr "Supra Turbo" diff --git a/openpilot/selfdrive/ui/translations/app_es.po b/openpilot/selfdrive/ui/translations/app_es.po index bcc98ddcd7..098b61a360 100644 --- a/openpilot/selfdrive/ui/translations/app_es.po +++ b/openpilot/selfdrive/ui/translations/app_es.po @@ -23538,6 +23538,10 @@ msgstr "Hellcat" msgid "Jaguar F-Type" msgstr "Jaguar F-Type" +#: openpilot/starpilot/engine_sound/profiles.py +msgid "Nissan Super GT" +msgstr "Nissan Super GT" + #: openpilot/starpilot/engine_sound/profiles.py msgid "Supra Turbo" msgstr "Supra Turbo" diff --git a/openpilot/selfdrive/ui/translations/app_fr.po b/openpilot/selfdrive/ui/translations/app_fr.po index 0962484425..9832544694 100644 --- a/openpilot/selfdrive/ui/translations/app_fr.po +++ b/openpilot/selfdrive/ui/translations/app_fr.po @@ -23538,6 +23538,10 @@ msgstr "Hellcat" msgid "Jaguar F-Type" msgstr "Jaguar F-Type" +#: openpilot/starpilot/engine_sound/profiles.py +msgid "Nissan Super GT" +msgstr "Nissan Super GT" + #: openpilot/starpilot/engine_sound/profiles.py msgid "Supra Turbo" msgstr "Supra Turbo" diff --git a/openpilot/selfdrive/ui/translations/app_ja.po b/openpilot/selfdrive/ui/translations/app_ja.po index cddcaf5a20..30ab75f16a 100644 --- a/openpilot/selfdrive/ui/translations/app_ja.po +++ b/openpilot/selfdrive/ui/translations/app_ja.po @@ -23534,6 +23534,10 @@ msgstr "Hellcat" msgid "Jaguar F-Type" msgstr "Jaguar F-Type" +#: openpilot/starpilot/engine_sound/profiles.py +msgid "Nissan Super GT" +msgstr "Nissan Super GT" + #: openpilot/starpilot/engine_sound/profiles.py msgid "Supra Turbo" msgstr "Supra Turbo" diff --git a/openpilot/selfdrive/ui/translations/app_ko.po b/openpilot/selfdrive/ui/translations/app_ko.po index 406a52c4aa..8540b428ce 100644 --- a/openpilot/selfdrive/ui/translations/app_ko.po +++ b/openpilot/selfdrive/ui/translations/app_ko.po @@ -23534,6 +23534,10 @@ msgstr "Hellcat" msgid "Jaguar F-Type" msgstr "Jaguar F-Type" +#: openpilot/starpilot/engine_sound/profiles.py +msgid "Nissan Super GT" +msgstr "Nissan Super GT" + #: openpilot/starpilot/engine_sound/profiles.py msgid "Supra Turbo" msgstr "Supra Turbo" diff --git a/openpilot/selfdrive/ui/translations/app_vi.po b/openpilot/selfdrive/ui/translations/app_vi.po index e24771922e..bbde872156 100644 --- a/openpilot/selfdrive/ui/translations/app_vi.po +++ b/openpilot/selfdrive/ui/translations/app_vi.po @@ -23534,6 +23534,10 @@ msgstr "Hellcat" msgid "Jaguar F-Type" msgstr "Jaguar F-Type" +#: openpilot/starpilot/engine_sound/profiles.py +msgid "Nissan Super GT" +msgstr "Nissan Super GT" + #: openpilot/starpilot/engine_sound/profiles.py msgid "Supra Turbo" msgstr "Supra Turbo" diff --git a/openpilot/starpilot/engine_sound/banks/LICENSE b/openpilot/starpilot/engine_sound/banks/LICENSE index dc84a49ac0..344643a5d1 100644 --- a/openpilot/starpilot/engine_sound/banks/LICENSE +++ b/openpilot/starpilot/engine_sound/banks/LICENSE @@ -17,6 +17,11 @@ From recordings of real cars supplied for this project, built with tools/bank_fr jaguar_ftype Jaguar2.wav: --cylinders 8 --half-orders --anchor 17 721 --anchor 40 5122 --anchor 66 4402 --idle 14.5-19.5 --on 20.5-45.8 52-77 --denoise 10, not equalised (the in-car recording is already bass-heavy); the 750 rpm loop (a second idle) and the 3500 rpm loop (dominated by crank-rate boom) removed + nissan_super_gt NissanSuperGT.wav: --cylinders 8 --half-orders, rpm labelled as 120 x the spacing of its harmonic + comb (whether that is rpm/120 or rpm/60 cannot be told from the recording; the profile uses the same + units, so the pitch is right either way), pinned with --anchor at every 0.25 s point whose comb + measured clearly, --idle 18.6-19.6 --on 9-17 19.7-65 79.4-88.2 --off 9-17 65-71 74.2-76 79.4-88.2, + not equalised engine-sim is distributed under the following license: diff --git a/openpilot/starpilot/engine_sound/banks/nissan_super_gt/bank.json b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/bank.json new file mode 100644 index 0000000000..fe07e89430 --- /dev/null +++ b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/bank.json @@ -0,0 +1,134 @@ +{ + "version": 1, + "source": "recording NissanSuperGT.wav", + "layers": { + "off": [ + { + "rpm": 1556, + "file": "off_1556.wav" + }, + { + "rpm": 4000, + "file": "off_4000.wav" + }, + { + "rpm": 4250, + "file": "off_4250.wav" + }, + { + "rpm": 4500, + "file": "off_4500.wav" + }, + { + "rpm": 4750, + "file": "off_4750.wav" + }, + { + "rpm": 5000, + "file": "off_5000.wav" + }, + { + "rpm": 5250, + "file": "off_5250.wav" + }, + { + "rpm": 5500, + "file": "off_5500.wav" + }, + { + "rpm": 5750, + "file": "off_5750.wav" + }, + { + "rpm": 6000, + "file": "off_6000.wav" + }, + { + "rpm": 6250, + "file": "off_6250.wav" + }, + { + "rpm": 6500, + "file": "off_6500.wav" + }, + { + "rpm": 6750, + "file": "off_6750.wav" + }, + { + "rpm": 7000, + "file": "off_7000.wav" + } + ], + "on": [ + { + "rpm": 1556, + "file": "on_1556.wav" + }, + { + "rpm": 3250, + "file": "on_3250.wav" + }, + { + "rpm": 3500, + "file": "on_3500.wav" + }, + { + "rpm": 3750, + "file": "on_3750.wav" + }, + { + "rpm": 4000, + "file": "on_4000.wav" + }, + { + "rpm": 4250, + "file": "on_4250.wav" + }, + { + "rpm": 4500, + "file": "on_4500.wav" + }, + { + "rpm": 4750, + "file": "on_4750.wav" + }, + { + "rpm": 5000, + "file": "on_5000.wav" + }, + { + "rpm": 5250, + "file": "on_5250.wav" + }, + { + "rpm": 5500, + "file": "on_5500.wav" + }, + { + "rpm": 5750, + "file": "on_5750.wav" + }, + { + "rpm": 6000, + "file": "on_6000.wav" + }, + { + "rpm": 6250, + "file": "on_6250.wav" + }, + { + "rpm": 6500, + "file": "on_6500.wav" + }, + { + "rpm": 6750, + "file": "on_6750.wav" + }, + { + "rpm": 7000, + "file": "on_7000.wav" + } + ] + } +} diff --git a/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_1556.wav b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_1556.wav new file mode 100644 index 0000000000..1c8254a05b Binary files /dev/null and b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_1556.wav differ diff --git a/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_4000.wav b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_4000.wav new file mode 100644 index 0000000000..7227e5cd3d Binary files /dev/null and b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_4000.wav differ diff --git a/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_4250.wav b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_4250.wav new file mode 100644 index 0000000000..4bf8138dc1 Binary files /dev/null and b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_4250.wav differ diff --git a/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_4500.wav b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_4500.wav new file mode 100644 index 0000000000..b0f180c2dc Binary files /dev/null and b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_4500.wav differ diff --git a/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_4750.wav b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_4750.wav new file mode 100644 index 0000000000..1b4c5564e9 Binary files /dev/null and b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_4750.wav differ diff --git a/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_5000.wav b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_5000.wav new file mode 100644 index 0000000000..8c1adf30f1 Binary files /dev/null and b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_5000.wav differ diff --git a/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_5250.wav b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_5250.wav new file mode 100644 index 0000000000..a3ea95d9ec Binary files /dev/null and b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_5250.wav differ diff --git a/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_5500.wav b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_5500.wav new file mode 100644 index 0000000000..c7106329a4 Binary files /dev/null and b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_5500.wav differ diff --git a/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_5750.wav b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_5750.wav new file mode 100644 index 0000000000..7294a86e54 Binary files /dev/null and b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_5750.wav differ diff --git a/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_6000.wav b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_6000.wav new file mode 100644 index 0000000000..a75422e55c Binary files /dev/null and b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_6000.wav differ diff --git a/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_6250.wav b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_6250.wav new file mode 100644 index 0000000000..9419c393db Binary files /dev/null and b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_6250.wav differ diff --git a/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_6500.wav b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_6500.wav new file mode 100644 index 0000000000..781c22e960 Binary files /dev/null and b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_6500.wav differ diff --git a/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_6750.wav b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_6750.wav new file mode 100644 index 0000000000..be5d996d29 Binary files /dev/null and b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_6750.wav differ diff --git a/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_7000.wav b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_7000.wav new file mode 100644 index 0000000000..344419b490 Binary files /dev/null and b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/off_7000.wav differ diff --git a/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_1556.wav b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_1556.wav new file mode 100644 index 0000000000..50a98d1af4 Binary files /dev/null and b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_1556.wav differ diff --git a/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_3250.wav b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_3250.wav new file mode 100644 index 0000000000..14a1852fbd Binary files /dev/null and b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_3250.wav differ diff --git a/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_3500.wav b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_3500.wav new file mode 100644 index 0000000000..e7fe3ec867 Binary files /dev/null and b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_3500.wav differ diff --git a/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_3750.wav b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_3750.wav new file mode 100644 index 0000000000..ce04f75777 Binary files /dev/null and b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_3750.wav differ diff --git a/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_4000.wav b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_4000.wav new file mode 100644 index 0000000000..eebe05fe53 Binary files /dev/null and b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_4000.wav differ diff --git a/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_4250.wav b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_4250.wav new file mode 100644 index 0000000000..16155befd4 Binary files /dev/null and b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_4250.wav differ diff --git a/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_4500.wav b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_4500.wav new file mode 100644 index 0000000000..7fabba6b87 Binary files /dev/null and b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_4500.wav differ diff --git a/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_4750.wav b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_4750.wav new file mode 100644 index 0000000000..8999eca2e4 Binary files /dev/null and b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_4750.wav differ diff --git a/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_5000.wav b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_5000.wav new file mode 100644 index 0000000000..a858682147 Binary files /dev/null and b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_5000.wav differ diff --git a/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_5250.wav b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_5250.wav new file mode 100644 index 0000000000..9fd7abe84f Binary files /dev/null and b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_5250.wav differ diff --git a/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_5500.wav b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_5500.wav new file mode 100644 index 0000000000..6749c98756 Binary files /dev/null and b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_5500.wav differ diff --git a/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_5750.wav b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_5750.wav new file mode 100644 index 0000000000..a35c7da649 Binary files /dev/null and b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_5750.wav differ diff --git a/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_6000.wav b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_6000.wav new file mode 100644 index 0000000000..752b95a7ca Binary files /dev/null and b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_6000.wav differ diff --git a/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_6250.wav b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_6250.wav new file mode 100644 index 0000000000..5369fbf89c Binary files /dev/null and b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_6250.wav differ diff --git a/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_6500.wav b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_6500.wav new file mode 100644 index 0000000000..aaf938df86 Binary files /dev/null and b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_6500.wav differ diff --git a/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_6750.wav b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_6750.wav new file mode 100644 index 0000000000..55407759cb Binary files /dev/null and b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_6750.wav differ diff --git a/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_7000.wav b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_7000.wav new file mode 100644 index 0000000000..0f83979ac4 Binary files /dev/null and b/openpilot/starpilot/engine_sound/banks/nissan_super_gt/on_7000.wav differ diff --git a/openpilot/starpilot/engine_sound/profiles.py b/openpilot/starpilot/engine_sound/profiles.py index daf65fa608..2a596ae7be 100644 --- a/openpilot/starpilot/engine_sound/profiles.py +++ b/openpilot/starpilot/engine_sound/profiles.py @@ -58,14 +58,18 @@ RACE_REDLINE = 8600.0 def _recorded(name: str, label: str, *, cylinders: int, idle: float, redline: float, loops: str = '', pops: float = 0.0, - turbo: float = 0.0) -> Profile: - """A bundled loop bank (of the same name unless given), geared like the race car but scaled to its own rev range.""" - scale = redline / RACE_REDLINE + turbo: float = 0.0, upshift: float = 0.38, downshift: float = 0.2, gearing: float = 1.0) -> Profile: + """A bundled loop bank (of the same name unless given), geared like the race car but scaled to its own rev range. + + upshift and downshift are the light-throttle shift points as shares of redline; full throttle always shifts at 96%. + gearing above 1 makes every gear shorter, so road speed turns into more rpm. + """ + scale = redline / RACE_REDLINE * gearing return Profile( name=name, label=label, loops=loops or name, pops=pops, turbo=turbo, idle_rpm=idle, redline_rpm=redline, gears=tuple(ratio * scale for ratio in RACE_GEARS), - upshift_rpm=(0.38 * redline, 0.96 * redline), downshift_rpm=(0.2 * redline, 0.6 * redline), + upshift_rpm=(upshift * redline, 0.96 * redline), downshift_rpm=(downshift * redline, max(0.6, downshift + 0.25) * redline), launch_slip_rpm=0.4 * redline, rev_seconds=0.8, rise_seconds=0.08, fall_seconds=0.35, limiter=True, partials=_engine_partials(firing=cylinders, count=40, rough=0.25, bright=0.5), noise=(0.03, 0.18), gain=(0.7, 1.0), @@ -81,6 +85,9 @@ PROFILES: dict[str, Profile] = {profile.name: profile for profile in ( _recorded('hellcat', 'Hellcat', cylinders=8, idle=700.0, redline=4500.0), _recorded('jaguar_ftype', 'Jaguar F-Type', cylinders=8, idle=721.0, redline=6500.0, pops=1.0), _recorded('lfa', 'LFA', cylinders=10, idle=1000.0, redline=9000.0), + # Recorded only at idle and from 3250 rpm up, so it is geared short and shifts like a race car to stay in that range. + _recorded('nissan_super_gt', 'Nissan Super GT', cylinders=4, idle=1556.0, redline=7500.0, upshift=0.62, downshift=0.45, + gearing=1.2), _recorded('supra_turbo', 'Supra Turbo', cylinders=6, idle=800.0, redline=6000.0, turbo=1.0), )} diff --git a/openpilot/starpilot/engine_sound/tests/test_model_synth.py b/openpilot/starpilot/engine_sound/tests/test_model_synth.py index 4309a40a25..72a3823419 100644 --- a/openpilot/starpilot/engine_sound/tests/test_model_synth.py +++ b/openpilot/starpilot/engine_sound/tests/test_model_synth.py @@ -112,7 +112,8 @@ def test_drivers_pedal_sets_the_load_even_when_the_car_pulls_hard(): assert run(model, 1.0, 0.25, 8.0, 2.5, True)[1] == pytest.approx(0.25, abs=0.02) -@pytest.mark.parametrize('name', [name for name, profile in PROFILES.items() if profile.gears]) +@pytest.mark.parametrize('name', [name for name, profile in PROFILES.items() + if profile.gears and profile.upshift_rpm[0] <= 0.4 * profile.redline_rpm]) def test_light_pedal_shifts_well_below_the_top_of_the_rev_range(name): profile = PROFILES[name] model = EngineModel(profile) diff --git a/openpilot/starpilot/engine_sound/tests/test_profiles.py b/openpilot/starpilot/engine_sound/tests/test_profiles.py new file mode 100644 index 0000000000..5ccc0d941b --- /dev/null +++ b/openpilot/starpilot/engine_sound/tests/test_profiles.py @@ -0,0 +1,35 @@ +import pytest + +from openpilot.starpilot.engine_sound.model import EngineModel +from openpilot.starpilot.engine_sound.profiles import PROFILES, RACE_GEARS, RACE_REDLINE + +DT = 0.01 +SUPER_GT_RECORDED_FROM = 3250.0 + + +@pytest.mark.parametrize('name', [name for name in PROFILES if name != 'nissan_super_gt']) +def test_default_gearing_and_shift_points(name): + p = PROFILES[name] + assert p.upshift_rpm == pytest.approx((0.38 * p.redline_rpm, 0.96 * p.redline_rpm)) + assert p.downshift_rpm == pytest.approx((0.2 * p.redline_rpm, 0.6 * p.redline_rpm)) + assert p.gears == pytest.approx(tuple(ratio * p.redline_rpm / RACE_REDLINE for ratio in RACE_GEARS)) + + +def test_super_gt_is_geared_short_and_holds_revs(): + p = PROFILES['nissan_super_gt'] + assert p.gears[0] == pytest.approx(RACE_GEARS[0] * p.redline_rpm / RACE_REDLINE * 1.2) + assert p.upshift_rpm[0] == pytest.approx(0.62 * p.redline_rpm) + assert p.downshift_rpm == pytest.approx((0.45 * p.redline_rpm, 0.7 * p.redline_rpm)) + + +def test_super_gt_light_pedal_stays_in_the_recorded_range_and_clear_of_redline(): + p = PROFILES['nissan_super_gt'] + model = EngineModel(p) + speed, revs = 0.0, [] + while speed < 30.0: + speed += 1.2 * DT + revs.append(model.update(DT, 0.25, speed, 1.2, True)[0]) + cruising = [rpm for rpm, v in zip(revs, (DT * 1.2 * i for i in range(len(revs))), strict=True) if v > 8.0] + assert min(cruising) > SUPER_GT_RECORDED_FROM + assert max(revs) < 0.75 * p.redline_rpm + assert model.gear >= 3 diff --git a/openpilot/starpilot/galaxy/tests/test_settings_controls.mjs b/openpilot/starpilot/galaxy/tests/test_settings_controls.mjs index b585806867..d9f13d081e 100644 --- a/openpilot/starpilot/galaxy/tests/test_settings_controls.mjs +++ b/openpilot/starpilot/galaxy/tests/test_settings_controls.mjs @@ -272,7 +272,7 @@ assert.equal(previewVolume.vm.soundError, "Keep the comma offroad") assert.equal(previewVolume.vm.previewLabel, "Test alert") { - const engine = control({ label: "Engine Type", value: "LFA", choices: ["BMW M3", "BMW M52","F1 Car","Ferrari F136", "Hellcat", "Jaguar F-Type", "LFA", "Supra Turbo"], + const engine = control({ label: "Engine Type", value: "LFA", choices: ["BMW M3", "BMW M52","F1 Car","Ferrari F136", "Hellcat", "Jaguar F-Type", "LFA", "Nissan Super GT", "Supra Turbo"], available: true, action: true, previewSound: "EngineSoundProfile" }) assert.equal(settingControl(engine.vm.row), "select") assert.equal(engine.vm.previewLabel, "Rev engine") diff --git a/openpilot/starpilot/ui/tests/test_sounds_settings.py b/openpilot/starpilot/ui/tests/test_sounds_settings.py index 22e81563c2..8eeeecba24 100644 --- a/openpilot/starpilot/ui/tests/test_sounds_settings.py +++ b/openpilot/starpilot/ui/tests/test_sounds_settings.py @@ -122,7 +122,7 @@ class SoundsSettingsTests(unittest.TestCase): self.params.put("EngineSoundProfile", "race_car", block=True) row = self.row("EngineSoundProfile") self.assertEqual((row.value, row.repair_value), ("LFA", "")) - self.assertEqual([r.value for r in self.owner.engine_type_snapshot().rows], ["", "", "", "", "", "", "Active", ""]) + self.assertEqual([r.value for r in self.owner.engine_type_snapshot().rows], ["", "", "", "", "", "", "Active", "", ""]) self.assertTrue(self.owner.apply(FeatureSettingsRequest("EngineSoundProfile", row.source, "BMW M52"))) self.assertEqual(self.params.get("EngineSoundProfile"), "bmw_m52") @@ -161,14 +161,14 @@ class SoundsSettingsTests(unittest.TestCase): [("BMW M3", "", (("Use", True),)), ("BMW M52", "", (("Use", True),)), ("F1 Car", "", (("Use", True),)), ("Ferrari F136", "", (("Use", True),)), ("Hellcat", "", (("Use", True),)), ("Jaguar F-Type", "", (("Use", True),)), ("LFA", "Active", (("Active", True),)), - ("Supra Turbo", "", (("Use", True),))]) + ("Nissan Super GT", "", (("Use", True),)), ("Supra Turbo", "", (("Use", True),))]) stale = picker.rows[1] request = owner.engine_choice_request(stale) assert request is not None self.assertTrue(owner.apply(request)) self.assertEqual((self.params.get("EngineSoundProfile"), revs), ("bmw_m52", [1])) picker = owner.engine_type_snapshot() - self.assertEqual([row.value for row in picker.rows], ["", "Active", "", "", "", "", "", ""]) + self.assertEqual([row.value for row in picker.rows], ["", "Active", "", "", "", "", "", "", ""]) replay = owner.engine_choice_request(picker.rows[1]) assert replay is not None self.assertTrue(owner.apply(replay)) diff --git a/openpilot/starpilot/ui/translation_messages.json b/openpilot/starpilot/ui/translation_messages.json index a9c230cc67..34a0ab1eca 100644 --- a/openpilot/starpilot/ui/translation_messages.json +++ b/openpilot/starpilot/ui/translation_messages.json @@ -32242,6 +32242,12 @@ "openpilot/starpilot/engine_sound/profiles.py" ] }, + { + "source": "Nissan Super GT", + "refs": [ + "openpilot/starpilot/engine_sound/profiles.py" + ] + }, { "source": "Supra Turbo", "refs": [ diff --git a/prebuilt.json b/prebuilt.json index e2c66381be..d83d3f77e6 100644 --- a/prebuilt.json +++ b/prebuilt.json @@ -1 +1 @@ -{"protected_inventory_sha256": "372391472fc99b83c7071e2210fe34e741e6b1e720ffb0c821cc94f2e7f5bf95", "schema_version": 1} +{"protected_inventory_sha256": "60169ddc374d4c16f1fc902fc4182dc76c8f43c7f794491f9d2f126d201e38a1", "schema_version": 1}