22 printf(
"Converting string: \"%s\"\n", str.data());
26 if (parts.size() != 2)
50 setOutput(
"goal", mygoal);
55 return {OutputPort<Position2D>(
"goal")};
68 auto res = getInput<Position2D>(
"target");
71 throw RuntimeError(
"error reading port [target]:", res.error());
74 printf(
"Target positions: [ %.1f, %.1f ]\n", goal.x, goal.y);
81 const char* description =
"Simply print the target on console...";
82 return {InputPort<Position2D>(
"target", description)};
106 <root main_tree_to_execute = "MainTree" > 107 <BehaviorTree ID="MainTree"> 108 <Sequence name="root"> 109 <CalculateGoal goal="{GoalPosition}" /> 110 <PrintTarget target="{GoalPosition}" /> 111 <SetBlackboard output_key="OtherGoal" value="-1;3" /> 112 <PrintTarget target="{OtherGoal}" /> 129 tree.tickRootWhileRunning();
void registerNodeType(const std::string &ID)
static PortsList providedPorts()
NodeStatus tick() override
Method to be implemented by the user.
CalculateGoal(const std::string &name, const NodeConfiguration &config)
static PortsList providedPorts()
NodeStatus tick() override
Method to be implemented by the user.
PrintTarget(const std::string &name, const NodeConfiguration &config)
std::vector< StringView > splitString(const StringView &strToSplit, char delimeter)
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.
nonstd::string_view StringView
Tree createTreeFromText(const std::string &text, Blackboard::Ptr blackboard=Blackboard::create())
static const char * xml_text
std::unordered_map< std::string, PortInfo > PortsList
double convertFromString< double >(StringView str)
Point3D convertFromString(StringView key)