Skip to content

Commit

Permalink
Add interaction node
Browse files Browse the repository at this point in the history
  • Loading branch information
GregoryLeMasurier committed Apr 18, 2024
1 parent a25e96d commit 0f9ebb2
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion include/behaviortree_cpp/action_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class ActionNodeBase : public LeafNode
ActionNodeBase(const std::string& name, const NodeConfig& config);
~ActionNodeBase() override = default;

virtual NodeType type() const override final
virtual NodeType type() const override
{
return NodeType::ACTION;
}
Expand Down
1 change: 1 addition & 0 deletions include/behaviortree_cpp/basic_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ enum class NodeType
{
UNDEFINED = 0,
ACTION,
INTERACTION,
CONDITION,
ASSUMPTIONCHECKER,
CONTROL,
Expand Down
25 changes: 25 additions & 0 deletions include/behaviortree_cpp/interaction_node.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#ifndef INTERACTIONNODE_H
#define INTERACTIONNODE_H

#include "leaf_node.h"
#include "behaviortree_cpp/action_node.h"

namespace BT
{
class InteractionNode : public SyncActionNode
{
public:
InteractionNode(const std::string& name, const NodeConfig& config);
~InteractionNode() override = default;

/// throws if the derived class return RUNNING.
virtual NodeStatus executeTick() override;

virtual NodeType type() const override final
{
return NodeType::INTERACTION;
}
};
} // namespace BT

#endif
8 changes: 8 additions & 0 deletions src/interaction_node.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include "behaviortree_cpp/interaction_node.h"

namespace BT
{
InteractionNode::InteractionNode(const std::string& name, const NodeConfig& config)
: SyncActionNode(name, config)
{}
}

0 comments on commit 0f9ebb2

Please sign in to comment.