Added mg_bt

This commit is contained in:
2025-04-11 12:10:02 +02:00
parent f064bcfc69
commit 2d0f8279c0
15 changed files with 604 additions and 0 deletions

23
mg_bt/src/mg_bt.cpp Normal file
View 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;
}