From d69cc29ec901f1e5a0770c8a32f326677267640d Mon Sep 17 00:00:00 2001 From: lyq Date: Mon, 12 Jan 2026 11:24:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=89=93=E5=8D=B0=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/autonomy/route/src/route_node.cpp | 18 ++++++++++++------ src/communication/pub_gps/src/pub_gps_node.cpp | 4 ++-- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/autonomy/route/src/route_node.cpp b/src/autonomy/route/src/route_node.cpp index fea33f7..23e7b13 100644 --- a/src/autonomy/route/src/route_node.cpp +++ b/src/autonomy/route/src/route_node.cpp @@ -133,11 +133,13 @@ private: if (!isCollecting) { - cout << "等待采集...." << endl; + // cout << "等待采集...." << endl; + RCLCPP_INFO(this->get_logger(), "等待采集....."); } else { - cout << "平台采集中" << endl; + // cout << "平台采集中" << endl; + RCLCPP_INFO(this->get_logger(), "平台采集中....."); } } void sub_callback(const sweeper_interfaces::msg::Sub::SharedPtr msg) @@ -146,21 +148,25 @@ private: { std::lock_guard lock(collect_mutex); // 加锁 isCollecting = true; - cout << "平台开始采集" << endl; + // cout << "平台开始采集" << endl; + RCLCPP_INFO(this->get_logger(), "平台开始采集"); pthread_create(&route_thread_t, NULL, route_thread, NULL); } else if (!msg->get_route && isCollecting) { isCollecting = false; - cout << "平台结束采集" << endl; + // cout << "平台结束采集" << endl; + RCLCPP_INFO(this->get_logger(), "平台结束采集"); pthread_cancel(route_thread_t); if (upload_file(filename)) { - cout << "上传成功" << endl; + // cout << "上传成功" << endl; + RCLCPP_INFO(this->get_logger(), "上传成功"); } else { - cout << "上传失败" << endl; + // cout << "上传失败" << endl; + RCLCPP_INFO(this->get_logger(), "上传失败"); } } } diff --git a/src/communication/pub_gps/src/pub_gps_node.cpp b/src/communication/pub_gps/src/pub_gps_node.cpp index 07ba726..6bbe8e9 100644 --- a/src/communication/pub_gps/src/pub_gps_node.cpp +++ b/src/communication/pub_gps/src/pub_gps_node.cpp @@ -179,8 +179,8 @@ void *mqtt_pub_gps(void *arg) &token_d_m); if (rc == MQTTCLIENT_SUCCESS) { - std::cout << "[MQTT] Published to topic: " << g_conf.pub_gps_topic - << "\n msg: " << json_string << std::endl; + // std::cout << "[MQTT] Published to topic: " << g_conf.pub_gps_topic + // << "\n msg: " << json_string << std::endl; MQTTClient_waitForCompletion(client, token_d_m, g_conf.timeout_ms); } else