This commit is contained in:
Alvin-lyq 2026-04-29 14:29:09 +08:00
parent 9c6673c0a2
commit a61a21e691

View File

@ -40,14 +40,14 @@ class RtkAsensingNode : public rclcpp::Node
{ {
auto rtk_msg = sweeper_interfaces::msg::Rtk(); auto rtk_msg = sweeper_interfaces::msg::Rtk();
// 从 /Ins 消息中提取数据 // 从 /Ins 消息中提取数据(通过 imu_msg 子字段)
rtk_msg.lat = msg->latitude; rtk_msg.lat = msg->imu_msg.latitude;
rtk_msg.lon = msg->longitude; rtk_msg.lon = msg->imu_msg.longitude;
rtk_msg.head = msg->azimuth; rtk_msg.head = msg->imu_msg.azimuth;
rtk_msg.speed = rtk_msg.speed = std::sqrt(msg->imu_msg.north_velocity * msg->imu_msg.north_velocity +
std::sqrt(msg->north_velocity * msg->north_velocity + msg->east_velocity * msg->east_velocity); msg->imu_msg.east_velocity * msg->imu_msg.east_velocity);
rtk_msg.p_quality = msg->position_type; rtk_msg.p_quality = msg->imu_msg.position_type;
rtk_msg.h_quality = msg->heading_type; rtk_msg.h_quality = msg->imu_msg.heading_type;
LOG_INFO("Asensing RTK: lat:%.9f, lon:%.9f, heading:%.2f, speed:%.2f, p_quality:%d, h_quality:%d", LOG_INFO("Asensing RTK: lat:%.9f, lon:%.9f, heading:%.2f, speed:%.2f, p_quality:%d, h_quality:%d",
rtk_msg.lat, rtk_msg.lon, rtk_msg.head, rtk_msg.speed, rtk_msg.p_quality, rtk_msg.h_quality); rtk_msg.lat, rtk_msg.lon, rtk_msg.head, rtk_msg.speed, rtk_msg.p_quality, rtk_msg.h_quality);