Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions nav2_planner/src/planner_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,9 +428,17 @@ void PlannerServer::computePlanThroughPoses()
throw nav2_core::NoValidPathCouldBeFound(goal->planner_id + " generated a empty path");
}

// Concatenate paths together
concat_path.poses.insert(
concat_path.poses.end(), curr_path.poses.begin(), curr_path.poses.end());
// Concatenate paths together, but skip the first pose of subsequent paths
// to avoid duplicating the connection point
if (i == 0) {
// First path: add all poses
concat_path.poses.insert(
concat_path.poses.end(), curr_path.poses.begin(), curr_path.poses.end());
} else if (curr_path.poses.size() > 1) {
// Subsequent paths: skip the first pose to avoid duplication
concat_path.poses.insert(
concat_path.poses.end(), curr_path.poses.begin() + 1, curr_path.poses.end());
}
concat_path.header = curr_path.header;
}

Expand Down
Loading