Skip to content

Commit

Permalink
GPS_STATUS Plugin: Fill in available messages for ROS1 legacy
Browse files Browse the repository at this point in the history
Filled in available fields in GPS_RAW_INT & GPS2_RAW messages

p.s. seems GPS2_RAW more complete than original GPS_RAW_INT
  • Loading branch information
SwiftGust authored Oct 12, 2023
1 parent 78b527b commit cf9a1cf
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions mavros_extras/src/plugins/gps_status.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class GpsStatusPlugin : public plugin::PluginBase {
ros_msg->hdg_acc = mav_msg.hdg_acc;
ros_msg->dgps_numch = UINT8_MAX; // information not available in GPS_RAW_INT mavlink message
ros_msg->dgps_age = UINT32_MAX;// information not available in GPS_RAW_INT mavlink message
ros_msg->yaw = mav_msg.yaw;

gps1_raw_pub.publish(ros_msg);
}
Expand All @@ -103,13 +104,14 @@ class GpsStatusPlugin : public plugin::PluginBase {
ros_msg->vel = mav_msg.vel;
ros_msg->cog = mav_msg.cog;
ros_msg->satellites_visible = mav_msg.satellites_visible;
ros_msg->alt_ellipsoid = INT32_MAX; // information not available in GPS2_RAW mavlink message
ros_msg->h_acc = UINT32_MAX;// information not available in GPS2_RAW mavlink message
ros_msg->v_acc = UINT32_MAX;// information not available in GPS2_RAW mavlink message
ros_msg->vel_acc = UINT32_MAX;// information not available in GPS2_RAW mavlink message
ros_msg->hdg_acc = UINT32_MAX;// information not available in GPS2_RAW mavlink message
ros_msg->alt_ellipsoid = mav_msg.alt_ellipsoid;
ros_msg->h_acc = mav_msg.h_acc;
ros_msg->v_acc = mav_msg.v_acc;
ros_msg->vel_acc = mav_msg.vel_acc;
ros_msg->hdg_acc = mav_msg.hdg_acc
ros_msg->dgps_numch = mav_msg.dgps_numch;
ros_msg->dgps_age = mav_msg.dgps_age;
ros_msg->yaw = mav_msg.yaw;

gps2_raw_pub.publish(ros_msg);
}
Expand Down

0 comments on commit cf9a1cf

Please sign in to comment.