Skip to content

Commit

Permalink
fix(behavior_velocity_planner): fix safety slow down crosswalk inters…
Browse files Browse the repository at this point in the history
…ection check (#1708)

Signed-off-by: Mehmet Dogru <42mehmetdogru42@gmail.com>

Signed-off-by: Mehmet Dogru <42mehmetdogru42@gmail.com>
  • Loading branch information
mehmetdogru authored Aug 26, 2022
1 parent eda487d commit 7f3389e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class CrosswalkModule : public SceneModuleInterface

CollisionPointState getCollisionPointState(const double ttc, const double ttv) const;

void applySafetySlowDownSpeed(PathWithLaneId & output);
bool applySafetySlowDownSpeed(PathWithLaneId & output);

float calcTargetVelocity(
const geometry_msgs::msg::Point & stop_point, const PathWithLaneId & ego_path) const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,9 @@ bool CrosswalkModule::modifyPathVelocity(PathWithLaneId * path, StopReason * sto

if (crosswalk_.hasAttribute("safety_slow_down_speed")) {
// Safety slow down is on
applySafetySlowDownSpeed(*path);
ego_path = *path;
if (applySafetySlowDownSpeed(*path)) {
ego_path = *path;
}
}

RCLCPP_INFO_EXPRESSION(
Expand Down Expand Up @@ -731,8 +732,12 @@ CollisionPointState CrosswalkModule::getCollisionPointState(
return CollisionPointState::YIELD;
}

void CrosswalkModule::applySafetySlowDownSpeed(PathWithLaneId & output)
bool CrosswalkModule::applySafetySlowDownSpeed(PathWithLaneId & output)
{
if (path_intersects_.empty()) {
return false;
}

const auto & ego_pos = planner_data_->current_pose.pose.position;
const auto ego_path = output;

Expand Down Expand Up @@ -772,6 +777,7 @@ void CrosswalkModule::applySafetySlowDownSpeed(PathWithLaneId & output)
}
}
}
return true;
}

bool CrosswalkModule::isStuckVehicle(
Expand Down

0 comments on commit 7f3389e

Please sign in to comment.