task: abort if nothing could compute

This commit is contained in:
v4hn 2017-03-02 17:35:31 +01:00
parent f247901623
commit a2ce5909a1

View File

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