Skip to content

Commit 177fff0

Browse files
committed
parent_prt_ as ControlNode*
1 parent 47b1ffe commit 177fff0

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

include/behaviortree_cpp/control_node.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
namespace BT
2121
{
22+
2223
class ControlNode : public TreeNode
2324
{
2425
protected:

include/behaviortree_cpp/tree_node.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,13 @@
2727
#pragma warning(disable : 4127)
2828
#endif
2929

30+
3031
namespace BT
3132
{
33+
34+
class ControlNode;
35+
36+
3237
/// This information is used mostly by the XMLParser.
3338
struct TreeNodeManifest
3439
{
@@ -148,9 +153,9 @@ class TreeNode
148153
static StringView stripBlackboardPointer(StringView str);
149154

150155
static Optional<StringView> getRemappedKey(StringView port_name, StringView remapping_value);
151-
void set_parent_prt(TreeNode *parent_ptr);
156+
void set_parent_prt(ControlNode *parent_ptr);
152157

153-
TreeNode* parent_prt() const;
158+
ControlNode *parent_prt() const;
154159
unsigned int child_index() const;
155160
void set_child_index(unsigned int child_index);
156161

@@ -169,7 +174,7 @@ class TreeNode
169174
void modifyPortsRemapping(const PortsRemapping& new_remapping);
170175
unsigned int child_index_;
171176

172-
TreeNode* parent_prt_ = nullptr;
177+
ControlNode* parent_prt_ = nullptr;
173178

174179
private:
175180
const std::string name_;

src/controls/reactive_fallback.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ NodeStatus ReactiveFallback::tick()
4646
// std::cout << name() << " is propagating halt to" << ((ControlNode*)parent_prt_)->name() << std::endl;
4747

4848

49-
((ControlNode*)parent_prt_)->propagateHalt(child_index_);
49+
parent_prt_->propagateHalt(child_index_);
5050
}
5151

5252

src/controls/reactive_sequence.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ NodeStatus ReactiveSequence::tick()
5050
// std::cout << name() << " is propagating halt to" << ((ControlNode*)parent_prt_)->name() << std::endl;
5151

5252

53-
((ControlNode*)parent_prt_)->propagateHalt(child_index_);
53+
parent_prt_->propagateHalt(child_index_);
5454
}
5555

5656
current_child_node->executeTick();

src/tree_node.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
#include "behaviortree_cpp/tree_node.h"
1515
#include <cstring>
16-
//#include <behaviortree_cpp/control_node.h>
16+
#include <behaviortree_cpp/control_node.h>
1717

1818
namespace BT
1919
{
@@ -172,12 +172,12 @@ void TreeNode::set_child_index(unsigned int child_index)
172172
child_index_ = child_index;
173173
}
174174

175-
void TreeNode::set_parent_prt(TreeNode *parent_ptr)
175+
void TreeNode::set_parent_prt(ControlNode *parent_ptr)
176176
{
177177
parent_prt_ = parent_ptr;
178178
}
179179

180-
TreeNode *TreeNode::parent_prt() const
180+
ControlNode *TreeNode::parent_prt() const
181181
{
182182
return parent_prt_;
183183
}

0 commit comments

Comments
 (0)