Skip to content

Commit bae824a

Browse files
committed
Merge branch 'master' of github.com:BehaviorTree/BehaviorTree.CPP
2 parents 5a586c8 + 08605d1 commit bae824a

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

include/behaviortree_cpp/bt_factory.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,20 @@ class Tree
120120
[[nodiscard]] TreeNode* rootNode() const;
121121

122122
/**
123-
* @brief Sleep for a certain amount of time. This sleep could be interrupted by the method TreeNode::emitWakeUpSignal()
123+
* @brief Sleep for a certain amount of time. This sleep could be interrupted by the methods
124+
* TreeNode::emitWakeUpSignal() or Tree::emitWakeUpSignal()
124125
*
125126
* @param timeout duration of the sleep
126127
* @return true if the timeout was NOT reached and the signal was received.
127128
*
128129
* */
129130
bool sleep(std::chrono::system_clock::duration timeout);
130131

132+
/**
133+
* @brief Wake up the tree. This will interrupt the sleep() method.
134+
*/
135+
void emitWakeUpSignal();
136+
131137
~Tree();
132138

133139
/// Tick the root of the tree once, even if a node invoked

src/bt_factory.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,11 @@ bool Tree::sleep(std::chrono::system_clock::duration timeout)
519519
std::chrono::duration_cast<std::chrono::milliseconds>(timeout));
520520
}
521521

522+
void Tree::emitWakeUpSignal()
523+
{
524+
wake_up_->emitSignal();
525+
}
526+
522527
Tree::~Tree()
523528
{
524529
haltTree();

0 commit comments

Comments
 (0)