From a2ce5909a1d1c4137c98e8c8798b72fecf946124 Mon Sep 17 00:00:00 2001 From: v4hn Date: Thu, 2 Mar 2017 17:35:31 +0100 Subject: [PATCH] task: abort if nothing could compute --- src/task.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/task.cpp b/src/task.cpp index 7741e180..6fed6349 100644 --- a/src/task.cpp +++ b/src/task.cpp @@ -55,12 +55,15 @@ void moveit::task_constructor::Task::addAfter( SubTaskPtr subtask ){ } bool moveit::task_constructor::Task::plan(){ - while(ros::ok()){ + bool computed= true; + while(ros::ok() && computed){ + computed= false; for( SubTaskPtr& subtask : subtasks_ ){ if( !subtask->canCompute() ) continue; std::cout << "Computing subtask '" << subtask->getName() << "': " << std::endl; bool success= subtask->compute(); + computed= true; std::cout << (success ? "succeeded" : "failed") << std::endl; } printState();