Conversation
| { | ||
| ros::spinOnce(); | ||
| status = tree.tickRoot(); | ||
| status = tree.tickExactlyOnce(); |
There was a problem hiding this comment.
What is the main difference between v3 and v4 in this topic?
There was a problem hiding this comment.
In bt.v4, tickExactlyOnce calls tickRoot(EXACTLY_ONCE, std::chrono::milliseconds(0));
which will behave the same way tickRoot in bt.v3
In bt.cpp 4 you have other options to tick (e.g. TickOption::WHILE_RUNNING); usage tree.tickRootWhileRunning()
There was a problem hiding this comment.
Thanks for answer. Is good to know, but there are some questions related.
About tickOnce method, that implements tickRoot(ONCE_UNLESS_WOKEN_UP, 0s)?
What happens if there is a BT node that emit a wake signal? will it needs to wait for the loop rate?
There was a problem hiding this comment.
yes, that is why you have another inner loop:
while(status == NodeStatus::IDLE ||
(opt == TickOption::WHILE_RUNNING && status == NodeStatus::RUNNING))
{
status = rootNode()->executeTick();
// Inner loop. The previous tick might have triggered the wake-up
// in this case, unless TickOption::EXACTLY_ONCE, we tick again
while(opt != TickOption::EXACTLY_ONCE && status == NodeStatus::RUNNING &&
wake_up_->waitFor(std::chrono::milliseconds(0)))
{
status = rootNode()->executeTick();
}
if you use tickExactlyOnce it will wait the loop rate to tick again;
tickOnce will tick again if you have a wake_up signal.
StatefulActionNode and Threaded ones may emit a wake_up signal.
You can check the SleepNode for example
Description
Required changes to make it BTCpp_V4 compatible.