diff --git a/nav2_mppi_controller/src/critics/path_align_critic.cpp b/nav2_mppi_controller/src/critics/path_align_critic.cpp index 4b4d93abf3..cd913e5b0e 100644 --- a/nav2_mppi_controller/src/critics/path_align_critic.cpp +++ b/nav2_mppi_controller/src/critics/path_align_critic.cpp @@ -126,6 +126,8 @@ void PathAlignCritic::score(CriticData & data) } if (num_samples > 0) { cost[t] = summed_path_dist / num_samples; + } else { + cost[t] = 0.0f; } }