File tree 1 file changed +4
-7
lines changed
planning/autoware_path_generator/src
1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -460,13 +460,6 @@ std::vector<geometry_msgs::msg::Point> crop_line_string(
460
460
const std::vector<geometry_msgs::msg::Point > & line_string, const double s_start,
461
461
const double s_end)
462
462
{
463
- if (line_string.size () < 2 ) {
464
- RCLCPP_WARN (
465
- rclcpp::get_logger (" path_generator" ).get_child (" utils" ).get_child (__func__),
466
- " Input line string has less than 2 points, returning input as is" );
467
- return line_string;
468
- }
469
-
470
463
if (s_start < 0 .) {
471
464
RCLCPP_WARN (
472
465
rclcpp::get_logger (" path_generator" ).get_child (" utils" ).get_child (__func__),
@@ -484,6 +477,10 @@ std::vector<geometry_msgs::msg::Point> crop_line_string(
484
477
auto trajectory = autoware::trajectory::Trajectory<geometry_msgs::msg::Point >::Builder ()
485
478
.set_xy_interpolator <trajectory::interpolator::Linear>()
486
479
.build (line_string);
480
+ if (!trajectory) {
481
+ return {};
482
+ }
483
+
487
484
trajectory->crop (s_start, s_end - s_start);
488
485
return trajectory->restore ();
489
486
}
You can’t perform that action at this time.
0 commit comments