From c158589caf7dc55e38f4e1717985fb5753b17543 Mon Sep 17 00:00:00 2001 From: Tony Najjar Date: Thu, 9 Mar 2023 14:28:40 +0100 Subject: [PATCH] Fix vector size --- .../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);