Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move alphalong toggle to developer panel #34223

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
2014783
duplicate alphalong toggle
AlexandreSato Oct 29, 2024
fa603ae
add description
AlexandreSato Oct 29, 2024
90fc342
cleanup
AlexandreSato Oct 29, 2024
3b74846
Merge branch 'commaai:master' into move-alphalong-to-developerpanel
AlexandreSato Oct 29, 2024
c534d77
add cases
AlexandreSato Oct 29, 2024
441674b
remove old alpha_long toggle and cleanup
AlexandreSato Oct 29, 2024
62e9e04
Merge branch 'master' into move-alphalong-to-developerpanel
maxime-desroches Oct 29, 2024
40c96c4
Merge branch 'commaai:master' into move-alphalong-to-developerpanel
AlexandreSato Oct 31, 2024
b8d0ad5
Merge branch 'commaai:master' into move-alphalong-to-developerpanel
AlexandreSato Oct 31, 2024
ad107c0
Merge branch 'commaai:master' into move-alphalong-to-developerpanel
AlexandreSato Nov 1, 2024
5cfb316
Merge branch 'commaai:master' into move-alphalong-to-developerpanel
AlexandreSato Nov 11, 2024
c11b8c4
fix some design errors
AlexandreSato Nov 11, 2024
3366cbc
Revert "fix some design errors"
AlexandreSato Nov 13, 2024
caedab5
Merge branch 'commaai:master' into move-alphalong-to-developerpanel
AlexandreSato Nov 13, 2024
e80ff6b
Create FUNDING.yml
AlexandreSato Nov 18, 2024
d29d1bd
Merge branch 'commaai:master' into master
AlexandreSato Nov 21, 2024
c72d155
Merge branch 'master' into move-alphalong-to-developerpanel
AlexandreSato Nov 21, 2024
c246825
Merge branch 'commaai:master' into move-alphalong-to-developerpanel
AlexandreSato Dec 2, 2024
3d2b785
Merge branch 'commaai:master' into move-alphalong-to-developerpanel
AlexandreSato Dec 11, 2024
f117ca7
cleanup
AlexandreSato Dec 12, 2024
f014727
Merge branch 'commaai:master' into move-alphalong-to-developerpanel
AlexandreSato Dec 12, 2024
0020916
hidde btn in release and no translate
AlexandreSato Dec 12, 2024
9763e65
remove new translations
AlexandreSato Dec 13, 2024
7894387
update translation files
AlexandreSato Dec 13, 2024
523e0f8
rm obsolete translations
AlexandreSato Dec 13, 2024
a02f9b0
if is a release branch or if the car already have long control the al…
AlexandreSato Dec 13, 2024
bacc7d8
fix identation
AlexandreSato Dec 13, 2024
52d71ca
Merge branch 'commaai:master' into move-alphalong-to-developerpanel
AlexandreSato Dec 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions selfdrive/ui/qt/offroad/developer_panel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ DeveloperPanel::DeveloperPanel(SettingsWindow *parent) : ListWidget(parent) {
});
addItem(longManeuverToggle);

alphaLongToggle = new ParamControl("ExperimentalLongitudinalEnabled", tr("openpilot Longitudinal Control (Alpha)"), "", "../assets/offroad/icon_speed_limit.png");
QObject::connect(alphaLongToggle, &ParamControl::toggleFlipped, [=](bool state) {
updateToggles(offroad);
});
addItem(alphaLongToggle);
alphaLongToggle->setConfirmation(true, false);

// Joystick and longitudinal maneuvers should be hidden on release branches
is_release = params.getBool("IsReleaseBranch");

