mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-21 08:14:00 +08:00
Newer sounds (#23091)
* new prompt sound * padding * prompt distracted * debug * fix spelling * lower min volume * better volume at low speeds * revert debug * revert that * fix tests * update refs Co-authored-by: Comma Device <device@comma.ai> old-commit-hash: 3b367e68728c29eea057d99f3948d64ed6cbfa92
This commit is contained in:
+1
-1
Submodule cereal updated: 9ce45916c6...596d34e77a
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:3007836472db496398397eb409778b2e0018cce66033afc791b108e5202ad371
|
||||
size 127172
|
||||
oid sha256:b9e126f394f2412a6edda83fa739d472e4bb921300e5eeecb2e3e122cd4e8f8d
|
||||
size 152148
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:91d9cec33aca78464627855696c248d042417da1d8ff6f6e947c35f003e7a334
|
||||
size 64702
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:079121f2e0272117afc21074d79602c9939a1a4f0c19ca0ed82547d7d9537c22
|
||||
size 209238
|
||||
oid sha256:b6c55e0295392a52a9432e0a4e383fc548deca610b3c8b11e2ee8a1c5e1e72d0
|
||||
size 75610
|
||||
|
||||
@@ -375,7 +375,7 @@ EVENTS: Dict[int, Dict[str, Union[Alert, Callable[[Any, messaging.SubMaster, boo
|
||||
"KEEP EYES ON ROAD",
|
||||
"Driver Distracted",
|
||||
AlertStatus.userPrompt, AlertSize.mid,
|
||||
Priority.MID, VisualAlert.steerRequired, AudibleAlert.prompt, .1),
|
||||
Priority.MID, VisualAlert.steerRequired, AudibleAlert.promptDistracted, .1),
|
||||
},
|
||||
|
||||
EventName.driverDistracted: {
|
||||
@@ -399,7 +399,7 @@ EVENTS: Dict[int, Dict[str, Union[Alert, Callable[[Any, messaging.SubMaster, boo
|
||||
"TOUCH STEERING WHEEL",
|
||||
"Driver Unresponsive",
|
||||
AlertStatus.userPrompt, AlertSize.mid,
|
||||
Priority.MID, VisualAlert.steerRequired, AudibleAlert.prompt, .1),
|
||||
Priority.MID, VisualAlert.steerRequired, AudibleAlert.promptDistracted, .1),
|
||||
},
|
||||
|
||||
EventName.driverUnresponsive: {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
class HardwareTici : public HardwareNone {
|
||||
public:
|
||||
static constexpr float MAX_VOLUME = 0.9;
|
||||
static constexpr float MIN_VOLUME = 0.3;
|
||||
static constexpr float MIN_VOLUME = 0.15;
|
||||
static bool TICI() { return true; }
|
||||
static std::string get_os_version() {
|
||||
return "AGNOS " + util::read_file("/VERSION");
|
||||
|
||||
@@ -1 +1 @@
|
||||
6da38baefb2741902f8b10fbf2b5e64fd15ced1f
|
||||
e15e446543ea74cce4864f07902a39bdb8b10688
|
||||
@@ -47,7 +47,7 @@ void Sound::update() {
|
||||
|
||||
// scale volume with speed
|
||||
if (sm.updated("carState")) {
|
||||
float volume = std::clamp(sm["carState"].getCarState().getVEgo() / 29.f, 0.1f, 1.0f);
|
||||
float volume = util::map_val(sm["carState"].getCarState().getVEgo(), 11.f, 29.f, 0.f, 1.0f);
|
||||
volume = QAudio::convertVolume(volume, QAudio::LogarithmicVolumeScale, QAudio::LinearVolumeScale);
|
||||
volume = util::map_val(volume, 0.f, 1.f, Hardware::MIN_VOLUME, Hardware::MAX_VOLUME);
|
||||
for (auto &[s, loops] : sounds) {
|
||||
|
||||
@@ -13,6 +13,7 @@ const std::tuple<AudibleAlert, QString, int> sound_list[] = {
|
||||
|
||||
{AudibleAlert::PROMPT, "prompt.wav", 0},
|
||||
{AudibleAlert::PROMPT_REPEAT, "prompt.wav", QSoundEffect::Infinite},
|
||||
{AudibleAlert::PROMPT_DISTRACTED, "prompt_distracted.wav", 0},
|
||||
|
||||
{AudibleAlert::WARNING_SOFT, "warning_soft.wav", QSoundEffect::Infinite},
|
||||
{AudibleAlert::WARNING_IMMEDIATE, "warning_immediate.wav", 10},
|
||||
|
||||
@@ -17,9 +17,10 @@ SOUNDS = {
|
||||
AudibleAlert.none: 0,
|
||||
AudibleAlert.engage: 197,
|
||||
AudibleAlert.disengage: 230,
|
||||
AudibleAlert.refuse: 223,
|
||||
AudibleAlert.refuse: 189,
|
||||
AudibleAlert.prompt: 217,
|
||||
AudibleAlert.promptRepeat: 475,
|
||||
AudibleAlert.promptDistracted: 187,
|
||||
AudibleAlert.warningSoft: 477,
|
||||
AudibleAlert.warningImmediate: 468,
|
||||
}
|
||||
@@ -39,7 +40,7 @@ class TestSoundd(unittest.TestCase):
|
||||
pm = messaging.PubMaster(['deviceState', 'controlsState'])
|
||||
|
||||
# make sure they're all defined
|
||||
alert_sounds = {v: k for k, v in car.CarControl.HUDControl.AudibleAlert.schema.enumerants.items() if not k.endswith('DEPRECATED')}
|
||||
alert_sounds = {v: k for k, v in car.CarControl.HUDControl.AudibleAlert.schema.enumerants.items()}
|
||||
diff = set(SOUNDS.keys()).symmetric_difference(alert_sounds.keys())
|
||||
assert len(diff) == 0, f"not all sounds defined in test: {diff}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user