Skip to content

Make sequence node inheritable #996

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions include/behaviortree_cpp/controls/sequence_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ namespace BT
class SequenceNode : public ControlNode
{
public:
SequenceNode(const std::string& name, bool make_async = false);
SequenceNode(const std::string& name, bool make_async = false,
const NodeConfiguration& conf = NodeConfiguration());

virtual ~SequenceNode() override = default;

Expand All @@ -43,11 +44,11 @@ class SequenceNode : public ControlNode
protected:
size_t current_child_idx_;

virtual BT::NodeStatus tick() override;

private:
size_t skipped_count_ = 0;
bool asynch_ = false;

virtual BT::NodeStatus tick() override;
};

} // namespace BT
5 changes: 3 additions & 2 deletions src/controls/sequence_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@

namespace BT
{
SequenceNode::SequenceNode(const std::string& name, bool make_async)
: ControlNode::ControlNode(name, {}), current_child_idx_(0), asynch_(make_async)
SequenceNode::SequenceNode(const std::string& name, bool make_async,
const NodeConfiguration& conf)
: ControlNode::ControlNode(name, conf), current_child_idx_(0), asynch_(make_async)
{
if(asynch_)
setRegistrationID("AsyncSequence");
Expand Down
Loading