Expand All @@ -43,8 +50,29 @@ void DeveloperPanel::updateToggles(bool _offroad) {
AlignedBuffer aligned_buf;
capnp::FlatArrayMessageReader cmsg(aligned_buf.align(cp_bytes.data(), cp_bytes.size()));
cereal::CarParams::Reader CP = cmsg.getRoot<cereal::CarParams>();

const QString alpha_long_description = QString("<b>%1</b><br><br>%2")
.arg(tr("WARNING: openpilot longitudinal control is in alpha for this car and will disable Automatic Emergency Braking (AEB)."))
.arg(tr("On this car, openpilot defaults to the car's built-in ACC instead of openpilot's longitudinal control. "
"Enable this to switch to openpilot longitudinal control. Enabling Experimental mode is recommended when enabling openpilot longitudinal control alpha."));
alphaLongToggle->setDescription("<b>" + alpha_long_description + "</b>");

if (!CP.getExperimentalLongitudinalAvailable() && !CP.getOpenpilotLongitudinalControl()) {
params.remove("ExperimentalLongitudinalEnabled");
alphaLongToggle->setEnabled(false);
alphaLongToggle->setDescription("<b>" + tr("openpilot longitudinal control may come in a future update.") + "</b>");
}

// if is a release branch or if the car already have long control the alphaLongToggle should not be visible
if (is_release || CP.getOpenpilotLongitudinalControl()) {
params.remove("ExperimentalLongitudinalEnabled");
alphaLongToggle->setVisible(false);
AlexandreSato marked this conversation as resolved.
Show resolved Hide resolved
}

alphaLongToggle->refresh();
longManeuverToggle->setEnabled(hasLongitudinalControl(CP) && _offroad);
} else {
alphaLongToggle->setVisible(false);
longManeuverToggle->setEnabled(false);
}

