-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change to btcpp_v4 #24
base: master
Are you sure you want to change the base?
Conversation
@@ -196,7 +196,7 @@ int main(int argc, char **argv) | |||
while( ros::ok() && (status == NodeStatus::IDLE || status == NodeStatus::RUNNING)) | |||
{ | |||
ros::spinOnce(); | |||
status = tree.tickRoot(); | |||
status = tree.tickExactlyOnce(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the main difference between v3 and v4 in this topic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.