-
Notifications
You must be signed in to change notification settings - Fork 857
Expand file tree
/
Copy pathsubtree_node.cpp
More file actions
34 lines (29 loc) · 852 Bytes
/
Copy pathsubtree_node.cpp
File metadata and controls
34 lines (29 loc) · 852 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "behaviortree_cpp/decorators/subtree_node.h"
BT::SubTreeNode::SubTreeNode(const std::string& name, const NodeConfig& config)
: DecoratorNode(name, config)
{
setRegistrationID("SubTree");
}
BT::PortsList BT::SubTreeNode::providedPorts()
{
auto port =
PortInfo(PortDirection::INPUT, typeid(bool), GetAnyFromStringFunctor<bool>());
port.setDefaultValue(false);
port.setDescription("If true, all the ports with the same name "
"will be remapped");
return { { "_autoremap", port } };
}
BT::NodeStatus BT::SubTreeNode::tick()
{
const NodeStatus prev_status = status();
if(prev_status == NodeStatus::IDLE)
{
setStatus(NodeStatus::RUNNING);
}
const NodeStatus child_status = child_node_->executeTick();
if(isStatusCompleted(child_status))
{
resetChild();
}
return child_status;
}