mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-09 19:39:00 +08:00
ui.cc: lane lines have different x values
old-commit-hash: 1f24b1eb0f6c6b671d79744ec18168de81f46164
This commit is contained in:
+3
-1
@@ -113,10 +113,10 @@ static void update_model(UIState *s, const cereal::ModelDataV2::Reader &model) {
|
||||
const float max_distance = std::clamp(model_position.getX()[TRAJECTORY_SIZE - 1],
|
||||
MIN_DRAW_DISTANCE, MAX_DRAW_DISTANCE);
|
||||
|
||||
int max_idx = get_path_length_idx(model_position, max_distance);
|
||||
// update lane lines
|
||||
const auto lane_lines = model.getLaneLines();
|
||||
const auto lane_line_probs = model.getLaneLineProbs();
|
||||
int max_idx = get_path_length_idx(lane_lines[0], max_distance);
|
||||
for (int i = 0; i < std::size(scene.lane_line_vertices); i++) {
|
||||
scene.lane_line_probs[i] = lane_line_probs[i];
|
||||
update_line_data(s, lane_lines[i], 0.025 * scene.lane_line_probs[i], 0, &scene.lane_line_vertices[i], max_idx);
|
||||
@@ -136,6 +136,8 @@ static void update_model(UIState *s, const cereal::ModelDataV2::Reader &model) {
|
||||
const float path_length = std::clamp((float)(lead_d - fmin(lead_d * 0.35, 10.)),
|
||||
0.0f, max_distance);
|
||||
max_idx = get_path_length_idx(model_position, path_length);
|
||||
} else {
|
||||
max_idx = get_path_length_idx(model_position, max_distance);
|
||||
}
|
||||
update_line_data(s, model_position, 0.5, 1.22, &scene.track_vertices, max_idx);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user