Skip to content

Commit

Permalink
fix(behavior_path_planner): shift length path go over lane boundary (t…
Browse files Browse the repository at this point in the history
…ier4#1347)

* fix(behavior_path_planner): shift length path go over lane boundary

Signed-off-by: Muhammad Zulfaqar Azmi <zulfaqar.azmi@tier4.jp>

* rephrase logic

Co-authored-by: taikitanaka3 <65527974+taikitanaka3@users.noreply.github.com>

Co-authored-by: taikitanaka3 <65527974+taikitanaka3@users.noreply.github.com>
  • Loading branch information
2 people authored and boyali committed Sep 28, 2022
1 parent 4df8ffe commit 771fee7
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,6 @@ AvoidPointArray AvoidanceModule::calcRawShiftPointsFromObjects(
const auto & lat_collision_margin = parameters_.lateral_collision_margin;
const auto & vehicle_width = planner_data_->parameters.vehicle_width;
const auto & road_shoulder_safety_margin = parameters_.road_shoulder_safety_margin;
const auto max_allowable_lateral_distance = lat_collision_safety_buffer + lat_collision_margin +
vehicle_width - road_shoulder_safety_margin;

const auto avoid_margin =
lat_collision_safety_buffer + lat_collision_margin + 0.5 * vehicle_width;
Expand All @@ -493,13 +491,16 @@ AvoidPointArray AvoidanceModule::calcRawShiftPointsFromObjects(
avoidance_debug_msg_array.push_back(avoidance_debug_msg);
};

const auto max_allowable_lateral_distance =
o.to_road_shoulder_distance - road_shoulder_safety_margin - 0.5 * vehicle_width;

avoidance_debug_msg.object_id = getUuidStr(o);
avoidance_debug_msg.longitudinal_distance = o.longitudinal;
avoidance_debug_msg.lateral_distance_from_centerline = o.lateral;
avoidance_debug_msg.to_furthest_linestring_distance = o.to_road_shoulder_distance;
avoidance_debug_msg.max_shift_length = max_allowable_lateral_distance;

if (!(o.to_road_shoulder_distance > max_allowable_lateral_distance)) {
if (max_allowable_lateral_distance <= avoid_margin) {
avoidance_debug_array_false_and_push_back(AvoidanceDebugFactor::INSUFFICIENT_LATERAL_MARGIN);
continue;
}
Expand Down

0 comments on commit 771fee7

Please sign in to comment.