Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui: remove variable world_objects_visible, use rcv_frame #23264

Merged
merged 1 commit into from
Dec 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion selfdrive/ui/qt/onroad.cc
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ void NvgWindow::paintGL() {
CameraViewWidget::paintGL();

UIState *s = uiState();
if (s->scene.world_objects_visible) {
if (s->worldObjectsVisible()) {
QPainter painter(this);
painter.setRenderHint(QPainter::Antialiasing);
painter.setPen(Qt::NoPen);
Expand Down
3 changes: 0 additions & 3 deletions selfdrive/ui/ui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ static void update_state(UIState *s) {
update_leads(s, sm["radarState"].getRadarState(), line);
}
if (sm.updated("liveCalibration")) {
scene.world_objects_visible = true;
auto rpy_list = sm["liveCalibration"].getLiveCalibration().getRpyCalib();
Eigen::Vector3d rpy;
rpy << rpy_list[0], rpy_list[1], rpy_list[2];
Expand Down Expand Up @@ -211,8 +210,6 @@ static void update_status(UIState *s) {
s->scene.end_to_end = Params().getBool("EndToEndToggle");
s->wide_camera = Hardware::TICI() ? Params().getBool("EnableWideCamera") : false;
}
// Invisible until we receive a calibration message.
s->scene.world_objects_visible = false;
}
started_prev = s->scene.started;
}
Expand Down
5 changes: 3 additions & 2 deletions selfdrive/ui/ui.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ typedef struct {

typedef struct UIScene {
mat3 view_from_calib;
bool world_objects_visible;

cereal::PandaState::PandaType pandaType;

// modelV2
Expand All @@ -106,6 +104,9 @@ class UIState : public QObject {

public:
UIState(QObject* parent = 0);
inline bool worldObjectsVisible() const {
return sm->rcv_frame("liveCalibration") > scene.started_frame;
};

int fb_w = 0, fb_h = 0;

Expand Down