Added mg_bt
This commit is contained in:
23
mg_bt/src/mg_bt.cpp
Normal file
23
mg_bt/src/mg_bt.cpp
Normal file
@ -0,0 +1,23 @@
|
||||
#include <iostream>
|
||||
|
||||
#include "mg_tree_executor.hpp"
|
||||
|
||||
int main(const int argc, const char** argv) {
|
||||
rclcpp::init(argc, argv);
|
||||
|
||||
std::cout << "Starting up Behavior Tree Executor" << std::endl;
|
||||
|
||||
rclcpp::NodeOptions options;
|
||||
|
||||
auto bt_exec_server = std::make_shared<mg::MgTreeExecutor>(options);
|
||||
|
||||
rclcpp::executors::MultiThreadedExecutor executor(
|
||||
rclcpp::ExecutorOptions(), 0, false, std::chrono::milliseconds(250));
|
||||
|
||||
executor.add_node(bt_exec_server->node());
|
||||
executor.spin();
|
||||
executor.remove_node(bt_exec_server->node());
|
||||
|
||||
rclcpp::shutdown();
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user