Skip to content

Commit

Permalink
Update SA-master to 6aeb542 (#532)
Browse files Browse the repository at this point in the history
Merge remote-tracking branch 'upstream/master' into SA-master
  • Loading branch information
sshane committed Dec 22, 2021
2 parents b9a5dc5 + 6aeb542 commit 0761c4c
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 174 deletions.
2 changes: 1 addition & 1 deletion cereal
Submodule cereal updated 1 files
+2 −1 car.capnp
4 changes: 4 additions & 0 deletions selfdrive/car/mazda/values.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class Buttons:
b'PX2G-188K2-D\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
b'PX2H-188K2-B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
b'PX2H-188K2-D\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
b'PX2H-188K2-G\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
b'PX2K-188K2-B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
b'PX38-188K2-B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
b'PX42-188K2-C\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
Expand All @@ -66,6 +67,7 @@ class Buttons:
b'K131-67XK2-B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
b'K131-67XK2-C\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
b'K131-67XK2-E\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
b'K131-67XK2-F\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
],
(Ecu.esp, 0x760, None): [
b'K123-437K2-E\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
Expand All @@ -81,6 +83,7 @@ class Buttons:
b'GSH7-67XK2-J\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
b'GSH7-67XK2-M\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
b'GSH7-67XK2-N\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
b'GSH7-67XK2-R\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
],
(Ecu.transmission, 0x7e1, None): [
b'PA66-21PS1-A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
Expand All @@ -94,6 +97,7 @@ class Buttons:
b'PYB2-21PS1-C\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
b'PYB2-21PS1-D\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
b'PYB2-21PS1-G\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
b'PYB2-21PS1-H\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
b'PYNC-21PS1-B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
b'SH9T-21PS1-D\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
],
Expand Down
2 changes: 2 additions & 0 deletions selfdrive/controls/lib/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@ def joystick_alert(CP: car.CarParams, sm: messaging.SubMaster, metric: bool, sof

EventName.stockFcw: {},

EventName.lkasDisabled: {},

# ********** events only containing alerts displayed in all states **********

'modelLongAlert': {
Expand Down
4 changes: 0 additions & 4 deletions selfdrive/debug/internal/rt/atrace.sh

This file was deleted.

25 changes: 0 additions & 25 deletions selfdrive/debug/internal/rt/record_trace.sh

This file was deleted.

63 changes: 0 additions & 63 deletions selfdrive/debug/internal/rt/waste3.c

This file was deleted.

6 changes: 0 additions & 6 deletions selfdrive/debug/internal/sounds/set_volume.sh

This file was deleted.

45 changes: 0 additions & 45 deletions selfdrive/debug/internal/sounds/test_sound_stability.py

This file was deleted.

23 changes: 0 additions & 23 deletions selfdrive/debug/internal/sounds/test_sounds.py

This file was deleted.

2 changes: 1 addition & 1 deletion selfdrive/ui/qt/offroad/networking.cc
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ AdvancedNetworking::AdvancedNetworking(QWidget* parent, WifiManager* wifi): QWid
list->addItem(roamingToggle);

// APN settings
ButtonControl *editApnButton = new ButtonControl("APN settings", "EDIT");
ButtonControl *editApnButton = new ButtonControl("APN Setting", "EDIT");
connect(editApnButton, &ButtonControl::clicked, [=]() {
const bool roamingEnabled = params.getBool("GsmRoaming");
const QString cur_apn = QString::fromStdString(params.get("GsmApn"));
Expand Down
1 change: 1 addition & 0 deletions selfdrive/ui/qt/onroad.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ void OnroadWindow::offroadTransition(bool offroad) {
if (map == nullptr && (uiState()->has_prime || !MAPBOX_TOKEN.isEmpty())) {
MapWindow * m = new MapWindow(get_mapbox_settings());
m->setFixedWidth(topWidget(this)->width() / 2);
m->offroadTransition(offroad);
QObject::connect(uiState(), &UIState::offroadTransition, m, &MapWindow::offroadTransition);
split->addWidget(m, 0, Qt::AlignRight);
map = m;
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/ui/soundd/sound.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const std::tuple<AudibleAlert, QString, int> sound_list[] = {
{AudibleAlert::PROMPT_DISTRACTED, "prompt_distracted.wav", QSoundEffect::Infinite},

{AudibleAlert::WARNING_SOFT, "warning_soft.wav", QSoundEffect::Infinite},
{AudibleAlert::WARNING_IMMEDIATE, "warning_immediate.wav", 10},
{AudibleAlert::WARNING_IMMEDIATE, "warning_immediate.wav", QSoundEffect::Infinite},
};

class Sound : public QObject {
Expand Down
19 changes: 14 additions & 5 deletions selfdrive/ui/ui.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,38 @@ struct Alert {
QString type;
cereal::ControlsState::AlertSize size;
AudibleAlert sound;

bool equal(const Alert &a2) {
return text1 == a2.text1 && text2 == a2.text2 && type == a2.type && sound == a2.sound;
}

static Alert get(const SubMaster &sm, uint64_t started_frame) {
const cereal::ControlsState::Reader &cs = sm["controlsState"].getControlsState();
if (sm.updated("controlsState")) {
const cereal::ControlsState::Reader &cs = sm["controlsState"].getControlsState();
return {cs.getAlertText1().cStr(), cs.getAlertText2().cStr(),
cs.getAlertType().cStr(), cs.getAlertSize(),
cs.getAlertSound()};
} else if ((sm.frame - started_frame) > 5 * UI_FREQ) {
const int CONTROLS_TIMEOUT = 5;
const int controls_missing = (nanos_since_boot() - sm.rcv_time("controlsState")) / 1e9;

// Handle controls timeout
if (sm.rcv_frame("controlsState") < started_frame) {
// car is started, but controlsState hasn't been seen at all
return {"openpilot Unavailable", "Waiting for controls to start",
"controlsWaiting", cereal::ControlsState::AlertSize::MID,
AudibleAlert::NONE};
} else if ((nanos_since_boot() - sm.rcv_time("controlsState")) / 1e9 > CONTROLS_TIMEOUT) {
} else if (controls_missing > CONTROLS_TIMEOUT) {
// car is started, but controls is lagging or died
return {"TAKE CONTROL IMMEDIATELY", "Controls Unresponsive",
"controlsUnresponsive", cereal::ControlsState::AlertSize::FULL,
AudibleAlert::WARNING_IMMEDIATE};
if (cs.getEnabled() && (controls_missing - CONTROLS_TIMEOUT) < 10) {
return {"TAKE CONTROL IMMEDIATELY", "Controls Unresponsive",
"controlsUnresponsive", cereal::ControlsState::AlertSize::FULL,
AudibleAlert::WARNING_IMMEDIATE};
} else {
return {"Controls Unresponsive", "Reboot Device",
"controlsUnresponsivePermanent", cereal::ControlsState::AlertSize::MID,
AudibleAlert::NONE};
}
}
}
return {};
Expand Down

0 comments on commit 0761c4c

Please sign in to comment.