From 0a63bf956e5da6e89946fde131303942e282c23b Mon Sep 17 00:00:00 2001 From: Tony Najjar Date: Thu, 9 Mar 2023 19:52:58 +0100 Subject: [PATCH] Fix out of bound vector (#3461) --- .../include/nav2_mppi_controller/tools/utils.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nav2_mppi_controller/include/nav2_mppi_controller/tools/utils.hpp b/nav2_mppi_controller/include/nav2_mppi_controller/tools/utils.hpp index d08b559cb0..20bea02a5d 100644 --- a/nav2_mppi_controller/include/nav2_mppi_controller/tools/utils.hpp +++ b/nav2_mppi_controller/include/nav2_mppi_controller/tools/utils.hpp @@ -370,7 +370,7 @@ inline void findPathCosts( auto * costmap = costmap_ros->getCostmap(); unsigned int map_x, map_y; const size_t path_segments_count = data.path.x.shape(0) - 1; - data.path_pts_valid = std::vector(path_segments_count - 1, false); + data.path_pts_valid = std::vector(path_segments_count, false); for (unsigned int idx = 0; idx < path_segments_count; idx++) { const auto path_x = data.path.x(idx); const auto path_y = data.path.y(idx);