#pragma once

#include <rclcpp/rclcpp.hpp>
#include <behaviortree_cpp_v3/bt_factory.h>
#include <thread>
#include <atomic>
#include <string>

namespace agv_calib_core {

// 继承 Node，化身为标准的 ROS 2 Component
class BrainNode : public rclcpp::Node {
public:
    explicit BrainNode(const rclcpp::NodeOptions & options);
    ~BrainNode() override;

private:
    // 行为树专属的后台执行线程 (极其重要！绝不能阻塞 ROS 2 容器主线程)
    void execute_behavior_tree();

    std::thread bt_thread_;
    std::atomic<bool> is_running_;
};

} // namespace agv_calib_core