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

fix(avoidance): cherry pick PRs for avoidance module #1195

Merged
merged 4 commits into from
Mar 19, 2024
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
Prev Previous commit
Next Next commit
fix(avoidance): ignore objects are in intersection when the ego stops…
… by red traffic signal (autowarefoundation#6565)

fix(avoidance): don't avoid objects are farther than red signal traffic light

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
  • Loading branch information
satoshi-ota committed Mar 19, 2024
commit dc15ad5fae72903d0c7c13a359cf1c391868c623
11 changes: 10 additions & 1 deletion planning/behavior_path_avoidance_module/src/scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,19 @@ void AvoidanceModule::fillAvoidanceTargetObjects(
using utils::avoidance::getTargetLanelets;
using utils::avoidance::separateObjectsByPath;
using utils::avoidance::updateRoadShoulderDistance;
using utils::traffic_light::calcDistanceToRedTrafficLight;

// Separate dynamic objects based on whether they are inside or outside of the expanded lanelets.
constexpr double MARGIN = 10.0;
const auto forward_detection_range = helper_->getForwardDetectionRange();
const auto forward_detection_range = [&]() {
const auto to_traffic_light = calcDistanceToRedTrafficLight(
data.current_lanelets, helper_->getPreviousReferencePath(), planner_data_);
if (!to_traffic_light.has_value()) {
return helper_->getForwardDetectionRange();
}
return std::min(helper_->getForwardDetectionRange(), to_traffic_light.value());
}();

const auto [object_within_target_lane, object_outside_target_lane] = separateObjectsByPath(
helper_->getPreviousReferencePath(), helper_->getPreviousSplineShiftPath().path, planner_data_,
data, parameters_, forward_detection_range + MARGIN, debug);
Expand Down