#include <memory>

#include "rclcpp/rclcpp.hpp"
#include "rclcpp_components/component_manager.hpp"

#include "vehicle_agent_gateway/chassis_bridge_node.hpp"
#include "vehicle_agent_gateway/control_bridge_node.hpp"

int main(int argc, char * argv[])
{
  rclcpp::init(argc, argv);

  // 同一进程内同时运行底盘和运控网关节点，共享线程池。
  rclcpp::executors::MultiThreadedExecutor executor;

  auto chassis_node = std::make_shared<vehicle_agent_gateway::ChassisBridgeNode>();
  auto control_node = std::make_shared<vehicle_agent_gateway::ControlBridgeNode>();

  executor.add_node(chassis_node);
  executor.add_node(control_node);
  executor.spin();

  rclcpp::shutdown();
  return 0;
}
