-
Notifications
You must be signed in to change notification settings - Fork 61
fix: GNSS ROS publisher never set NavSatFix.status.status #106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: MRPT/mvsim
Length of output: 2003
🏁 Script executed:
Repository: MRPT/mvsim
Length of output: 2422
🏁 Script executed:
Repository: MRPT/mvsim
Length of output: 2090
🌐 Web query:
MRPT mrpt::ros1bridge toROS CObservationGPS NavSatFix return type💡 Result:
The function mrpt::ros1bridge::toROS, used to convert an mrpt::obs::CObservationGPS object into a sensor_msgs::NavSatFix message, has a return type of bool [1][2]. The function returns true upon a successful conversion and false if an error occurs [1]. The full function signature is: bool mrpt::ros1bridge::toROS(const mrpt::obs::CObservationGPS& obj, const std_msgs::Header& msg_header, sensor_msgs::NavSatFix& msg); [1]
Citations:
🌐 Web query:
site:github.com MRPT ros1bridge toROS CObservationGPS NavSatFix bool💡 Result:
The MRPT library provides bridging functionality to convert between its
mrpt::obs::CObservationGPSdata structure and ROS navigation message types (specificallysensor_msgs/NavSatFixandgps_msgs/msg/GPSFix) [1][2][3]. In themrpt_ros_bridge(for ROS 2) andmrpt_bridge(for ROS 1), bidirectional conversion functions are provided [1][2][3]. Specifically, forsensor_msgs/NavSatFixintegration: 1. Conversion Functions: The bridge typically uses functions namedtoROS()andfromROS()(ornavSatFixToObservation()) to translate data [2][4]. 2. Boolean Flags: When performing bulk conversions—such as usingrosbag2ToGPS—the bridge often utilizes a boolean flag (e.g.,isGpsFix) to distinguish whether the target message type issensor_msgs/NavSatFixorgps_msgs/msg/GPSFix[5]. 3. Data Mapping:mrpt::obs::CObservationGPScontains internal fields such asfix_type(using theGnssFixTypeenum) andgnss_service_mask(usingGnssService) which are mapped to ROS message status fields to ensure compatibility [6][4]. Modern versions of the bridge (MRPT 2.15.11+) include version-conditional logic to handle these mappings accurately, maintaining compatibility with older ROS message definitions [4]. For implementation details, refer to themrpt::ros2bridgeormrpt_bridgeheaders, such asros_to_mrpt_obs.horgps.h, which define these conversion interfaces [5][2].Citations:
🌐 Web query:
MRPT ros2bridge gps.h CObservationGPS toROS return type bool💡 Result:
Yes, the return type of the toROS function in the mrpt::ros2bridge namespace, when converting a mrpt::obs::CObservationGPS object, is bool [1][2][3]. This function returns true upon a successful conversion and false if any error occurs during the process [1][2][4]. The bridge provides overloads for toROS to handle different target ROS message types, such as sensor_msgs::msg::NavSatFix and gps_msgs::msg::GPSFix [5][3][6].
Citations:
🌐 Web query:
site:docs.mrpt.org mrpt::ros2bridge::toROS CObservationGPS NavSatFix bool💡 Result:
The function
mrpt::ros2bridge::toROSused to convert anmrpt::obs::CObservationGPSobject to asensor_msgs::msg::NavSatFixROS 2 message has the following signature [1]: bool mrpt::ros2bridge::toROS( const mrpt::obs::CObservationGPS& obj, const std_msgs::msg::Header& msg_header, sensor_msgs::msg::NavSatFix& msg); The function returns a boolean value indicating whether the conversion was successful [2][1]. Because theCObservationGPSclass does not natively store ROS-specific header information, the user is required to provide an explicitstd_msgs::msg::Headerobject, which is then copied into the resultingNavSatFixmessage [3][1]. Note: As of MRPT 3.0, themrpt-ros2bridgelibrary has been separated from the core MRPT repository and is maintained in its own repository at https://github.com/MRPT/mrpt_ros_bridge [4].Citations:
🌐 Web query:
site:github.com/MRPT/mrpt_ros_bridge gps.h toROS CObservationGPS NavSatFix💡 Result:
In the context of the MRPT (Mobile Robot Programming Toolkit) ROS bridge, conversion between MRPT's CObservationGPS and ROS's NavSatFix messages is handled through specific utility functions defined within the mrpt_ros_bridge package [1][2]. Header and Implementation Conversion logic is typically found in the header file mrpt/ros2bridge/gps.h and implemented in the corresponding source file mrpt/ros2bridge/src/gps.cpp [1]. Key Functionality The bridge provides bidirectional conversion functions: 1. toROS: Converts an mrpt::obs::CObservationGPS object into a sensor_msgs::msg::NavSatFix message [1]. 2. fromROS: Converts a sensor_msgs::msg::NavSatFix message into an mrpt::obs::CObservationGPS observation [1]. These functions manage the mapping between NMEA-based data (GGA, RMC, VTG, GSA) within MRPT and the standard ROS NavSatFix fields, including timestamp synchronization, coordinate mapping, and status/covariance propagation [1][3]. Recent updates to the bridge have added support for more advanced GPS messages (such as gps_msgs::msg::GPSFix) and version-conditional logic to support newer MRPT GNSS fix types while maintaining backward compatibility [1][3][4]. Usage Pattern While specific headers may vary by version, the standard pattern for using these bridge functions involves including the appropriate header and passing the source object to the conversion utility, similar to other MRPT-ROS type conversions [2]: // Conceptual example
#include<mrpt/ros2bridge/gps.h>#include<sensor_msgs/msg/nav_sat_fix.hpp>#include<mrpt/obs/CObservationGPS.h> // MRPT to ROS mrpt::obs::CObservationGPS mrpt_obs; sensor_msgs::msg::NavSatFix ros_msg; mrpt::ros2bridge::toROS(mrpt_obs, ros_msg);Citations:
Check
mrpt2ros::toROS(...)result hereIt returns
falseon conversion errors, so ignoring it can silently drop malformed GPS observations. Handle the failure path before publishing.🤖 Prompt for AI Agents