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();