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 @@ -429,13 +429,6 @@ std::vector<geometry_msgs::msg::Point> crop_line_string(
429
429
const std::vector<geometry_msgs::msg::Point > & line_string, const double s_start,
430
430
const double s_end)
431
431
{
432
- if (line_string.size () < 2 ) {
433
- RCLCPP_WARN (
434
- rclcpp::get_logger (" path_generator" ).get_child (" utils" ).get_child (__func__),
435
- " Input line string has less than 2 points, returning input as is" );
436
- return line_string;
437
- }
438
-
439
432
if (s_start < 0 .) {
440
433
RCLCPP_WARN (
441
434
rclcpp::get_logger (" path_generator" ).get_child (" utils" ).get_child (__func__),
@@ -453,6 +446,10 @@ std::vector<geometry_msgs::msg::Point> crop_line_string(
453
446
auto trajectory = autoware::trajectory::Trajectory<geometry_msgs::msg::Point >::Builder ()
454
447
.set_xy_interpolator <trajectory::interpolator::Linear>()
455
448
.build (line_string);
449
+ if (!trajectory) {
450
+ return {};
451
+ }
452
+
456
453
trajectory->crop (s_start, s_end - s_start);
457
454
return trajectory->restore ();
458
455
}
You can’t perform that action at this time.
0 commit comments