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): check far objects during shifting #5857

Merged
merged 2 commits into from
Dec 15, 2023
Merged
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@

double getEgoSpeed() const { return std::abs(data_->self_odometry->twist.twist.linear.x); }

geometry_msgs::msg::Pose getEgoPose() const { return data_->self_odometry->pose.pose; }

size_t getConstraintsMapIndex(const double velocity, const std::vector<double> & values) const
{
const auto itr = std::find_if(
Expand Down Expand Up @@ -185,10 +187,20 @@
return parameters_->object_check_max_forward_distance;
}

const auto & route_handler = data_->route_handler;

lanelet::ConstLanelet closest_lane;
if (!route_handler->getClosestLaneletWithinRoute(getEgoPose(), &closest_lane)) {
return parameters_->object_check_max_forward_distance;

Check warning on line 194 in planning/behavior_path_avoidance_module/include/behavior_path_avoidance_module/helper.hpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_avoidance_module/include/behavior_path_avoidance_module/helper.hpp#L194

Added line #L194 was not covered by tests
}

const auto limit = route_handler->getTrafficRulesPtr()->speedLimit(closest_lane);
const auto speed = isShifted() ? limit.speedLimit.value() : getEgoSpeed();

Check warning on line 198 in planning/behavior_path_avoidance_module/include/behavior_path_avoidance_module/helper.hpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_avoidance_module/include/behavior_path_avoidance_module/helper.hpp#L198

Added line #L198 was not covered by tests

const auto max_shift_length = std::max(
std::abs(parameters_->max_right_shift_length), std::abs(parameters_->max_left_shift_length));
const auto dynamic_distance = PathShifter::calcLongitudinalDistFromJerk(
max_shift_length, getLateralMinJerkLimit(), getEgoSpeed());
const auto dynamic_distance =
PathShifter::calcLongitudinalDistFromJerk(max_shift_length, getLateralMinJerkLimit(), speed);

return std::clamp(
1.5 * dynamic_distance + getNominalPrepareDistance(),
Expand Down
Loading