1 #include <gtest/gtest.h> 12 std::cout <<
"ctor" << std::endl;
19 if (getInput(
"in_port_A", val_A) && getInput(
"in_port_B", val_B) && val_A == 42 &&
29 return {BT::InputPort<int>(
"in_port_A", 42,
"magic_number"), BT::InputPort<int>(
"in_" 36 TEST(PortTest, DefaultPorts)
38 std::string xml_txt = R
"( 39 <root main_tree_to_execute = "MainTree" > 40 <BehaviorTree ID="MainTree"> 41 <NodeWithPorts name = "first" in_port_B="66" /> 54 TEST(PortTest, Descriptions)
56 std::string xml_txt = R
"( 57 <root main_tree_to_execute = "MainTree" > 58 <BehaviorTree ID="MainTree" _description="this is my tree" > 60 <NodeWithPorts name="first" in_port_B="66" _description="this is my action" /> 61 <SubTree ID="SubTree" name="second" _description="this is a subtree"/> 65 <BehaviorTree ID="SubTree" _description="this is a subtre" > 66 <NodeWithPorts name="third" in_port_B="99" /> 96 if (getInput(
"int_port", val_A) && getInput(
"any_port", val_B))
105 return {BT::InputPort<int>(
"int_port"), BT::InputPort<MyType>(
"any_port")};
123 return {BT::OutputPort<int>(
"int_port"), BT::OutputPort<MyType>(
"any_port")};
129 std::string xml_txt = R
"( 130 <root main_tree_to_execute = "MainTree" > 131 <BehaviorTree ID="MainTree"> 133 <NodeInPorts int_port="{ip}" any_port="{ap}" /> 134 <NodeOutPorts int_port="{ip}" any_port="{ap}" /> 164 return {BT::InputPort<std::string>(
"name")};
void registerNodeType(const std::string &ID)
NodeStatus tick()
Method to be implemented by the user.
IllegalPorts(const std::string &name, const NodeConfiguration &config)
static PortsList providedPorts()
static PortsList providedPorts()
static PortsList providedPorts()
The SyncActionNode is an ActionNode that explicitly prevents the status RUNNING and doesn't require a...
The BehaviorTreeFactory is used to create instances of a TreeNode at run-time.
Tree createTreeFromText(const std::string &text, Blackboard::Ptr blackboard=Blackboard::create())
NodeStatus tick()
Method to be implemented by the user.
std::unordered_map< std::string, PortInfo > PortsList
NodeInPorts(const std::string &name, const NodeConfiguration &config)
TEST(PortTest, DefaultPorts)
NodeStatus tick()
Method to be implemented by the user.
NodeWithPorts(const std::string &name, const NodeConfiguration &config)
static PortsList providedPorts()
NodeStatus tick()
Method to be implemented by the user.
NodeOutPorts(const std::string &name, const NodeConfiguration &config)