diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 1eec484ff9..38378757e8 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -134,6 +134,8 @@ class Controls: # cleanup old params if not self.CP.experimentalLongitudinalAvailable or is_release_branch(): self.params.remove("ExperimentalLongitudinalEnabled") + if not self.CP.openpilotLongitudinalControl: + self.params.remove("ExperimentalMode") self.CC = car.CarControl.new_message() self.CS_prev = car.CarState.new_message() @@ -843,7 +845,7 @@ class Controls: self.prof.checkpoint("Ratekeeper", ignore=True) self.is_metric = self.params.get_bool("IsMetric") - self.experimental_mode = self.params.get_bool("ExperimentalMode") + self.experimental_mode = self.params.get_bool("ExperimentalMode") and self.CP.openpilotLongitudinalControl # Sample data from sockets and get a carState CS = self.data_sample() diff --git a/selfdrive/controls/lib/drive_helpers.py b/selfdrive/controls/lib/drive_helpers.py index 7bcfde2787..7cbcbc3d49 100644 --- a/selfdrive/controls/lib/drive_helpers.py +++ b/selfdrive/controls/lib/drive_helpers.py @@ -132,7 +132,7 @@ class VCruiseHelper: if self.CP.pcmCruise: return - initial = V_CRUISE_INITIAL_EXPERIMENTAL_MODE if experimental_mode and self.CP.openpilotLongitudinalControl else V_CRUISE_INITIAL + initial = V_CRUISE_INITIAL_EXPERIMENTAL_MODE if experimental_mode else V_CRUISE_INITIAL # 250kph or above probably means we never had a set speed if any(b.type in (ButtonType.accelCruise, ButtonType.resumeCruise) for b in CS.buttonEvents) and self.v_cruise_kph_last < 250: diff --git a/selfdrive/controls/lib/longitudinal_planner.py b/selfdrive/controls/lib/longitudinal_planner.py index 6e990bd989..a9c3cc7804 100755 --- a/selfdrive/controls/lib/longitudinal_planner.py +++ b/selfdrive/controls/lib/longitudinal_planner.py @@ -90,7 +90,7 @@ class LongitudinalPlanner: if self.param_read_counter % 50 == 0: self.read_param() self.param_read_counter += 1 - self.mpc.mode = 'blended' if sm['controlsState'].experimentalMode and self.CP.openpilotLongitudinalControl else 'acc' + self.mpc.mode = 'blended' if sm['controlsState'].experimentalMode else 'acc' v_ego = sm['carState'].vEgo v_cruise_kph = sm['controlsState'].vCruise diff --git a/selfdrive/modeld/modeld.cc b/selfdrive/modeld/modeld.cc index 1203704013..4239f7fa64 100644 --- a/selfdrive/modeld/modeld.cc +++ b/selfdrive/modeld/modeld.cc @@ -62,8 +62,6 @@ void run_model(ModelState &model, VisionIpcClient &vipc_client_main, VisionIpcCl PubMaster pm({"modelV2", "cameraOdometry"}); SubMaster sm({"lateralPlan", "roadCameraState", "liveCalibration", "driverMonitoringState", "navModel"}); - Params params; - // setup filter to track dropped frames FirstOrderFilter frame_dropped_filter(0., 10., 1. / MODEL_FREQ); @@ -142,10 +140,9 @@ void run_model(ModelState &model, VisionIpcClient &vipc_client_main, VisionIpcCl // Enable/disable nav features uint64_t timestamp_llk = sm["navModel"].getNavModel().getLocationMonoTime(); bool nav_valid = sm["navModel"].getValid() && (nanos_since_boot() - timestamp_llk < 1e9); - bool use_nav = nav_valid && params.getBool("ExperimentalMode"); - if (!nav_enabled && use_nav) { + if (!nav_enabled && nav_valid) { nav_enabled = true; - } else if (nav_enabled && !use_nav) { + } else if (nav_enabled && !nav_valid) { memset(nav_features, 0, sizeof(float)*NAV_FEATURE_LEN); nav_enabled = false; } diff --git a/selfdrive/ui/qt/offroad/settings.cc b/selfdrive/ui/qt/offroad/settings.cc index f39cac0c2c..6b8ca4c5d4 100644 --- a/selfdrive/ui/qt/offroad/settings.cc +++ b/selfdrive/ui/qt/offroad/settings.cc @@ -125,22 +125,19 @@ void TogglesPanel::showEvent(QShowEvent *event) { } void TogglesPanel::updateToggles() { - auto experimental_mode_toggle = toggles["ExperimentalMode"]; + auto e2e_toggle = toggles["ExperimentalMode"]; auto op_long_toggle = toggles["ExperimentalLongitudinalEnabled"]; - - QMap exp_features; - exp_features["e2e_long"] = tr("Let the driving model control the gas and brakes. openpilot will drive as it thinks a human would, including stopping for red lights and stop signs. " - "Since the driving model decides the speed to drive, the set speed will only act as an upper bound. This is an alpha quality feature; mistakes should be expected."); - exp_features["nav_on_op"] = tr("When navigation has a destination, openpilot will input the map information into the model. This generally improves behavior and allows openpilot to keep left or right appropriately at forks/exits and take turns. " - "Lane change behavior is unchanged and still activated by the driver. This is an alpha quality feature; mistakes should be expected."); - exp_features["visualization"] = tr("The driving visualization will transition to the road-facing wide-angle camera at low speeds to better show some turns. The Experimental mode logo will also be shown in the top right corner."); - - // Ordering of the headers - QVector> exp_features_headers { - {"e2e_long", tr("🌮 End-to-End Longitudinal Control 🌮")}, - {"nav_on_op", tr("Navigate on openpilot")}, - {"visualization", tr("New Driving Visualization")} - }; + const QString e2e_description = QString("%1
" + "

