show sat count in sidebar (#20028)
* show sat count in sidebar * fix * revert that Co-authored-by: Comma Device <device@comma.ai>
This commit is contained in:
parent
c3707328f5
commit
54b59783cb
|
@ -122,6 +122,13 @@ static void draw_panda_metric(UIState *s) {
|
||||||
panda_severity = 2;
|
panda_severity = 2;
|
||||||
panda_message = "NO\nPANDA";
|
panda_message = "NO\nPANDA";
|
||||||
}
|
}
|
||||||
|
#ifdef QCOM2
|
||||||
|
else if (s->started) {
|
||||||
|
panda_severity = s->scene.cnoAvg > 30 ? 0 : 1;
|
||||||
|
panda_message = util::string_format("SAT CNT\n%d", s->scene.satelliteCount);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
draw_metric(s, NULL, NULL, panda_severity, panda_y_offset, panda_message.c_str());
|
draw_metric(s, NULL, NULL, panda_severity, panda_y_offset, panda_message.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ static void ui_init_vision(UIState *s) {
|
||||||
|
|
||||||
void ui_init(UIState *s) {
|
void ui_init(UIState *s) {
|
||||||
s->sm = new SubMaster({"modelV2", "controlsState", "uiLayoutState", "liveCalibration", "radarState", "thermal", "frame",
|
s->sm = new SubMaster({"modelV2", "controlsState", "uiLayoutState", "liveCalibration", "radarState", "thermal", "frame",
|
||||||
"health", "carParams", "driverState", "driverMonitoringState", "sensorEvents", "carState"});
|
"health", "carParams", "driverState", "driverMonitoringState", "sensorEvents", "carState", "ubloxGnss"});
|
||||||
|
|
||||||
s->started = false;
|
s->started = false;
|
||||||
s->status = STATUS_OFFROAD;
|
s->status = STATUS_OFFROAD;
|
||||||
|
@ -161,6 +161,17 @@ static void update_sockets(UIState *s) {
|
||||||
} else if ((s->sm->frame - s->sm->rcv_frame("health")) > 5*UI_FREQ) {
|
} else if ((s->sm->frame - s->sm->rcv_frame("health")) > 5*UI_FREQ) {
|
||||||
scene.pandaType = cereal::HealthData::PandaType::UNKNOWN;
|
scene.pandaType = cereal::HealthData::PandaType::UNKNOWN;
|
||||||
}
|
}
|
||||||
|
if (sm.updated("ubloxGnss")) {
|
||||||
|
auto data = sm["ubloxGnss"].getUbloxGnss();
|
||||||
|
if (data.which() == cereal::UbloxGnss::MEASUREMENT_REPORT) {
|
||||||
|
auto measurements = data.getMeasurementReport().getMeasurements();
|
||||||
|
for (auto m : measurements) {
|
||||||
|
scene.cnoAvg += m.getCno();
|
||||||
|
}
|
||||||
|
scene.cnoAvg /= measurements.size();
|
||||||
|
scene.satelliteCount = data.getMeasurementReport().getNumMeas();
|
||||||
|
}
|
||||||
|
}
|
||||||
if (sm.updated("carParams")) {
|
if (sm.updated("carParams")) {
|
||||||
s->longitudinal_control = sm["carParams"].getCarParams().getOpenpilotLongitudinalControl();
|
s->longitudinal_control = sm["carParams"].getCarParams().getOpenpilotLongitudinalControl();
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,6 +125,10 @@ typedef struct UIScene {
|
||||||
cereal::DriverState::Reader driver_state;
|
cereal::DriverState::Reader driver_state;
|
||||||
cereal::DriverMonitoringState::Reader dmonitoring_state;
|
cereal::DriverMonitoringState::Reader dmonitoring_state;
|
||||||
|
|
||||||
|
// gps
|
||||||
|
int satelliteCount;
|
||||||
|
int cnoAvg;
|
||||||
|
|
||||||
// modelV2
|
// modelV2
|
||||||
float lane_line_probs[4];
|
float lane_line_probs[4];
|
||||||
float road_edge_stds[2];
|
float road_edge_stds[2];
|
||||||
|
|
Loading…
Reference in a new issue