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++; }