Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 58ec28f

Browse files
author
Davide Faconti
committed
call setRegistrationName() for built-in Nodes
The methos is called by BehaviorTreefactory, therefore it registrationName is empty if trees are created programmatically.
1 parent d6a61ad commit 58ec28f

14 files changed

+24
-3
lines changed

include/behaviortree_cpp/decorators/blackboard_precondition.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ class BlackboardPreconditionNode : public DecoratorNode
2424
BlackboardPreconditionNode(const std::string& name, const NodeParameters& params)
2525
: DecoratorNode(name, params)
2626
{
27+
if( std::is_same<T,int>::value)
28+
setRegistrationName("BlackboardCheckInt");
29+
else if( std::is_same<T,double>::value)
30+
setRegistrationName("BlackboardCheckDouble");
31+
else if( std::is_same<T,std::string>::value)
32+
setRegistrationName("BlackboardCheckString");
2733
}
2834

2935
virtual ~BlackboardPreconditionNode() override = default;

include/behaviortree_cpp/decorators/force_failure_node.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class ForceFailureDecorator : public DecoratorNode
2222
public:
2323
ForceFailureDecorator(const std::string& name) : DecoratorNode(name, NodeParameters())
2424
{
25+
setRegistrationName("ForceFailure");
2526
}
2627

2728
private:

include/behaviortree_cpp/decorators/force_success_node.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class ForceSuccessDecorator : public DecoratorNode
2222
public:
2323
ForceSuccessDecorator(const std::string& name) : DecoratorNode(name, NodeParameters())
2424
{
25+
setRegistrationName("ForceSuccess");
2526
}
2627

2728
private:

include/behaviortree_cpp/decorators/subtree_node.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ namespace BT
88
class DecoratorSubtreeNode : public DecoratorNode
99
{
1010
public:
11-
DecoratorSubtreeNode(const std::string& name) : DecoratorNode(name, NodeParameters())
12-
{
13-
}
11+
DecoratorSubtreeNode(const std::string& name);
1412

1513
virtual ~DecoratorSubtreeNode() override = default;
1614

src/controls/fallback_node.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ namespace BT
1818
FallbackNode::FallbackNode(const std::string& name)
1919
: ControlNode::ControlNode(name, NodeParameters())
2020
{
21+
setRegistrationName("Fallback");
2122
}
2223

2324
NodeStatus FallbackNode::tick()

src/controls/fallback_star_node.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ namespace BT
1818
FallbackStarNode::FallbackStarNode(const std::string& name)
1919
: ControlNode::ControlNode(name, {}), current_child_idx_(0)
2020
{
21+
setRegistrationName("FallbackStar");
2122
}
2223

2324
NodeStatus FallbackStarNode::tick()

src/controls/parallel_node.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ ParallelNode::ParallelNode(const std::string& name, int threshold)
2323
threshold_(threshold),
2424
read_parameter_from_blackboard_(false)
2525
{
26+
setRegistrationName("Parallel");
2627
}
2728

2829
ParallelNode::ParallelNode(const std::string &name,

src/controls/sequence_node.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ namespace BT
1818
SequenceNode::SequenceNode(const std::string& name)
1919
: ControlNode::ControlNode(name, NodeParameters())
2020
{
21+
setRegistrationName("Sequence");
2122
}
2223

2324
NodeStatus SequenceNode::tick()

src/controls/sequence_star_node.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ SequenceStarNode::SequenceStarNode(const std::string& name, bool reset_on_failur
2424
, reset_on_failure_(reset_on_failure)
2525
, read_parameter_from_blackboard_(false)
2626
{
27+
setRegistrationName("SequenceStar");
2728
}
2829

2930
SequenceStarNode::SequenceStarNode(const std::string& name, const NodeParameters& params)

src/decorators/inverter_node.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ namespace BT
1717
{
1818
InverterNode::InverterNode(const std::string& name) : DecoratorNode(name, NodeParameters())
1919
{
20+
setRegistrationName("Inverter");
2021
}
2122

2223
NodeStatus InverterNode::tick()

0 commit comments

Comments
 (0)