格式修正
This commit is contained in:
@@ -45,7 +45,7 @@ void output_control_data(const cv::Point2f* ballistic_point,
|
|||||||
else if (target_color == "blue") simplified_color = "b";
|
else if (target_color == "blue") simplified_color = "b";
|
||||||
|
|
||||||
// Construct send string
|
// 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
|
// Send data
|
||||||
if (ttl_communicator != nullptr) {
|
if (ttl_communicator != nullptr) {
|
||||||
@@ -78,15 +78,7 @@ int main(int /*argc*/, char* /*argv*/[]) {
|
|||||||
|
|
||||||
if (Numbe == 0) {
|
if (Numbe == 0) {
|
||||||
// 执行 shell 命令(注意安全风险!)
|
// 执行 shell 命令(注意安全风险!)
|
||||||
int result = std::system("soude chmod 777 /dev/tty*");
|
std::system("sudo 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";
|
|
||||||
}
|
|
||||||
|
|
||||||
Numbe++;
|
Numbe++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user