Skip to content

Commit

Permalink
⚡ improve bt exit
Browse files Browse the repository at this point in the history
  • Loading branch information
Rezenders committed Jan 22, 2024
1 parent c307f2b commit 3d2757d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/suave_rosa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ int main(int argc, char * argv[])
if(node->time_limit_reached()){
node->request_save_mission_results();
tree.haltTree();
break;
finish = true;
} else{
finish = tree.rootNode()->executeTick() == BT::NodeStatus::SUCCESS;
}

finish = tree.rootNode()->executeTick() == BT::NodeStatus::SUCCESS;
rclcpp::spin_some(node);
rate.sleep();
}
Expand Down
1 change: 1 addition & 0 deletions src/suave_rosa/suave_mission.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ namespace suave_rosa

bool SuaveMission::time_limit_reached(){
if(_search_started){
std::cout << "Time limit reached!"<< std::endl;
return (this->get_clock()->now() - _start_time) >= rclcpp::Duration(_time_limit, 0);
}
return false;
Expand Down
6 changes: 3 additions & 3 deletions src/suave_rosa_extended.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ int main(int argc, char * argv[])
if(node->time_limit_reached()){
node->request_save_mission_results();
tree.haltTree();
break;
finish = true;
} else{
finish = tree.rootNode()->executeTick() == BT::NodeStatus::SUCCESS;
}

finish = tree.rootNode()->executeTick() == BT::NodeStatus::SUCCESS;
rclcpp::spin_some(node);
rate.sleep();
}
Expand Down

0 comments on commit 3d2757d

Please sign in to comment.