MCPcopy Create free account
hub / github.com/BehaviorTree/BehaviorTree.ROS2 / main

Function main

btcpp_ros2_samples/src/sleep_client.cpp:66–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64 )";
65
66int main(int argc, char** argv)
67{
68 rclcpp::init(argc, argv);
69 auto nh = std::make_shared<rclcpp::Node>("sleep_client");
70
71 BehaviorTreeFactory factory;
72
73 factory.registerNodeType<PrintValue>("PrintValue");
74
75 RosNodeParams params;
76 params.nh = nh;
77 params.default_port_value = "sleep_service";
78
79#ifdef USE_SLEEP_PLUGIN
80 RegisterRosNode(factory, "../lib/libsleep_action_plugin.so", params);
81#else
82 factory.registerNodeType<SleepAction>("SleepAction", params);
83#endif
84
85 auto tree = factory.createTreeFromText(xml_text);
86
87 for(int i = 0; i < 5; i++)
88 {
89 tree.tickWhileRunning();
90 }
91
92 return 0;
93}

Callers

nothing calls this directly

Calls 1

RegisterRosNodeFunction · 0.85

Tested by

no test coverage detected