Skip to content

Commit

Permalink
show no SteersDes if OP disangaged (commaai#246)
Browse files Browse the repository at this point in the history
  • Loading branch information
xx979xx authored and kegman committed Dec 2, 2019
1 parent 6e0127d commit 93ada94
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion selfdrive/ui/ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -1376,6 +1376,7 @@ static void bb_ui_draw_measures_right(UIState *s, int bb_x, int bb_y, int bb_w )
char val_str[16];
char uom_str[6];
NVGcolor val_color = nvgRGBA(255, 255, 255, 200);
if (scene->engaged) {
//show Orange if more than 6 degrees
//show red if more than 12 degrees
if(((int)(scene->angleSteersDes) < -6) || ((int)(scene->angleSteersDes) > 6)) {
Expand All @@ -1386,7 +1387,9 @@ static void bb_ui_draw_measures_right(UIState *s, int bb_x, int bb_y, int bb_w )
}
// steering is in degrees
snprintf(val_str, sizeof(val_str), "%.0f°",(scene->angleSteersDes));

} else {
snprintf(val_str, sizeof(val_str), "-");
}
snprintf(uom_str, sizeof(uom_str), "");
bb_h +=bb_ui_draw_measure(s, val_str, uom_str, "DESIR STEER",
bb_rx, bb_ry, bb_uom_dx,
Expand Down

0 comments on commit 93ada94

Please sign in to comment.