Skip to content
Merged
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
12 changes: 12 additions & 0 deletions sample_nodes/dummy_nodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ BT::NodeStatus CheckBattery()
return BT::NodeStatus::SUCCESS;
}

BT::NodeStatus CheckTemperature()
{
std::cout << "[ Temperature: OK ]" << std::endl;
return BT::NodeStatus::SUCCESS;
}

BT::NodeStatus SayHello()
{
std::cout << "Robot says: Hello World" << std::endl;
return BT::NodeStatus::SUCCESS;
}

BT::NodeStatus GripperInterface::open()
{
_opened = true;
Expand Down
5 changes: 5 additions & 0 deletions sample_nodes/dummy_nodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ namespace DummyNodes

BT::NodeStatus CheckBattery();

BT::NodeStatus CheckTemperature();
BT::NodeStatus SayHello();

class GripperInterface
{
public:
Expand Down Expand Up @@ -69,6 +72,8 @@ inline void RegisterNodes(BT::BehaviorTreeFactory& factory)
static GripperInterface grip_singleton;

factory.registerSimpleCondition("CheckBattery", std::bind(CheckBattery));
factory.registerSimpleCondition("CheckTemperature", std::bind(CheckTemperature));
factory.registerSimpleAction("SayHello", std::bind(SayHello));
factory.registerSimpleAction("OpenGripper", std::bind(&GripperInterface::open, &grip_singleton));
factory.registerSimpleAction("CloseGripper", std::bind(&GripperInterface::close, &grip_singleton));
factory.registerNodeType<ApproachObject>("ApproachObject");
Expand Down