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

check op long
This commit is contained in:
Shane Smiskol
2024-10-14 14:12:33 -07:00
committed by GitHub
parent abdd3ad2e9
commit fa4a3e3c63
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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;