diff --git a/homer_navigation/src/homer_navigation_node.cpp b/homer_navigation/src/homer_navigation_node.cpp index f63498e2437e0fd28ee6e354c631e856eb646b68..11c740c466160dd8f730a57d9e4aaab8a6f6947c 100644 --- a/homer_navigation/src/homer_navigation_node.cpp +++ b/homer_navigation/src/homer_navigation_node.cpp @@ -418,6 +418,11 @@ void HomerNavigationNode::performNextMove() { targetPositionReached(); return; } + if (m_waypoints.size() == 0) { + ROS_WARN_STREAM( + "No waypoints but trying to perform next move! Skipping."); + return; + } // if we have accidentaly skipped waypoints, recalculate path float minDistance = FLT_MAX; float distance;