1 #include <gtest/gtest.h> 12 std::cout <<
"ctor" << std::endl;
19 if( getInput(
"in_port_A", val_A) &&
20 getInput(
"in_port_B", val_B) &&
21 val_A == 42 && val_B == 66)
30 return { BT::InputPort<int>(
"in_port_A", 42,
"magic_number"),
31 BT::InputPort<int>(
"in_port_B") };
35 TEST(PortTest, DefaultPorts)
37 std::string xml_txt = R
"( 38 <root main_tree_to_execute = "MainTree" > 39 <BehaviorTree ID="MainTree"> 40 <NodeWithPorts name = "first" in_port_B="66" /> 71 if( getInput(
"int_port", val_A) &&
72 getInput(
"any_port", val_B) )
81 return { BT::InputPort<int>(
"int_port"),
82 BT::InputPort<MyType>(
"any_port") };
101 return { BT::OutputPort<int>(
"int_port"),
102 BT::OutputPort<MyType>(
"any_port") };
108 std::string xml_txt = R
"( 109 <root main_tree_to_execute = "MainTree" > 110 <BehaviorTree ID="MainTree"> 112 <NodeInPorts int_port="{ip}" any_port="{ap}" /> 113 <NodeOutPorts int_port="{ip}" any_port="{ap}" />
void registerNodeType(const std::string &ID)
NodeStatus tick()
Method to be implemented by the user.
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)
NodeWithPorts(const std::string &name, const NodeConfiguration &config)
NodeStatus tick()
Method to be implemented by the user.
NodeOutPorts(const std::string &name, const NodeConfiguration &config)