diff --git a/src/message_handler.cpp b/src/message_handler.cpp index d8cb447..4b5bafc 100644 --- a/src/message_handler.cpp +++ b/src/message_handler.cpp @@ -1,5 +1,4 @@ -#include -#include +#include #include #include #include @@ -9,8 +8,6 @@ #include "methane_serial_port.hpp" #include "config.hpp" -namespace fs = std::filesystem; - int main() { //启动TCP服务端 std::thread service_thread([] { @@ -42,37 +39,9 @@ } }); - // 拉起第三方脚本 - // std::thread script_thread([] { - // fs::current_path(Config::SLAM_SCRIPT_PATH); - // for (const auto &entry: fs::directory_iterator(fs::current_path())) { - // if (entry.is_regular_file() && entry.path().extension() == ".sh") { - // const auto script_path = entry.path(); - // if (const pid_t pid = fork(); pid == 0) { - // // 子进程执行脚本 - // std::ostringstream cmd_ss; - // cmd_ss << "./" - // << script_path.filename().string() - // << " > " - // << Config::SLAM_LOG_FILE << " 2>&1"; - // const std::string command = cmd_ss.str(); - // - // execl("/bin/sh", "sh", "-c", command.c_str(), nullptr); - // // 如果执行失败 - // std::cerr << "\033[33m" - // << "Failed to execute script." - // << "\033[0m" << std::endl; - // exit(EXIT_FAILURE); - // } - // break; - // } - // } - // }); - // 等待所有线程完成 service_thread.join(); client_thread.join(); gas_serial_port_thread.join(); - // script_thread.join(); return 0; }