File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -428,9 +428,17 @@ void PlannerServer::computePlanThroughPoses()
428
428
throw nav2_core::NoValidPathCouldBeFound (goal->planner_id + " generated a empty path" );
429
429
}
430
430
431
- // Concatenate paths together
432
- concat_path.poses .insert (
433
- concat_path.poses .end (), curr_path.poses .begin (), curr_path.poses .end ());
431
+ // Concatenate paths together, but skip the first pose of subsequent paths
432
+ // to avoid duplicating the connection point
433
+ if (i == 0 ) {
434
+ // First path: add all poses
435
+ concat_path.poses .insert (
436
+ concat_path.poses .end (), curr_path.poses .begin (), curr_path.poses .end ());
437
+ } else if (curr_path.poses .size () > 1 ) {
438
+ // Subsequent paths: skip the first pose to avoid duplication
439
+ concat_path.poses .insert (
440
+ concat_path.poses .end (), curr_path.poses .begin () + 1 , curr_path.poses .end ());
441
+ }
434
442
concat_path.header = curr_path.header ;
435
443
}
436
444
You can’t perform that action at this time.
0 commit comments