@@ -144,6 +144,19 @@ BehaviorModuleOutput NormalLaneChange::getTerminalLaneChangePath() const
144
144
{
145
145
BehaviorModuleOutput output;
146
146
147
+ if (isAbortState () && abort_path_) {
148
+ output.path = abort_path_->path ;
149
+ output.reference_path = prev_module_reference_path_;
150
+ output.turn_signal_info = prev_turn_signal_info_;
151
+ extendOutputDrivableArea (output);
152
+ const auto current_seg_idx = planner_data_->findEgoSegmentIndex (output.path .points );
153
+ output.turn_signal_info = planner_data_->turn_signal_decider .use_prior_turn_signal (
154
+ output.path , getEgoPose (), current_seg_idx, prev_turn_signal_info_, output.turn_signal_info ,
155
+ planner_data_->parameters .ego_nearest_dist_threshold ,
156
+ planner_data_->parameters .ego_nearest_yaw_threshold );
157
+ return output;
158
+ }
159
+
147
160
const auto current_lanes = getCurrentLanes ();
148
161
if (current_lanes.empty ()) {
149
162
RCLCPP_WARN (logger_, " Current lanes not found!!! Something wrong." );
@@ -157,7 +170,7 @@ BehaviorModuleOutput NormalLaneChange::getTerminalLaneChangePath() const
157
170
const auto terminal_path =
158
171
calcTerminalLaneChangePath (current_lanes, getLaneChangeLanes (current_lanes, direction_));
159
172
if (!terminal_path) {
160
- RCLCPP_WARN (logger_, " Terminal path not found!!!" );
173
+ RCLCPP_DEBUG (logger_, " Terminal path not found!!!" );
161
174
output.path = prev_module_path_;
162
175
output.reference_path = prev_module_reference_path_;
163
176
output.drivable_area_info = prev_drivable_area_info_;
@@ -1525,7 +1538,7 @@ std::optional<LaneChangePath> NormalLaneChange::calcTerminalLaneChangePath(
1525
1538
-(lane_change_buffer + next_lane_change_buffer + distance_to_terminal_from_goal));
1526
1539
1527
1540
if (!lane_changing_start_pose) {
1528
- RCLCPP_WARN (logger_, " Reject: lane changing start pose not found!!!" );
1541
+ RCLCPP_DEBUG (logger_, " Reject: lane changing start pose not found!!!" );
1529
1542
return {};
1530
1543
}
1531
1544
@@ -1534,7 +1547,7 @@ std::optional<LaneChangePath> NormalLaneChange::calcTerminalLaneChangePath(
1534
1547
1535
1548
// Check if the lane changing start point is not on the lanes next to target lanes,
1536
1549
if (target_length_from_lane_change_start_pose > 0.0 ) {
1537
- RCLCPP_WARN (logger_, " lane change start getEgoPose() is behind target lanelet!" );
1550
+ RCLCPP_DEBUG (logger_, " lane change start getEgoPose() is behind target lanelet!" );
1538
1551
return {};
1539
1552
}
1540
1553
@@ -1552,7 +1565,7 @@ std::optional<LaneChangePath> NormalLaneChange::calcTerminalLaneChangePath(
1552
1565
minimum_lane_changing_velocity, next_lane_change_buffer);
1553
1566
1554
1567
if (target_segment.points .empty ()) {
1555
- RCLCPP_WARN (logger_, " Reject: target segment is empty!! something wrong..." );
1568
+ RCLCPP_DEBUG (logger_, " Reject: target segment is empty!! something wrong..." );
1556
1569
return {};
1557
1570
}
1558
1571
@@ -1581,7 +1594,7 @@ std::optional<LaneChangePath> NormalLaneChange::calcTerminalLaneChangePath(
1581
1594
lane_change_info.terminal_lane_changing_velocity = minimum_lane_changing_velocity;
1582
1595
1583
1596
if (!is_valid_start_point) {
1584
- RCLCPP_WARN (
1597
+ RCLCPP_DEBUG (
1585
1598
logger_,
1586
1599
" Reject: lane changing points are not inside of the target preferred lanes or its "
1587
1600
" neighbors" );
@@ -1596,7 +1609,7 @@ std::optional<LaneChangePath> NormalLaneChange::calcTerminalLaneChangePath(
1596
1609
next_lane_change_buffer);
1597
1610
1598
1611
if (target_lane_reference_path.points .empty ()) {
1599
- RCLCPP_WARN (logger_, " Reject: target_lane_reference_path is empty!!" );
1612
+ RCLCPP_DEBUG (logger_, " Reject: target_lane_reference_path is empty!!" );
1600
1613
return {};
1601
1614
}
1602
1615
@@ -1855,31 +1868,25 @@ bool NormalLaneChange::calcAbortPath()
1855
1868
1856
1869
ShiftedPath shifted_path;
1857
1870
// offset front side
1858
- // bool offset_back = false;
1859
1871
if (!path_shifter.generate (&shifted_path)) {
1860
1872
RCLCPP_ERROR (logger_, " failed to generate abort shifted path." );
1861
1873
}
1862
1874
1863
- const auto arc_position = lanelet::utils::getArcCoordinates (
1864
- reference_lanelets, shifted_path.path .points .at (abort_return_idx).point .pose );
1865
- const PathWithLaneId reference_lane_segment = std::invoke ([&]() {
1866
- const double s_start = arc_position.length ;
1867
- double s_end = std::max (lanelet::utils::getLaneletLength2d (reference_lanelets), s_start);
1868
-
1869
- if (
1870
- !reference_lanelets.empty () &&
1871
- route_handler->isInGoalRouteSection (reference_lanelets.back ())) {
1872
- const auto goal_arc_coordinates =
1873
- lanelet::utils::getArcCoordinates (reference_lanelets, route_handler->getGoalPose ());
1874
- const double forward_length = std::max (goal_arc_coordinates.length , s_start);
1875
- s_end = std::min (s_end, forward_length);
1875
+ PathWithLaneId reference_lane_segment = prev_module_path_;
1876
+ {
1877
+ const auto terminal_path =
1878
+ calcTerminalLaneChangePath (reference_lanelets, selected_path.info .target_lanes );
1879
+ if (terminal_path) {
1880
+ reference_lane_segment = terminal_path->path ;
1876
1881
}
1877
- PathWithLaneId ref = route_handler->getCenterLinePath (reference_lanelets, s_start, s_end, true );
1878
- ref.points .back ().point .longitudinal_velocity_mps = std::min (
1879
- ref.points .back ().point .longitudinal_velocity_mps ,
1880
- static_cast <float >(lane_change_parameters_->minimum_lane_changing_velocity ));
1881
- return ref;
1882
- });
1882
+ const auto return_pose = shifted_path.path .points .at (abort_return_idx).point .pose ;
1883
+ const auto seg_idx = motion_utils::findFirstNearestSegmentIndexWithSoftConstraints (
1884
+ reference_lane_segment.points , return_pose, common_param.ego_nearest_dist_threshold ,
1885
+ common_param.ego_nearest_yaw_threshold );
1886
+ reference_lane_segment.points = motion_utils::cropPoints (
1887
+ reference_lane_segment.points , return_pose.position , seg_idx,
1888
+ common_param.forward_path_length , 0.0 );
1889
+ }
1883
1890
1884
1891
auto abort_path = selected_path;
1885
1892
abort_path.shifted_path = shifted_path;
0 commit comments