Go to the documentation of this file.
22 printf(
"Converting string: \"%s\"\n", str.data());
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 BTCPP_format="4" >
107 <BehaviorTree ID="MainTree">
108 <Sequence name="root">
109 <CalculateGoal goal="{GoalPosition}" />
110 <PrintTarget target="{GoalPosition}" />
111 <Script code="OtherGoal='-1;3'" />
112 <PrintTarget target="{OtherGoal}" />
130 tree.tickWhileRunning();
static const char * xml_text
CalculateGoal(const std::string &name, const NodeConfig &config)
std::string_view StringView
NodeStatus tick() override
Method to be implemented by the user.
static PortsList providedPorts()
std::unordered_map< std::string, PortInfo > PortsList
Point3D convertFromString(StringView key)
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 ...
std::vector< StringView > splitString(const StringView &strToSplit, char delimeter)
NodeStatus tick() override
Method to be implemented by the user.
The BehaviorTreeFactory is used to create instances of a TreeNode at run-time.
PrintTarget(const std::string &name, const NodeConfig &config)
double convertFromString< double >(StringView str)
The SyncActionNode is an ActionNode that explicitly prevents the status RUNNING and doesn't require a...
static PortsList providedPorts()