Fix: Corrected compass calibration result report to match mavlink doc… #2035
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.
Summary
Improves parsing and publishing of MAG_CAL_REPORT (MAVLink message ID 192) in the
mag_calibration
plugin.This update aligns the
MagnetometerReporter.msg
structure with the official MAVLink documentation and ensures complete and accurate calibration report transmission via ROS 2 topic.Details
MagnetometerReporter.msg
to include all fields defined in MAG_CAL_REPORT, such as:fitness
(calibration quality metric)ofs_x
,ofs_y
,ofs_z
diag_x
,diag_y
,diag_z
offdiag_x
,offdiag_y
,offdiag_z
orientation_confidence
,old_orientation
,new_orientation
scale_factor
,report
,autosaved
,cal_mask
, etc.mag_calibration_status.cpp
to:MagnetometerReporter
ROS 2 message with all available data/mavros/mag_calibration/report
contains accurate and complete information after compass calibration procedures.Testing
ros2 service call /mavros/cmd/command
with:✅ Observed output on ROS 2 topic:
ros2 topic echo /mavros/mag_calibration/report
📉 Before Fix (partial/incomplete output):
📈 After Fix (fully populated according to MAVLink spec)
Motivation
Without this fix, the /mavros/mag_calibration/report topic published incomplete messages lacking critical calibration feedback fields like fitness, offsets, or orientation metrics.
This caused limited visibility for developers and GCS tools using MAVROS in ROS 2 setups.
With this PR, the message now reflects the full MAVLink MAG_CAL_REPORT, improving integration and diagnostics.