From 1e2113866804ce3bf3e4299022d807f1d1b4b82f Mon Sep 17 00:00:00 2001 From: lyf <169361657@qq.com> Date: Thu, 4 Dec 2025 22:48:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MindVisionMain.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/MindVisionMain.cpp b/src/MindVisionMain.cpp index 185922a..ef7cce8 100644 --- a/src/MindVisionMain.cpp +++ b/src/MindVisionMain.cpp @@ -45,7 +45,7 @@ void output_control_data(const cv::Point2f* ballistic_point, else if (target_color == "blue") simplified_color = "b"; // Construct send string - send_str << "s " << simplified_color << " " << std::to_string(ballistic_offset_x) << " " << std::to_string(ballistic_offset_y) << "\n"; + send_str << "#s " << simplified_color << " " << std::to_string(ballistic_offset_x) << " " << std::to_string(ballistic_offset_y) << "*\n"; // Send data if (ttl_communicator != nullptr) { @@ -78,15 +78,7 @@ int main(int /*argc*/, char* /*argv*/[]) { if (Numbe == 0) { // 执行 shell 命令(注意安全风险!) - int result = std::system("soude chmod 777 /dev/tty*"); - - // 可选:检查命令是否成功执行 - if (result == -1) { - std::cerr << "Failed to execute system command.\n"; - } else { - std::cout << "Permissions updated (if any tty devices exist).\n"; - } - + std::system("sudo chmod 777 /dev/tty*"); Numbe++; }