2
3
4
5
6
7
8
9
10
11
12
16#include "behaviortree_cpp/action_node.h"
17#include "behaviortree_cpp/scripting/script_parser.hpp"
22
23
24
25
26
27
28
29
30
31
32
36 ScriptNode(
const std::string& name,
const NodeConfig& config)
39 setRegistrationID(
"ScriptNode");
44 static PortsList providedPorts()
46 return { InputPort<std::string>(
"code",
"Piece of code that can be parsed") };
55 Ast::
Environment env = { config().blackboard, config().enums };
64 if(!getInput(
"code", script))
66 throw RuntimeError(
"Missing port [code] in Script");
72 auto executor = ParseScript(script);
75 throw RuntimeError(executor.error());
79 _executor = executor.value();
85 ScriptFunction _executor;
The ScriptNode executes a piece of script code to set or modify entries in the Blackboard.
Definition: script_node.h:34
The SyncActionNode is an ActionNode that explicitly prevents the status RUNNING and doesn't require a...
Definition: action_node.h:57
Definition: action_node.h:24
NodeStatus
Definition: basic_types.h:34
The Environment class is used to encapsulate the information and states needed by the scripting langu...
Definition: script_parser.hpp:32
Definition: tree_node.h:105