Allow throttle ui: only if openpilot longitudinal (#33787)

check op long
pull/33788/head^2
Shane Smiskol 6 months ago committed by GitHub
parent abdd3ad2e9
commit fa4a3e3c63
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      selfdrive/ui/qt/onroad/model.cc
  2. 2
      selfdrive/ui/qt/onroad/model.h

@ -158,7 +158,7 @@ void ModelRenderer::updatePathGradient(QLinearGradient &bg) {
constexpr float transition_speed = 0.1f;
// Start transition if throttle state changes
bool allow_throttle = (*uiState()->sm)["longitudinalPlan"].getLongitudinalPlan().getAllowThrottle();
bool allow_throttle = (*uiState()->sm)["longitudinalPlan"].getLongitudinalPlan().getAllowThrottle() || !longitudinal_control;
if (allow_throttle != prev_allow_throttle) {
prev_allow_throttle = allow_throttle;
// Invert blend factor for a smooth transition when the state changes mid-animation

@ -26,7 +26,7 @@ private:
bool longitudinal_control = false;
bool experimental_mode = false;
float blend_factor = 1.0f;
bool prev_allow_throttle = false;
bool prev_allow_throttle = true;
float lane_line_probs[4] = {};
float road_edge_stds[2] = {};
QPolygonF track_vertices;

Loading…
Cancel
Save