mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-20 21:42:05 +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>
This commit is contained in:
+1
-1
Submodule cereal updated: 9ce45916c6...596d34e77a
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -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