@@ -1505,6 +1505,11 @@ void AvoidanceModule::insertReturnDeadLine(
1505
1505
{
1506
1506
const auto & data = avoid_data_;
1507
1507
1508
+ if (data.new_shift_line .empty ()) {
1509
+ RCLCPP_WARN (getLogger (), " module doesn't have return shift line." );
1510
+ return ;
1511
+ }
1512
+
1508
1513
if (data.to_return_point > planner_data_->parameters .forward_path_length ) {
1509
1514
RCLCPP_DEBUG (getLogger (), " return dead line is far enough." );
1510
1515
return ;
@@ -1517,6 +1522,11 @@ void AvoidanceModule::insertReturnDeadLine(
1517
1522
return ;
1518
1523
}
1519
1524
1525
+ if (!helper_->isFeasible (data.new_shift_line )) {
1526
+ RCLCPP_WARN (getLogger (), " return shift line is not feasible. do nothing.." );
1527
+ return ;
1528
+ }
1529
+
1520
1530
// Consider the difference in path length between the shifted path and original path (the path
1521
1531
// that is shifted inward has a shorter distance to the end of the path than the other one.)
1522
1532
const auto & to_reference_path_end = data.arclength_from_ego .back ();
@@ -1527,6 +1537,10 @@ void AvoidanceModule::insertReturnDeadLine(
1527
1537
const auto min_return_distance =
1528
1538
helper_->getMinAvoidanceDistance (shift_length) + helper_->getMinimumPrepareDistance ();
1529
1539
const auto to_stop_line = data.to_return_point - min_return_distance - buffer;
1540
+ if (to_stop_line < 0.0 ) {
1541
+ RCLCPP_WARN (getLogger (), " ego overran return shift dead line. do nothing." );
1542
+ return ;
1543
+ }
1530
1544
1531
1545
// If we don't need to consider deceleration constraints, insert a deceleration point
1532
1546
// and return immediately
@@ -1594,6 +1608,11 @@ void AvoidanceModule::insertWaitPoint(
1594
1608
return ;
1595
1609
}
1596
1610
1611
+ if (data.to_stop_line < 0.0 ) {
1612
+ RCLCPP_WARN (getLogger (), " ego overran avoidance dead line. do nothing." );
1613
+ return ;
1614
+ }
1615
+
1597
1616
// If we don't need to consider deceleration constraints, insert a deceleration point
1598
1617
// and return immediately
1599
1618
if (!use_constraints_for_decel) {
0 commit comments