Expand Down
2 changes: 2 additions & 0 deletions selfdrive/ui/qt/offroad/developer_panel.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ class DeveloperPanel : public ListWidget {
Params params;
ParamControl* joystickToggle;
ParamControl* longManeuverToggle;
ParamControl* alphaLongToggle;

bool is_release;
bool offroad;

Expand Down
17 changes: 0 additions & 17 deletions selfdrive/ui/qt/offroad/settings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,6 @@ TogglesPanel::TogglesPanel(SettingsWindow *parent) : ListWidget(parent) {
tr("Use the openpilot system for adaptive cruise control and lane keep driver assistance. Your attention is required at all times to use this feature. Changing this setting takes effect when the car is powered off."),
"../assets/img_chffr_wheel.png",
},
{
"ExperimentalLongitudinalEnabled",
tr("openpilot Longitudinal Control (Alpha)"),
QString("<b>%1</b><br><br>%2")
.arg(tr("WARNING: openpilot longitudinal control is in alpha for this car and will disable Automatic Emergency Braking (AEB)."))
.arg(tr("On this car, openpilot defaults to the car's built-in ACC instead of openpilot's longitudinal control. "
"Enable this to switch to openpilot longitudinal control. Enabling Experimental mode is recommended when enabling openpilot longitudinal control alpha.")),
"../assets/offroad/icon_speed_limit.png",
},
{
"ExperimentalMode",
tr("Experimental Mode"),
Expand Down Expand Up @@ -102,11 +93,6 @@ TogglesPanel::TogglesPanel(SettingsWindow *parent) : ListWidget(parent) {
// Toggles with confirmation dialogs
toggles["ExperimentalMode"]->setActiveIcon("../assets/img_experimental.svg");
toggles["ExperimentalMode"]->setConfirmation(true, true);
toggles["ExperimentalLongitudinalEnabled"]->setConfirmation(true, false);

connect(toggles["ExperimentalLongitudinalEnabled"], &ToggleControl::toggleFlipped, [=]() {
updateToggles();
});
}

void TogglesPanel::updateState(const UIState &s) {
Expand All @@ -131,7 +117,6 @@ void TogglesPanel::showEvent(QShowEvent *event) {

void TogglesPanel::updateToggles() {
auto experimental_mode_toggle = toggles["ExperimentalMode"];
auto op_long_toggle = toggles["ExperimentalLongitudinalEnabled"];
const QString e2e_description = QString("%1<br>"
"<h4>%2</h4><br>"
"%3<br>"
Expand All @@ -155,7 +140,6 @@ void TogglesPanel::updateToggles() {
if (!CP.getExperimentalLongitudinalAvailable() || is_release) {
params.remove("ExperimentalLongitudinalEnabled");
}
op_long_toggle->setVisible(CP.getExperimentalLongitudinalAvailable() && !is_release);
if (hasLongitudinalControl(CP)) {
// normal description and toggle
experimental_mode_toggle->setEnabled(true);
Expand Down Expand Up @@ -184,7 +168,6 @@ void TogglesPanel::updateToggles() {
experimental_mode_toggle->refresh();
} else {
experimental_mode_toggle->setDescription(e2e_description);
op_long_toggle->setVisible(false);
}
}

Expand Down
28 changes: 16 additions & 12 deletions selfdrive/ui/translations/main_ar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,22 @@
<source>Longitudinal Maneuver Mode</source>
<translation>وضع المناورة الطولية</translation>
</message>
<message>
<source>openpilot Longitudinal Control (Alpha)</source>
<translation type="unfinished">التحكم الطولي openpilot (ألفا)</translation>
</message>
<message>
<source>WARNING: openpilot longitudinal control is in alpha for this car and will disable Automatic Emergency Braking (AEB).</source>
<translation type="unfinished">تحذير: التحكم الطولي في openpilot في المرحلة ألفا لهذه السيارة، وسيقوم بتعطيل مكابح الطوارئ الآلية (AEB).</translation>
</message>
<message>
<source>On this car, openpilot defaults to the car&apos;s built-in ACC instead of openpilot&apos;s longitudinal control. Enable this to switch to openpilot longitudinal control. Enabling Experimental mode is recommended when enabling openpilot longitudinal control alpha.</source>
<translation type="unfinished">في هذه السيارة يعمل openpilot افتراضياً بالشكل المدمج في التحكم التكيفي في السرعة بدلاً من التحكم الطولي. قم بتمكين هذا الخيار من أجل الانتقال إلى التحكم الطولي. يوصى بتمكين الوضع التجريبي عند استخدام وضع التحكم الطولي ألفا من openpilot.</translation>
</message>
<message>
<source>openpilot longitudinal control may come in a future update.</source>
<translation type="unfinished">قد يتم الحصول على التحكم الطولي في openpilot في عمليات التحديث المستقبلية.</translation>
</message>
</context>
<context>
<name>DevicePanel</name>
Expand Down Expand Up @@ -1001,18 +1017,6 @@ This may take up to a minute.</source>
<source>When enabled, pressing the accelerator pedal will disengage openpilot.</source>
<translation>عند تمكين هذه الميزة، فإن الضغط على دواسة الوقود سيؤدي إلى فك ارتباط openpilot.</translation>
</message>
<message>
<source>openpilot Longitudinal Control (Alpha)</source>
<translation>التحكم الطولي openpilot (ألفا)</translation>
</message>
<message>
<source>WARNING: openpilot longitudinal control is in alpha for this car and will disable Automatic Emergency Braking (AEB).</source>
<translation>تحذير: التحكم الطولي في openpilot في المرحلة ألفا لهذه السيارة، وسيقوم بتعطيل مكابح الطوارئ الآلية (AEB).</translation>
</message>
<message>
<source>On this car, openpilot defaults to the car&apos;s built-in ACC instead of openpilot&apos;s longitudinal control. Enable this to switch to openpilot longitudinal control. Enabling Experimental mode is recommended when enabling openpilot longitudinal control alpha.</source>
<translation>في هذه السيارة يعمل openpilot افتراضياً بالشكل المدمج في التحكم التكيفي في السرعة بدلاً من التحكم الطولي. قم بتمكين هذا الخيار من أجل الانتقال إلى التحكم الطولي. يوصى بتمكين الوضع التجريبي عند استخدام وضع التحكم الطولي ألفا من openpilot.</translation>
</message>
<message>
<source>Experimental Mode</source>
<translation>الوضع التجريبي</translation>
Expand Down
28 changes: 16 additions & 12 deletions selfdrive/ui/translations/main_de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,22 @@
<source>Longitudinal Maneuver Mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>openpilot Longitudinal Control (Alpha)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>WARNING: openpilot longitudinal control is in alpha for this car and will disable Automatic Emergency Braking (AEB).</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>On this car, openpilot defaults to the car&apos;s built-in ACC instead of openpilot&apos;s longitudinal control. Enable this to switch to openpilot longitudinal control. Enabling Experimental mode is recommended when enabling openpilot longitudinal control alpha.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>openpilot longitudinal control may come in a future update.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DevicePanel</name>
Expand Down Expand Up @@ -1005,14 +1021,6 @@ This may take up to a minute.</source>
<source>Experimental mode is currently unavailable on this car since the car&apos;s stock ACC is used for longitudinal control.</source>
<translation>Der experimentelle Modus ist momentan für dieses Auto nicht verfügbar da es den eingebauten adaptiven Tempomaten des Autos benutzt.</translation>
</message>
<message>
<source>openpilot Longitudinal Control (Alpha)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>WARNING: openpilot longitudinal control is in alpha for this car and will disable Automatic Emergency Braking (AEB).</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Aggressive</source>
<translation type="unfinished"></translation>
Expand All @@ -1029,10 +1037,6 @@ This may take up to a minute.</source>
<source>Driving Personality</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>On this car, openpilot defaults to the car&apos;s built-in ACC instead of openpilot&apos;s longitudinal control. Enable this to switch to openpilot longitudinal control. Enabling Experimental mode is recommended when enabling openpilot longitudinal control alpha.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>End-to-End Longitudinal Control</source>
<translation type="unfinished"></translation>
Expand Down
28 changes: 16 additions & 12 deletions selfdrive/ui/translations/main_es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,22 @@
<source>Longitudinal Maneuver Mode</source>
<translation>Modo de maniobra longitudinal</translation>
</message>
<message>
<source>openpilot Longitudinal Control (Alpha)</source>
<translation type="unfinished">Control longitudinal de openpilot (fase experimental)</translation>
</message>
<message>
<source>WARNING: openpilot longitudinal control is in alpha for this car and will disable Automatic Emergency Braking (AEB).</source>
<translation type="unfinished">AVISO: el control longitudinal de openpilot está en fase experimental para este automóvil y desactivará el Frenado Automático de Emergencia (AEB).</translation>
</message>
<message>
<source>On this car, openpilot defaults to the car&apos;s built-in ACC instead of openpilot&apos;s longitudinal control. Enable this to switch to openpilot longitudinal control. Enabling Experimental mode is recommended when enabling openpilot longitudinal control alpha.</source>
<translation type="unfinished">En este automóvil, openpilot se configura de manera predeterminada con el Autocrucero Adaptativo (ACC) incorporado en el automóvil en lugar del control longitudinal de openpilot. Habilita esta opción para cambiar al control longitudinal de openpilot. Se recomienda activar el modo experimental al habilitar el control longitudinal de openpilot (aún en fase experimental).</translation>
</message>
<message>
<source>openpilot longitudinal control may come in a future update.</source>
<translation type="unfinished">El control longitudinal de openpilot podrá llegar en futuras actualizaciones.</translation>
</message>
</context>
<context>
<name>DevicePanel</name>
Expand Down Expand Up @@ -953,18 +969,6 @@ Esto puede tardar un minuto.</translation>
<source>Use the openpilot system for adaptive cruise control and lane keep driver assistance. Your attention is required at all times to use this feature. Changing this setting takes effect when the car is powered off.</source>
<translation>Utilice el sistema openpilot para acceder a un autocrucero adaptativo y asistencia al conductor para mantenerse en el carril. Se requiere su atención en todo momento para utilizar esta función. Cambiar esta configuración solo tendrá efecto con el auto apagado.</translation>
</message>
<message>
<source>openpilot Longitudinal Control (Alpha)</source>
<translation>Control longitudinal de openpilot (fase experimental)</translation>
</message>
<message>
<source>WARNING: openpilot longitudinal control is in alpha for this car and will disable Automatic Emergency Braking (AEB).</source>
<translation>AVISO: el control longitudinal de openpilot está en fase experimental para este automóvil y desactivará el Frenado Automático de Emergencia (AEB).</translation>
</message>
<message>
<source>On this car, openpilot defaults to the car&apos;s built-in ACC instead of openpilot&apos;s longitudinal control. Enable this to switch to openpilot longitudinal control. Enabling Experimental mode is recommended when enabling openpilot longitudinal control alpha.</source>
<translation>En este automóvil, openpilot se configura de manera predeterminada con el Autocrucero Adaptativo (ACC) incorporado en el automóvil en lugar del control longitudinal de openpilot. Habilita esta opción para cambiar al control longitudinal de openpilot. Se recomienda activar el modo experimental al habilitar el control longitudinal de openpilot (aún en fase experimental).</translation>
</message>
<message>
<source>Experimental Mode</source>
<translation>Modo Experimental</translation>
Expand Down
28 changes: 16 additions & 12 deletions selfdrive/ui/translations/main_fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,22 @@
<source>Longitudinal Maneuver Mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>openpilot Longitudinal Control (Alpha)</source>
<translation type="unfinished">Contrôle longitudinal openpilot (Alpha)</translation>
</message>
<message>
<source>WARNING: openpilot longitudinal control is in alpha for this car and will disable Automatic Emergency Braking (AEB).</source>
<translation type="unfinished">ATTENTION : le contrôle longitudinal openpilot est en alpha pour cette voiture et désactivera le freinage d&apos;urgence automatique (AEB).</translation>
</message>
<message>
<source>On this car, openpilot defaults to the car&apos;s built-in ACC instead of openpilot&apos;s longitudinal control. Enable this to switch to openpilot longitudinal control. Enabling Experimental mode is recommended when enabling openpilot longitudinal control alpha.</source>
<translation type="unfinished">Sur cette voiture, openpilot utilise par défaut le régulateur de vitesse adaptatif intégré à la voiture plutôt que le contrôle longitudinal d&apos;openpilot. Activez ceci pour passer au contrôle longitudinal openpilot. Il est recommandé d&apos;activer le mode expérimental lors de l&apos;activation du contrôle longitudinal openpilot alpha.</translation>
</message>
<message>
<source>openpilot longitudinal control may come in a future update.</source>
<translation type="unfinished">Le contrôle longitudinal openpilot pourrait être disponible dans une future mise à jour.</translation>
</message>
</context>
<context>
<name>DevicePanel</name>
Expand Down Expand Up @@ -953,18 +969,6 @@ Cela peut prendre jusqu&apos;à une minute.</translation>
<source>Use the openpilot system for adaptive cruise control and lane keep driver assistance. Your attention is required at all times to use this feature. Changing this setting takes effect when the car is powered off.</source>
<translation>Utilisez le système openpilot pour le régulateur de vitesse adaptatif et l&apos;assistance au maintien de voie. Votre attention est requise en permanence pour utiliser cette fonctionnalité. La modification de ce paramètre prend effet lorsque la voiture est éteinte.</translation>
</message>
<message>
<source>openpilot Longitudinal Control (Alpha)</source>
<translation>Contrôle longitudinal openpilot (Alpha)</translation>
</message>
<message>
<source>WARNING: openpilot longitudinal control is in alpha for this car and will disable Automatic Emergency Braking (AEB).</source>
<translation>ATTENTION : le contrôle longitudinal openpilot est en alpha pour cette voiture et désactivera le freinage d&apos;urgence automatique (AEB).</translation>
</message>
<message>
<source>On this car, openpilot defaults to the car&apos;s built-in ACC instead of openpilot&apos;s longitudinal control. Enable this to switch to openpilot longitudinal control. Enabling Experimental mode is recommended when enabling openpilot longitudinal control alpha.</source>
<translation>Sur cette voiture, openpilot utilise par défaut le régulateur de vitesse adaptatif intégré à la voiture plutôt que le contrôle longitudinal d&apos;openpilot. Activez ceci pour passer au contrôle longitudinal openpilot. Il est recommandé d&apos;activer le mode expérimental lors de l&apos;activation du contrôle longitudinal openpilot alpha.</translation>
</message>
<message>
<source>Experimental Mode</source>
<translation>Mode expérimental</translation>
Expand Down
Loading
Loading