%2


" + "%3
" + "

%4


" + "%5") + .arg(tr("openpilot defaults to driving in chill mode. Experimental mode enables alpha-level features that aren't ready for chill mode. Experimental features are listed below:")) + .arg(tr("🌮 End-to-End Longitudinal Control 🌮")) + .arg(tr("Let the driving model control the gas and brakes. openpilot will drive as it thinks a human would, including stopping for red lights and stop signs. " + "Since the driving model decides the speed to drive, the set speed will only act as an upper bound. This is an alpha quality feature; mistakes should be expected.")) + .arg(tr("New Driving Visualization")) + .arg(tr("The driving visualization will transition to the road-facing wide-angle camera at low speeds to better show some turns. The Experimental mode logo will also be shown in the top right corner.")); const bool is_release = params.getBool("IsReleaseBranch"); auto cp_bytes = params.get("CarParamsPersistent"); @@ -155,35 +152,34 @@ void TogglesPanel::updateToggles() { op_long_toggle->setVisible(CP.getExperimentalLongitudinalAvailable() && !is_release); if (hasLongitudinalControl(CP)) { // normal description and toggle + e2e_toggle->setEnabled(true); + e2e_toggle->setDescription(e2e_description); long_personality_setting->setEnabled(true); } else { // no long for now + e2e_toggle->setEnabled(false); long_personality_setting->setEnabled(false); + params.remove("ExperimentalMode"); - // prepended note that end-to-end longitudinal control will not be used - const QString unavailable = tr("End-to-End Longitudinal Control is currently unavailable on this car since the car's stock ACC is used for longitudinal control."); + const QString unavailable = tr("Experimental mode is currently unavailable on this car since the car's stock ACC is used for longitudinal control."); QString long_desc = unavailable + " " + \ tr("openpilot longitudinal control may come in a future update."); if (CP.getExperimentalLongitudinalAvailable()) { if (is_release) { - long_desc = unavailable + " " + tr("An alpha version of openpilot longitudinal control can be tested, along with End-to-End Longitudinal Control, on non-release branches."); + long_desc = unavailable + " " + tr("An alpha version of openpilot longitudinal control can be tested, along with Experimental mode, on non-release branches."); } else { - long_desc = tr("Enable experimental longitudinal control to use End-to-End Longitudinal Control."); + long_desc = tr("Enable experimental longitudinal control to allow Experimental mode."); } } - exp_features["e2e_long"].prepend("" + long_desc + "

