Go to the documentation of this file.
30 auto shared_queue = std::make_shared<std::deque<Pose2D>>();
31 for(
int i = 0; i < 5; i++)
33 shared_queue->push_back(
Pose2D{ double(i), double(i), 0 });
35 setOutput(
"waypoints", shared_queue);
41 return { OutputPort<SharedQueue<Pose2D>>(
"waypoints") };
55 if(getInput(
"value", value))
57 std::cout <<
"PrintNumber: " << value <<
"\n";
65 return { InputPort<double>(
"value") };
84 if(getInput(
"waypoint", wp))
86 std::this_thread::sleep_for(std::chrono::milliseconds(100));
87 std::cout <<
"Using waypoint: " << wp.
x <<
"/" << wp.
y << std::endl;
98 return { InputPort<Pose2D>(
"waypoint") };
104 <root BTCPP_format="4" >
105 <BehaviorTree ID="TreeA">
107 <LoopDouble queue="1;2;3" value="{number}">
108 <PrintNumber value="{number}" />
111 <GenerateWaypoints waypoints="{waypoints}" />
112 <LoopPose queue="{waypoints}" value="{wp}">
113 <UseWaypoint waypoint="{wp}" />
135 logger.enableTransitionToIdle(
false);
137 tree.tickWhileRunning();
NodeStatus tick() override
Method to be implemented by the user.
UseWaypoint(const std::string &name, const NodeConfig &config)
The LoopNode class is used to pop_front elements from a std::deque. This element is copied into the p...
static const char * xml_tree
std::unordered_map< std::string, PortInfo > PortsList
Simple Action that uses the output of PopFromQueue<Pose2D> or ConsumeQueue<Pose2D>
static PortsList providedPorts()
void registerNodeType(const std::string &ID, const PortsList &ports, ExtraArgs... args)
Tree createTreeFromText(const std::string &text, Blackboard::Ptr blackboard=Blackboard::create())
createTreeFromText will parse the XML directly from string. The XML needs to contain either a single ...
PrintNumber(const std::string &name, const NodeConfig &config)
The BehaviorTreeFactory is used to create instances of a TreeNode at run-time.
Dummy action that generates a list of poses.
GenerateWaypoints(const std::string &name, const NodeConfig &config)
static PortsList providedPorts()
NodeStatus tick() override
Method to be implemented by the user.
The ThreadedAction executes the tick in a different thread.
NodeStatus tick() override
Method to be implemented by the user.
The SyncActionNode is an ActionNode that explicitly prevents the status RUNNING and doesn't require a...
static PortsList providedPorts()
StdCoutLogger is a very simple logger that displays all the transitions on the console.