20 registerNodeType<FallbackNode>(
"Fallback");
21 registerNodeType<FallbackStarNode>(
"FallbackStar");
22 registerNodeType<SequenceNode>(
"Sequence");
23 registerNodeType<SequenceStarNode>(
"SequenceStar");
24 registerNodeType<ParallelNode>(
"ParallelNode");
26 registerNodeType<InverterNode>(
"Inverter");
27 registerNodeType<RetryNode>(
"RetryUntilSuccesful");
28 registerNodeType<RepeatNode>(
"Repeat");
29 registerNodeType<TimeoutNode>(
"Timeout");
31 registerNodeType<ForceSuccessDecorator>(
"ForceSuccess");
32 registerNodeType<ForceFailureDecorator>(
"ForceFailure");
34 registerNodeType<AlwaysSuccess>(
"AlwaysSuccess");
35 registerNodeType<AlwaysFailure>(
"AlwaysFailure");
36 registerNodeType<SetBlackboard>(
"SetBlackboard");
38 registerNodeType<DecoratorSubtreeNode>(
"SubTree");
40 registerNodeType<BlackboardPreconditionNode<int>>(
"BlackboardCheckInt");
41 registerNodeType<BlackboardPreconditionNode<double>>(
"BlackboardCheckDouble");
42 registerNodeType<BlackboardPreconditionNode<std::string>>(
"BlackboardCheckString");
89 return std::unique_ptr<TreeNode>(
new SimpleActionNode(name, tick_functor, params));
110 loader.
load(file_path);
120 std::cout <<
"ERROR loading library [" << file_path <<
"]: can't find symbol [" 126 const std::string& ID,
const std::string& name,
133 std::cerr << ID <<
" not included in this list:" << std::endl;
136 std::cerr << it.first << std::endl;
138 throw std::invalid_argument(
"ID '" + ID +
"' not registered");
140 std::unique_ptr<TreeNode> node = it->second(name, params);
141 node->setRegistrationName(ID);
142 node->setBlackboard(blackboard);
143 node->initializeOnce();
void sortTreeNodeManifests()
std::map< std::string, NodeBuilder > builders_
std::vector< TreeNodeManifest > manifests_
The SimpleConditionNode provides an easy to use ConditionNode. The user should simply provide a callb...
std::function< NodeStatus(NodeStatus, TreeNode &)> TickFunctor
std::set< std::string > builtin_IDs_
std::shared_ptr< Blackboard > Ptr
const std::set< std::string > & builtinNodes() const
This information is used mostly by the XMLParser.
void registerSimpleCondition(const std::string &ID, const SimpleConditionNode::TickFunctor &tick_functor)
Register a SimpleConditionNode.
bool hasSymbol(const std::string &name)
Returns true iff a library has been loaded.
The SimpleDecoratorNode provides an easy to use DecoratorNode. The user should simply provide a callb...
const char * toStr(const BT::NodeStatus &status, bool colored=false)
toStr converts NodeStatus to string. Optionally colored.
void registerBuilder(const TreeNodeManifest &manifest, NodeBuilder builder)
std::unordered_map< std::string, std::string > NodeParameters
std::unique_ptr< TreeNode > instantiateTreeNode(const std::string &ID, const std::string &name, const NodeParameters ¶ms, const Blackboard::Ptr &blackboard) const
instantiateTreeNode creates a TreeNode
void * getSymbol(const std::string &name)
std::string registration_ID
void registerSimpleAction(const std::string &ID, const SimpleActionNode::TickFunctor &tick_functor)
Register a SimpleActionNode.
const char PLUGIN_SYMBOL[]
std::function< NodeStatus(TreeNode &)> TickFunctor
void load(const std::string &path, int flags=0)
void registerFromPlugin(const std::string file_path)
registerFromPlugin load a shared library and execute the function BT_REGISTER_NODES (see macro)...
The SimpleActionNode provides an easy to use ActionNode. The user should simply provide a callback wi...
const std::map< std::string, NodeBuilder > & builders() const
All the builders. Made available mostly for debug purposes.
void registerSimpleDecorator(const std::string &ID, const SimpleDecoratorNode::TickFunctor &tick_functor)
Register a SimpleDecoratorNode.
std::function< std::unique_ptr< TreeNode >const std::string &, const NodeParameters &)> NodeBuilder
The term "Builder" refers to the Builder Pattern (https://en.wikipedia.org/wiki/Builder_pattern) ...
bool unregisterBuilder(const std::string &ID)
const std::vector< TreeNodeManifest > & manifests() const
Manifests of all the registered TreeNodes.
std::function< NodeStatus(TreeNode &)> TickFunctor