"); + e2e_toggle->setDescription("" + long_desc + "

" + e2e_description); } + + e2e_toggle->refresh(); } else { + e2e_toggle->setDescription(e2e_description); op_long_toggle->setVisible(false); } - - // set experimental mode toggle description - QString e2e_description = tr("openpilot defaults to driving in chill mode. Experimental mode enables alpha-level features that aren't ready for chill mode. Experimental features are listed below:") + "
"; - for (const auto& kv : exp_features_headers) { - e2e_description += QString("

%1


%2
").arg(kv.second).arg(exp_features.value(kv.first)); - } - experimental_mode_toggle->setDescription(e2e_description); } DevicePanel::DevicePanel(SettingsWindow *parent) : ListWidget(parent) { diff --git a/selfdrive/ui/qt/onroad.cc b/selfdrive/ui/qt/onroad.cc index 4c936b2125..ef711afd50 100644 --- a/selfdrive/ui/qt/onroad.cc +++ b/selfdrive/ui/qt/onroad.cc @@ -188,7 +188,9 @@ ExperimentalButton::ExperimentalButton(QWidget *parent) : experimental_mode(fals } void ExperimentalButton::changeMode() { - if (params.getBool("ExperimentalModeConfirmed")) { + const auto cp = (*uiState()->sm)["carParams"].getCarParams(); + bool can_change = hasLongitudinalControl(cp) && params.getBool("ExperimentalModeConfirmed"); + if (can_change) { params.putBool("ExperimentalMode", !experimental_mode); } } @@ -452,10 +454,8 @@ void AnnotatedCameraWidget::drawLaneLines(QPainter &painter, const UIState *s) { } // paint path - const bool show_e2e_path = (sm["controlsState"].getControlsState().getExperimentalMode() && - scene.longitudinal_control); QLinearGradient bg(0, height(), 0, 0); - if (show_e2e_path) { + if (sm["controlsState"].getControlsState().getExperimentalMode()) { // The first half of track_vertices are the points for the right side of the path // and the indices match the positions of accel from uiPlan const auto &acceleration = sm["uiPlan"].getUiPlan().getAccel(); diff --git a/selfdrive/ui/translations/main_de.ts b/selfdrive/ui/translations/main_de.ts index d1cd7aebb3..856de32aef 100644 --- a/selfdrive/ui/translations/main_de.ts +++ b/selfdrive/ui/translations/main_de.ts @@ -1083,10 +1083,18 @@ This may take up to a minute. The driving visualization will transition to the road-facing wide-angle camera at low speeds to better show some turns. The Experimental mode logo will also be shown in the top right corner. Die Fahrvisualisierung wechselt bei niedrigen Geschwindigkeiten zur Straßengewandten Weitwinkelkamera, um manche Kurven besser zu zeigen. Außerdem wird das Experimenteller Modus logo oben rechts angezeigt. + + Experimental mode is currently unavailable on this car since the car's stock ACC is used for longitudinal control. + Der experimentelle Modus ist momentan für dieses Auto nicht verfügbar da es den eingebauten adaptiven Tempomaten des Autos benutzt. + openpilot longitudinal control may come in a future update. + + Enable experimental longitudinal control to allow Experimental mode. + Aktiviere den experimentellen Openpilot Tempomaten für experimentelle Funktionen. + openpilot Longitudinal Control (Alpha) @@ -1120,23 +1128,7 @@ This may take up to a minute. - End-to-End Longitudinal Control is currently unavailable on this car since the car's stock ACC is used for longitudinal control. - - - - An alpha version of openpilot longitudinal control can be tested, along with End-to-End Longitudinal Control, on non-release branches. - - - - Enable experimental longitudinal control to use End-to-End Longitudinal Control. - - - - When navigation has a destination, openpilot will input the map information into the model. This generally improves behavior and allows openpilot to keep left or right appropriately at forks/exits and take turns. Lane change behavior is unchanged and still activated by the driver. This is an alpha quality feature; mistakes should be expected. - - - - Navigate on openpilot + An alpha version of openpilot longitudinal control can be tested, along with Experimental mode, on non-release branches. diff --git a/selfdrive/ui/translations/main_ja.ts b/selfdrive/ui/translations/main_ja.ts index 9de14519e3..e73455b6b6 100644 --- a/selfdrive/ui/translations/main_ja.ts +++ b/selfdrive/ui/translations/main_ja.ts @@ -1075,10 +1075,18 @@ This may take up to a minute. The driving visualization will transition to the road-facing wide-angle camera at low speeds to better show some turns. The Experimental mode logo will also be shown in the top right corner. 新しい運転画面では、低速時に広角カメラの映像を表示することで、曲がる際の道路の視覚を向上します。実験段階を表すマークが右上に表示されます。 + + Experimental mode is currently unavailable on this car since the car's stock ACC is used for longitudinal control. + この車のACCがアクセル制御を行うため実験モードを利用することができません。 + openpilot longitudinal control may come in a future update. + + Enable experimental longitudinal control to allow Experimental mode. + 実験段階のopenpilotによるアクセル制御を有効にしてください。 + openpilot Longitudinal Control (Alpha) @@ -1112,23 +1120,7 @@ This may take up to a minute. - End-to-End Longitudinal Control is currently unavailable on this car since the car's stock ACC is used for longitudinal control. - - - - An alpha version of openpilot longitudinal control can be tested, along with End-to-End Longitudinal Control, on non-release branches. - - - - Enable experimental longitudinal control to use End-to-End Longitudinal Control. - - - - When navigation has a destination, openpilot will input the map information into the model. This generally improves behavior and allows openpilot to keep left or right appropriately at forks/exits and take turns. Lane change behavior is unchanged and still activated by the driver. This is an alpha quality feature; mistakes should be expected. - - - - Navigate on openpilot + An alpha version of openpilot longitudinal control can be tested, along with Experimental mode, on non-release branches. diff --git a/selfdrive/ui/translations/main_ko.ts b/selfdrive/ui/translations/main_ko.ts index faa2a17ce0..74c63c61f3 100644 --- a/selfdrive/ui/translations/main_ko.ts +++ b/selfdrive/ui/translations/main_ko.ts @@ -1077,10 +1077,18 @@ This may take up to a minute. The driving visualization will transition to the road-facing wide-angle camera at low speeds to better show some turns. The Experimental mode logo will also be shown in the top right corner. 주행 시각화는 저속에서 도로를 향하는 광각 카메라로 전환되어 일부 회전을 더 잘 보여줍니다. 실험적 모드의 로고도 우측상단에 표시됩니다. + + Experimental mode is currently unavailable on this car since the car's stock ACC is used for longitudinal control. + 차량에 장착된 ACC가 롱컨트롤에 사용되기 때문에 현재 이 차량은 실험적 모드를 사용할 수 없습니다. + openpilot longitudinal control may come in a future update. 오픈파일럿 롱컨트롤은 향후 업데이트에서 제공될 수 있습니다. + + Enable experimental longitudinal control to allow Experimental mode. + 실험적 롱컨트롤을 사용하려면 실험적 모드를 활성화 하세요. + openpilot Longitudinal Control (Alpha) openpilot 롱컨트롤 (알파) @@ -1114,24 +1122,8 @@ This may take up to a minute. 표준 모드를 권장합니다. 공격적 모드에서는 openpilot은 앞차를 더 가까이 따라가며 가속과 감속을 더 공격적으로 사용합니다. 편안한 모드에서 openpilot은 선두 차량에서 더 멀리 떨어져 있습니다. - End-to-End Longitudinal Control is currently unavailable on this car since the car's stock ACC is used for longitudinal control. - - - - An alpha version of openpilot longitudinal control can be tested, along with End-to-End Longitudinal Control, on non-release branches. - - - - Enable experimental longitudinal control to use End-to-End Longitudinal Control. - - - - When navigation has a destination, openpilot will input the map information into the model. This generally improves behavior and allows openpilot to keep left or right appropriately at forks/exits and take turns. Lane change behavior is unchanged and still activated by the driver. This is an alpha quality feature; mistakes should be expected. - - - - Navigate on openpilot - + An alpha version of openpilot longitudinal control can be tested, along with Experimental mode, on non-release branches. + openpilot 롱컨 제어의 알파 버전은 비 릴리스 분기에서 실험 모드와 함께 테스트할 수 있습니다. diff --git a/selfdrive/ui/translations/main_pt-BR.ts b/selfdrive/ui/translations/main_pt-BR.ts index f85601dfa2..7d13c8b40d 100644 --- a/selfdrive/ui/translations/main_pt-BR.ts +++ b/selfdrive/ui/translations/main_pt-BR.ts @@ -1081,10 +1081,18 @@ Isso pode levar até um minuto. The driving visualization will transition to the road-facing wide-angle camera at low speeds to better show some turns. The Experimental mode logo will also be shown in the top right corner. A visualização da direção fará a transição para a câmera grande angular voltada para a estrada em baixas velocidades para mostrar melhor algumas curvas. O logotipo do modo Experimental também será exibido no canto superior direito. + + Experimental mode is currently unavailable on this car since the car's stock ACC is used for longitudinal control. + O modo Experimental está atualmente indisponível para este carro já que o ACC original do carro é usado para controle longitudinal. + openpilot longitudinal control may come in a future update. O controle longitudinal openpilot poderá vir em uma atualização futura. + + Enable experimental longitudinal control to allow Experimental mode. + Ative o controle longitudinal experimental para permitir o modo Experimental. + openpilot Longitudinal Control (Alpha) Controle Longitudinal openpilot (Embrionário) @@ -1118,24 +1126,8 @@ Isso pode levar até um minuto. Neutro é o recomendado. No modo disputa o openpilot seguirá o carro da frente mais de perto e será mais agressivo com a aceleração e frenagem. No modo calmo o openpilot se manterá mais longe do carro da frente. - End-to-End Longitudinal Control is currently unavailable on this car since the car's stock ACC is used for longitudinal control. - - - - An alpha version of openpilot longitudinal control can be tested, along with End-to-End Longitudinal Control, on non-release branches. - - - - Enable experimental longitudinal control to use End-to-End Longitudinal Control. - - - - When navigation has a destination, openpilot will input the map information into the model. This generally improves behavior and allows openpilot to keep left or right appropriately at forks/exits and take turns. Lane change behavior is unchanged and still activated by the driver. This is an alpha quality feature; mistakes should be expected. - - - - Navigate on openpilot - + An alpha version of openpilot longitudinal control can be tested, along with Experimental mode, on non-release branches. + Uma versão embrionária do controle longitudinal openpilot pode ser testada em conjunto com o modo Experimental, em branches que não sejam de produção. diff --git a/selfdrive/ui/translations/main_zh-CHS.ts b/selfdrive/ui/translations/main_zh-CHS.ts index 57295b5711..f994190ae0 100644 --- a/selfdrive/ui/translations/main_zh-CHS.ts +++ b/selfdrive/ui/translations/main_zh-CHS.ts @@ -1075,10 +1075,18 @@ This may take up to a minute. The driving visualization will transition to the road-facing wide-angle camera at low speeds to better show some turns. The Experimental mode logo will also be shown in the top right corner. 当低速行驶时,驾驶视角将切换到前向广角摄像头,便于更完整地显示转向路径。右上角将显示试验模式图标。 + + Experimental mode is currently unavailable on this car since the car's stock ACC is used for longitudinal control. + 由于此车辆使用自带的ACC纵向控制,当前无法使用试验模式。 + openpilot longitudinal control may come in a future update. + + Enable experimental longitudinal control to allow Experimental mode. + 启用试验性的纵向控制,以便允许使用试验模式。 + openpilot Longitudinal Control (Alpha) @@ -1112,23 +1120,7 @@ This may take up to a minute. - End-to-End Longitudinal Control is currently unavailable on this car since the car's stock ACC is used for longitudinal control. - - - - An alpha version of openpilot longitudinal control can be tested, along with End-to-End Longitudinal Control, on non-release branches. - - - - Enable experimental longitudinal control to use End-to-End Longitudinal Control. - - - - When navigation has a destination, openpilot will input the map information into the model. This generally improves behavior and allows openpilot to keep left or right appropriately at forks/exits and take turns. Lane change behavior is unchanged and still activated by the driver. This is an alpha quality feature; mistakes should be expected. - - - - Navigate on openpilot + An alpha version of openpilot longitudinal control can be tested, along with Experimental mode, on non-release branches. diff --git a/selfdrive/ui/translations/main_zh-CHT.ts b/selfdrive/ui/translations/main_zh-CHT.ts index 42459b942f..9e29d3c247 100644 --- a/selfdrive/ui/translations/main_zh-CHT.ts +++ b/selfdrive/ui/translations/main_zh-CHT.ts @@ -1077,10 +1077,18 @@ This may take up to a minute. The driving visualization will transition to the road-facing wide-angle camera at low speeds to better show some turns. The Experimental mode logo will also be shown in the top right corner. 低速行駛時,將會切換成路側廣角鏡頭,以完整顯示轉彎路徑,右上角將出現實驗模式圖案。 + + Experimental mode is currently unavailable on this car since the car's stock ACC is used for longitudinal control. + 因車輛使用內建ACC系統,無法在本車輛上啟動實驗模式。 + openpilot longitudinal control may come in a future update. openpilot 縱向控制可能會在未來的更新中提供。 + + Enable experimental longitudinal control to allow Experimental mode. + 啟用實驗性縱向控制以使用實驗模式。 + openpilot Longitudinal Control (Alpha) openpilot 縱向控制 (Alpha 版) @@ -1114,24 +1122,8 @@ This may take up to a minute. 推薦使用標準模式。在積極模式中,openpilot 會更靠近前車並在加速和剎車方面更積極。在舒適模式中,openpilot 會與前車保持較遠的距離。 - End-to-End Longitudinal Control is currently unavailable on this car since the car's stock ACC is used for longitudinal control. - 目前這輛車無法使用端到端縱向控制,因為車輛使用原廠ACC (自適應巡航控制系統) 進行縱向控制。 - - - An alpha version of openpilot longitudinal control can be tested, along with End-to-End Longitudinal Control, on non-release branches. - 在非發佈版本的分支上,可以測試 openpilot 縱向控制的 Alpha 版本,包括端到端的縱向控制。 - - - Enable experimental longitudinal control to use End-to-End Longitudinal Control. - 啟用實驗性縱向控制以使用端到端縱向控制。 - - - When navigation has a destination, openpilot will input the map information into the model. This generally improves behavior and allows openpilot to keep left or right appropriately at forks/exits and take turns. Lane change behavior is unchanged and still activated by the driver. This is an alpha quality feature; mistakes should be expected. - 當導航有設定目的地時,openpilot 將會把地圖導航信息輸入模型。這通常會改善 openpilot 的行駛路徑使它能夠在分歧處/出口適當地靠左或靠右,並進行轉彎。車道變換行為保持不變,仍由駕駛員手動執行。這是一個 Alpha 版本的功能,請保持心理準備隨時有可能會出現錯誤。 - - - Navigate on openpilot - openpilot 自動輔助駕駛 + An alpha version of openpilot longitudinal control can be tested, along with Experimental mode, on non-release branches. + 在正式 (release) 版以外的分支上可以測試 openpilot 縱向控制的 Alpha 版本,以及實驗模式。