Compare commits

..

No commits in common. "58656ed633d3ad6b90aa707d2671a15851de9ee8" and "06adb527c8851817291d3de40e0a35be47c2c7f1" have entirely different histories.

3 changed files with 3 additions and 2959 deletions

File diff suppressed because it is too large Load Diff

View File

@ -16,7 +16,6 @@
#include "rclcpp/rclcpp.hpp"
#include "sweeper_interfaces/msg/rtk.hpp"
#include "sweeper_interfaces/msg/sub.hpp"
#include "sweeper_interfaces/msg/vehicle_identity.hpp"
std::mutex collect_mutex; // 互斥锁,用于保护 isCollecting 变量
@ -114,11 +113,6 @@ class route_node : public rclcpp::Node
msg_subscribe_ = this->create_subscription<sweeper_interfaces::msg::Rtk>(
"rtk_message", 10, std::bind(&route_node::msg_callback, this, std::placeholders::_1));
// identitytransient_local确保晚启动也能拿到
identity_sub_ = this->create_subscription<sweeper_interfaces::msg::VehicleIdentity>(
"/vehicle/identity", rclcpp::QoS(1).transient_local().reliable(),
std::bind(&route_node::identityCallback, this, std::placeholders::_1));
}
private:
@ -176,17 +170,9 @@ class route_node : public rclcpp::Node
}
}
}
void identityCallback(const sweeper_interfaces::msg::VehicleIdentity::SharedPtr msg)
{
vid = msg->vid;
LOG_INFO("Identity: VID=%s", msg->vid.c_str());
}
// 声明订阅者
rclcpp::Subscription<sweeper_interfaces::msg::Sub>::SharedPtr sub_subscribe_;
rclcpp::Subscription<sweeper_interfaces::msg::Rtk>::SharedPtr msg_subscribe_;
rclcpp::Subscription<sweeper_interfaces::msg::VehicleIdentity>::SharedPtr identity_sub_;
};
double ntzx_GPS_length(double lonti1, double lati1, double lonti2, double lati2)
@ -243,7 +229,9 @@ void init_main()
}
if (reader.parse(in, root))
{
vid = root["mqtt"]["vid"].asString();
upload_URL = root["mqtt"]["upload_url"].asString();
LOG_INFO("vid:%s", vid.c_str());
}
in.close(); // 关闭文件流
}

View File

@ -69,7 +69,7 @@ void CanDecoder::handle_bms_101(const sweeperMsg::CanFrame& msg)
ctx_.info.power = rsoc;
}
LOG_INFO("[0x101] 充满容量: %.2f Ah, 循环次数: %d 次, 剩余容量百分比(RSOC): %.2f %%", full_capacity, cycle_count,
LOG_INFO("[0x101] 充满容量: %.2f Ah, 循环次数: %d 次, 剩余容量百分比(RSOC): %.1f %", full_capacity, cycle_count,
rsoc);
}