Function mrpt::ros2bridge::toROS(const mrpt::obs::CObservationGPS&, const std_msgs::msg::Header&, gps_msgs::msg::GPSFix&)

Function Documentation

bool mrpt::ros2bridge::toROS(const mrpt::obs::CObservationGPS &obj, const std_msgs::msg::Header &msg_header, gps_msgs::msg::GPSFix &msg)

Convert mrpt::obs::CObservationGPS -> gps_msgs/GPSFix

The user must supply the “msg_header” field to be copied into the output message object, since that part does not appear in MRPT classes.

This function extracts data from multiple GNSS messages if available:

  • Message_NMEA_GGA: position, altitude, fix quality, HDOP, satellites

  • Message_NMEA_RMC: speed, track/direction

  • Message_NMEA_VTG: ground speed, track (used if RMC not available)

  • Message_NMEA_GSA: DOP values

Fields not available in MRPT messages will be set to 0 or NaN as appropriate.

Returns:

true if at least GGA message is present, false otherwise.