FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Change to btcpp_v4 by renan028 · Pull Request #24 · BehaviorTree/BehaviorTree.ROS · GitHub

Change to btcpp_v4 - #24

Open
renan028 wants to merge 1 commit into
BehaviorTree:masterfrom
renan028:rs/bt_v4
Open

renan028 wants to merge 1 commit into
BehaviorTree:masterfrom
renan028:rs/bt_v4

Conversation

Copy link
Copy Markdown
Collaborator

Description

Required changes to make it BTCpp_V4 compatible.

Comment thread test/test_bt.cpp
{
ros::spinOnce();
status = tree.tickRoot();
status = tree.tickExactlyOnce();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

What is the main difference between v3 and v4 in this topic?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL