Skip to content

Commit

Permalink
use prediction resolution as rounding multiplier
Browse files Browse the repository at this point in the history
Signed-off-by: Muhammad Zulfaqar <zulfaqar.azmi@tier4.jp>
  • Loading branch information
zulfaqar-azmi-t4 committed Jan 24, 2023
1 parent ece5ba3 commit 6e7f8e0
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,11 @@ std::optional<LaneChangePath> constructCandidatePath(
prepare_distance / std::max(lane_change_param.minimum_lane_change_velocity, speed.prepare);
return std::min(duration, lane_change_param.lane_change_prepare_duration);
});
candidate_path.duration.lane_changing =
std::round((lane_change_distance / lane_changing_speed) * 2.0) / 2.0;
candidate_path.duration.lane_changing = std::invoke([&]() {
const auto rounding_multiplier = 1.0 / lane_change_param.prediction_time_resolution;
return std::ceil((lane_change_distance / lane_changing_speed) * rounding_multiplier) /
rounding_multiplier;
});
candidate_path.shift_line = shift_line;
candidate_path.reference_lanelets = original_lanelets;
candidate_path.target_lanelets = target_lanelets;
Expand Down

0 comments on commit 6e7f8e0

Please sign in to comment.