mirror of
https://github.com/moveit/moveit_task_constructor.git
synced 2025-11-04 14:49:57 +08:00
task: abort if nothing could compute
This commit is contained in:
parent
f247901623
commit
a2ce5909a1
@ -55,12 +55,15 @@ void moveit::task_constructor::Task::addAfter( SubTaskPtr subtask ){
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool moveit::task_constructor::Task::plan(){
|
bool moveit::task_constructor::Task::plan(){
|
||||||
while(ros::ok()){
|
bool computed= true;
|
||||||
|
while(ros::ok() && computed){
|
||||||
|
computed= false;
|
||||||
for( SubTaskPtr& subtask : subtasks_ ){
|
for( SubTaskPtr& subtask : subtasks_ ){
|
||||||
if( !subtask->canCompute() )
|
if( !subtask->canCompute() )
|
||||||
continue;
|
continue;
|
||||||
std::cout << "Computing subtask '" << subtask->getName() << "': " << std::endl;
|
std::cout << "Computing subtask '" << subtask->getName() << "': " << std::endl;
|
||||||
bool success= subtask->compute();
|
bool success= subtask->compute();
|
||||||
|
computed= true;
|
||||||
std::cout << (success ? "succeeded" : "failed") << std::endl;
|
std::cout << (success ? "succeeded" : "failed") << std::endl;
|
||||||
}
|
}
|
||||||
printState();
|
printState();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user