Skip to content

Commit 40b591d

Browse files
committed
Revert "fix(goal_planner): fix zero velocity in middle of path (autowarefoundation#8563)"
This reverts commit 0c9046b.
1 parent a0bc7e9 commit 40b591d

File tree

4 files changed

+9
-45
lines changed

4 files changed

+9
-45
lines changed

planning/behavior_path_planner/autoware_behavior_path_goal_planner_module/include/autoware/behavior_path_goal_planner_module/util.hpp

+4-23
Original file line numberDiff line numberDiff line change
@@ -82,31 +82,12 @@ bool isReferencePath(
8282
std::optional<PathWithLaneId> cropPath(const PathWithLaneId & path, const Pose & end_pose);
8383
PathWithLaneId cropForwardPoints(
8484
const PathWithLaneId & path, const size_t target_seg_idx, const double forward_length);
85-
86-
/**
87-
* @brief extend target_path by extend_length
88-
* @param target_path original target path to extend
89-
* @param reference_path reference path to extend
90-
* @param extend_length length to extend
91-
* @param remove_connected_zero_velocity flag to remove zero velocity if the last point of
92-
* target_path has zero velocity
93-
* @return extended path
94-
*/
9585
PathWithLaneId extendPath(
96-
const PathWithLaneId & target_path, const PathWithLaneId & reference_path,
97-
const double extend_length, const bool remove_connected_zero_velocity);
98-
/**
99-
* @brief extend target_path to extend_pose
100-
* @param target_path original target path to extend
101-
* @param reference_path reference path to extend
102-
* @param extend_pose pose to extend
103-
* @param remove_connected_zero_velocity flag to remove zero velocity if the last point of
104-
* target_path has zero velocity
105-
* @return extended path
106-
*/
86+
const PathWithLaneId & prev_module_path, const PathWithLaneId & reference_path,
87+
const double extend_length);
10788
PathWithLaneId extendPath(
108-
const PathWithLaneId & target_path, const PathWithLaneId & reference_path,
109-
const Pose & extend_pose, const bool remove_connected_zero_velocity);
89+
const PathWithLaneId & prev_module_path, const PathWithLaneId & reference_path,
90+
const Pose & extend_pose);
11091

11192
std::vector<Polygon2d> createPathFootPrints(
11293
const PathWithLaneId & path, const double base_to_front, const double base_to_rear,

planning/behavior_path_planner/autoware_behavior_path_goal_planner_module/src/goal_planner_module.cpp

+1-9
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,6 @@ void GoalPlannerModule::onTimer()
283283
RCLCPP_DEBUG(getLogger(), "has deviated from last previous module path");
284284
return true;
285285
}
286-
// TODO(someone): The generated path inherits the velocity of the path of the previous module.
287-
// Therefore, if the velocity of the path of the previous module changes (e.g. stop points are
288-
// inserted, deleted), the path should be regenerated.
289-
290286
return false;
291287
});
292288
if (!need_update) {
@@ -1672,12 +1668,8 @@ PathWithLaneId GoalPlannerModule::generateStopPath() const
16721668
const double s_end = s_current + common_parameters.forward_path_length;
16731669
return route_handler->getCenterLinePath(current_lanes, s_start, s_end, true);
16741670
});
1675-
1676-
// NOTE: The previous module may insert a zero velocity at the end of the path, so remove it by
1677-
// setting remove_connected_zero_velocity=true. Inserting a velocity of 0 into the goal is the
1678-
// role of the goal planner, and the intermediate zero velocity after extension is unnecessary.
16791671
const auto extended_prev_path = goal_planner_utils::extendPath(
1680-
getPreviousModuleOutput().path, reference_path, common_parameters.forward_path_length, true);
1672+
getPreviousModuleOutput().path, reference_path, common_parameters.forward_path_length);
16811673

16821674
// calculate search start offset pose from the closest goal candidate pose with
16831675
// approximate_pull_over_distance_ ego vehicle decelerates to this position. or if no feasible

planning/behavior_path_planner/autoware_behavior_path_goal_planner_module/src/shift_pull_over.cpp

+1-5
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,8 @@ std::optional<PullOverPath> ShiftPullOver::generatePullOverPath(
148148
lanelet::utils::getArcCoordinates(road_lanes, shift_end_pose).length >
149149
lanelet::utils::getArcCoordinates(road_lanes, prev_module_path_terminal_pose).length;
150150
if (extend_previous_module_path) { // case1
151-
// NOTE: The previous module may insert a zero velocity at the end of the path, so remove it
152-
// by setting remove_connected_zero_velocity=true. Inserting a velocity of 0 into the goal is
153-
// the role of the goal planner, and the intermediate zero velocity after extension is
154-
// unnecessary.
155151
return goal_planner_utils::extendPath(
156-
prev_module_path, road_lane_reference_path_to_shift_end, shift_end_pose, true);
152+
prev_module_path, road_lane_reference_path_to_shift_end, shift_end_pose);
157153
} else { // case2
158154
return goal_planner_utils::cropPath(prev_module_path, shift_end_pose);
159155
}

planning/behavior_path_planner/autoware_behavior_path_goal_planner_module/src/util.cpp

+3-8
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ PathWithLaneId cropForwardPoints(
388388

389389
PathWithLaneId extendPath(
390390
const PathWithLaneId & target_path, const PathWithLaneId & reference_path,
391-
const double extend_length, const bool remove_connected_zero_velocity)
391+
const double extend_length)
392392
{
393393
const auto & target_terminal_pose = target_path.points.back().point.pose;
394394

@@ -408,11 +408,6 @@ PathWithLaneId extendPath(
408408
}
409409

410410
auto extended_path = target_path;
411-
auto & target_terminal_vel = extended_path.points.back().point.longitudinal_velocity_mps;
412-
if (remove_connected_zero_velocity && target_terminal_vel < 0.01) {
413-
target_terminal_vel = clipped_path.points.front().point.longitudinal_velocity_mps;
414-
}
415-
416411
const auto start_point =
417412
std::find_if(clipped_path.points.begin(), clipped_path.points.end(), [&](const auto & p) {
418413
const bool is_forward =
@@ -431,15 +426,15 @@ PathWithLaneId extendPath(
431426

432427
PathWithLaneId extendPath(
433428
const PathWithLaneId & target_path, const PathWithLaneId & reference_path,
434-
const Pose & extend_pose, const bool remove_connected_zero_velocity)
429+
const Pose & extend_pose)
435430
{
436431
const auto & target_terminal_pose = target_path.points.back().point.pose;
437432
const size_t target_path_terminal_idx = autoware::motion_utils::findNearestSegmentIndex(
438433
reference_path.points, target_terminal_pose.position);
439434
const double extend_distance = autoware::motion_utils::calcSignedArcLength(
440435
reference_path.points, target_path_terminal_idx, extend_pose.position);
441436

442-
return extendPath(target_path, reference_path, extend_distance, remove_connected_zero_velocity);
437+
return extendPath(target_path, reference_path, extend_distance);
443438
}
444439

445440
std::vector<Polygon2d> createPathFootPrints(

0 commit comments

Comments
 (0)