Skip to content

Commit 8e55347

Browse files
committed
Revert "feat(goal_planner): reject candidate path whose start pose direction is not aligned with ego path"
This reverts commit 0307cae. Signed-off-by: Mamoru Sobue <mamoru.sobue@tier4.jp>
1 parent df55162 commit 8e55347

File tree

3 files changed

+7
-34
lines changed

3 files changed

+7
-34
lines changed

.cspell.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
"planning/behavior_velocity_intersection_module/scripts/**"
55
],
66
"ignoreRegExpList": [],
7-
"words": ["dltype", "tvmgen", "fromarray", "followable"]
7+
"words": ["dltype", "tvmgen", "fromarray"]
88
}

planning/behavior_path_goal_planner_module/include/behavior_path_goal_planner_module/goal_planner_module.hpp

+2-5
Original file line numberDiff line numberDiff line change
@@ -499,9 +499,7 @@ class GoalPlannerModule : public SceneModuleInterface
499499
void updateStatus(const BehaviorModuleOutput & output);
500500

501501
// validation
502-
bool hasEnoughDistance(
503-
const PullOverPath & pull_over_path,
504-
const std::vector<double> & reference_path_directions) const;
502+
bool hasEnoughDistance(const PullOverPath & pull_over_path) const;
505503
bool isCrossingPossible(
506504
const lanelet::ConstLanelet & start_lane, const lanelet::ConstLanelet & end_lane) const;
507505
bool isCrossingPossible(
@@ -519,8 +517,7 @@ class GoalPlannerModule : public SceneModuleInterface
519517
BehaviorModuleOutput planPullOverAsCandidate();
520518
std::optional<std::pair<PullOverPath, GoalCandidate>> selectPullOverPath(
521519
const std::vector<PullOverPath> & pull_over_path_candidates,
522-
const GoalCandidates & goal_candidates, const std::vector<double> & reference_path_directions,
523-
const double collision_check_margin) const;
520+
const GoalCandidates & goal_candidates, const double collision_check_margin) const;
524521
std::vector<PullOverPath> sortPullOverPathCandidatesByGoalPriority(
525522
const std::vector<PullOverPath> & pull_over_path_candidates,
526523
const GoalCandidates & goal_candidates) const;

planning/behavior_path_goal_planner_module/src/goal_planner_module.cpp

+4-28
Original file line numberDiff line numberDiff line change
@@ -846,8 +846,7 @@ std::vector<PullOverPath> GoalPlannerModule::sortPullOverPathCandidatesByGoalPri
846846

847847
std::optional<std::pair<PullOverPath, GoalCandidate>> GoalPlannerModule::selectPullOverPath(
848848
const std::vector<PullOverPath> & pull_over_path_candidates,
849-
const GoalCandidates & goal_candidates, const std::vector<double> & reference_path_directions,
850-
const double collision_check_margin) const
849+
const GoalCandidates & goal_candidates, const double collision_check_margin) const
851850
{
852851
for (const auto & pull_over_path : pull_over_path_candidates) {
853852
// check if goal is safe
@@ -860,7 +859,7 @@ std::optional<std::pair<PullOverPath, GoalCandidate>> GoalPlannerModule::selectP
860859
continue;
861860
}
862861

863-
if (!hasEnoughDistance(pull_over_path, reference_path_directions)) {
862+
if (!hasEnoughDistance(pull_over_path)) {
864863
continue;
865864
}
866865

@@ -1187,13 +1186,8 @@ BehaviorModuleOutput GoalPlannerModule::planPullOverAsOutput()
11871186
thread_safe_data_.get_pull_over_path_candidates(), goal_candidates);
11881187

11891188
// select pull over path which is safe against static objects and get it's goal
1190-
std::vector<double> reference_path_directions;
1191-
for (const auto & point : getPreviousModuleOutput().path.points) {
1192-
reference_path_directions.push_back(
1193-
tf2::getYaw(tier4_autoware_utils::getPose(point).orientation));
1194-
}
11951189
const auto path_and_goal_opt = selectPullOverPath(
1196-
pull_over_path_candidates, goal_candidates, reference_path_directions,
1190+
pull_over_path_candidates, goal_candidates,
11971191
parameters_->object_recognition_collision_check_hard_margins.back());
11981192

11991193
// update thread_safe_data_
@@ -1717,8 +1711,7 @@ bool GoalPlannerModule::checkObjectsCollision(
17171711
return utils::path_safety_checker::checkPolygonsIntersects(ego_polygons_expanded, obj_polygons);
17181712
}
17191713

1720-
bool GoalPlannerModule::hasEnoughDistance(
1721-
const PullOverPath & pull_over_path, const std::vector<double> & reference_path_directions) const
1714+
bool GoalPlannerModule::hasEnoughDistance(const PullOverPath & pull_over_path) const
17221715
{
17231716
const Pose & current_pose = planner_data_->self_odometry->pose.pose;
17241717
const double current_vel = planner_data_->self_odometry->twist.twist.linear.x;
@@ -1728,23 +1721,6 @@ bool GoalPlannerModule::hasEnoughDistance(
17281721
// so need enough distance to restart.
17291722
// distance to restart should be less than decide_path_distance.
17301723
// otherwise, the goal would change immediately after departure.
1731-
1732-
// reject outdated shift path on curved roads whose start pose direction is far from ego yaw
1733-
const double pull_over_path_start_direction = tf2::getYaw(pull_over_path.start_pose.orientation);
1734-
const bool isFollowableDirection = [&]() {
1735-
for (const auto reference_path_direction : reference_path_directions) {
1736-
if (
1737-
std::fabs(tier4_autoware_utils::normalizeRadian(
1738-
pull_over_path_start_direction - reference_path_direction)) < M_PI / 2) {
1739-
return true;
1740-
}
1741-
}
1742-
return false;
1743-
}();
1744-
if (!isFollowableDirection) {
1745-
return false;
1746-
}
1747-
17481724
const bool is_separated_path = pull_over_path.partial_paths.size() > 1;
17491725
const double distance_to_start = calcSignedArcLength(
17501726
pull_over_path.getFullPath().points, current_pose.position, pull_over_path.start_pose.position);

0 commit comments

Comments
 (0)