From c258e9d64a6d1b1746647b2c42054394df42f2e3 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Mon, 17 Jul 2023 21:18:18 -0700 Subject: [PATCH] experimental mode: gate nav (#29007) * first draft copy, needs updates * gate behind exp mode * can be one line * this is no longer true * toggle isn't just e2e long now, rename * don't enable/disable * kinda works! * remove old giant qstring * comment clean up * similar breakpoint * more clean up * fixup onroad * preserve planner behavior, and we don't need to look at confirmed param if we're onroad * update translations * vanish translations * use scene for op long * lowercase! * updated copy * need to check longitudinal here now too * clean up! * here is better * used * no nav emoji * don't check param if not valid * revert this revert this * ed * revert experimental mode longitudinal checks (still need to revert toggle change) * revert * logic works * revert test * fix * update translation * fix (reset and update) old-commit-hash: 6bc28fc7698415e41610ddd04bb3ce473870591e --- selfdrive/modeld/modeld.cc | 7 +++++-- selfdrive/ui/qt/offroad/settings.cc | 7 ++++++- selfdrive/ui/translations/main_de.ts | 8 ++++++++ selfdrive/ui/translations/main_ja.ts | 8 ++++++++ selfdrive/ui/translations/main_ko.ts | 8 ++++++++ selfdrive/ui/translations/main_pt-BR.ts | 8 ++++++++ selfdrive/ui/translations/main_zh-CHS.ts | 8 ++++++++ selfdrive/ui/translations/main_zh-CHT.ts | 8 ++++++++ 8 files changed, 59 insertions(+), 3 deletions(-) diff --git a/selfdrive/modeld/modeld.cc b/selfdrive/modeld/modeld.cc index 4239f7fa64..1203704013 100644 --- a/selfdrive/modeld/modeld.cc +++ b/selfdrive/modeld/modeld.cc @@ -62,6 +62,8 @@ 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); @@ -140,9 +142,10 @@ 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); - if (!nav_enabled && nav_valid) { + bool use_nav = nav_valid && params.getBool("ExperimentalMode"); + if (!nav_enabled && use_nav) { nav_enabled = true; - } else if (nav_enabled && !nav_valid) { + } else if (nav_enabled && !use_nav) { 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 ec2d74e347..84e9796703 100644 --- a/selfdrive/ui/qt/offroad/settings.cc +++ b/selfdrive/ui/qt/offroad/settings.cc @@ -131,11 +131,16 @@ void TogglesPanel::updateToggles() { "

%2


" "%3
" "

%4


" - "%5") + "%5
" + "

%6


" + "%7") .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("Navigate on openpilot")) + .arg(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.")) .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.")); diff --git a/selfdrive/ui/translations/main_de.ts b/selfdrive/ui/translations/main_de.ts index 856de32aef..efec981a87 100644 --- a/selfdrive/ui/translations/main_de.ts +++ b/selfdrive/ui/translations/main_de.ts @@ -1131,6 +1131,14 @@ This may take up to a minute. An alpha version of openpilot longitudinal control can be tested, along with Experimental mode, on non-release branches. + + Navigate on openpilot + + + + 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. + + Updater diff --git a/selfdrive/ui/translations/main_ja.ts b/selfdrive/ui/translations/main_ja.ts index e73455b6b6..388b9cd3de 100644 --- a/selfdrive/ui/translations/main_ja.ts +++ b/selfdrive/ui/translations/main_ja.ts @@ -1123,6 +1123,14 @@ This may take up to a minute. An alpha version of openpilot longitudinal control can be tested, along with Experimental mode, on non-release branches. + + Navigate on openpilot + + + + 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. + + Updater diff --git a/selfdrive/ui/translations/main_ko.ts b/selfdrive/ui/translations/main_ko.ts index 74c63c61f3..16ff197d24 100644 --- a/selfdrive/ui/translations/main_ko.ts +++ b/selfdrive/ui/translations/main_ko.ts @@ -1125,6 +1125,14 @@ This may take up to a minute. An alpha version of openpilot longitudinal control can be tested, along with Experimental mode, on non-release branches. openpilot 롱컨 제어의 알파 버전은 비 릴리스 분기에서 실험 모드와 함께 테스트할 수 있습니다. + + Navigate on openpilot + + + + 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. + + Updater diff --git a/selfdrive/ui/translations/main_pt-BR.ts b/selfdrive/ui/translations/main_pt-BR.ts index 7d13c8b40d..bbc9318610 100644 --- a/selfdrive/ui/translations/main_pt-BR.ts +++ b/selfdrive/ui/translations/main_pt-BR.ts @@ -1129,6 +1129,14 @@ Isso pode levar até um minuto. 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. + + Navigate on openpilot + + + + 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. + + Updater diff --git a/selfdrive/ui/translations/main_zh-CHS.ts b/selfdrive/ui/translations/main_zh-CHS.ts index f994190ae0..95ba592477 100644 --- a/selfdrive/ui/translations/main_zh-CHS.ts +++ b/selfdrive/ui/translations/main_zh-CHS.ts @@ -1123,6 +1123,14 @@ This may take up to a minute. An alpha version of openpilot longitudinal control can be tested, along with Experimental mode, on non-release branches. + + Navigate on openpilot + + + + 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. + + Updater diff --git a/selfdrive/ui/translations/main_zh-CHT.ts b/selfdrive/ui/translations/main_zh-CHT.ts index 9e29d3c247..70de5659ed 100644 --- a/selfdrive/ui/translations/main_zh-CHT.ts +++ b/selfdrive/ui/translations/main_zh-CHT.ts @@ -1125,6 +1125,14 @@ This may take up to a minute. An alpha version of openpilot longitudinal control can be tested, along with Experimental mode, on non-release branches. 在正式 (release) 版以外的分支上可以測試 openpilot 縱向控制的 Alpha 版本,以及實驗模式。 + + Navigate on openpilot + + + + 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. + + Updater