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: update lead's z position if modelV2 has been updated after startup. #23355

Merged
merged 2 commits into from
Jan 3, 2022
Merged
Changes from 1 commit
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/ui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ static void update_state(UIState *s) {
}
if (sm.updated("radarState")) {
std::optional<cereal::ModelDataV2::XYZTData::Reader> line;
if (sm.rcv_frame("modelV2") > 0) {
Copy link
Contributor Author

@deanlee deanlee Jan 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we added this if statement before because we encountered segfault without it. so I think it's better to keep it and make it more logically correct unless we can completely confirm that this if statement is not needed anymore

Copy link
Contributor

@adeebshihadeh adeebshihadeh Jan 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is line optional for update_leads? should we just skip the call if there is no modelV2 yet? maybe this was written before the model was important for leads, I imagine now we don't want to draw any leads without the model

if (sm.rcv_frame("modelV2") >= s->scene.started_frame) {
line = sm["modelV2"].getModelV2().getPosition();
}
update_leads(s, sm["radarState"].getRadarState(), line);
Expand Down