Fix fake GPS velocity frame and COG units - #2261
Open
Daniiiil1 wants to merge 2 commits into
Open
Conversation
Signed-off-by: Daniil Mordanov <mordanovdania@gmail.com>
Daniiiil1
marked this pull request as ready for review
August 10, 2026 08:39
Member
|
@Daniiiil1 please fix cmake includes for this test. |
vooon
reviewed
Aug 10, 2026
| } | ||
|
|
||
| return static_cast<uint16_t>(std::lround(course_deg * 100.0)) % 36000; | ||
| } |
Member
There was a problem hiding this comment.
Maybe worth to move to generic frame_tf.hpp?
|
@Daniiiil1 Great! Thank you for resolving this issue that has been troubling me for a long time. Prior to this, I could only work around it by writing a separate module to bypass MAVROS's fake GPS. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Fixes the fake GPS velocity and course fields reported in #2091.
Root cause
send_fake_gps()differentiated ECEF positions, reversed the displacement sign, and then wrote those ECEF components directly into MAVLink fields documented as North/East/Down. The HIL_GPS course calculation also produced radians but stored the result as centidegrees. The first sample additionally used uninitialized previous-position state.Changes
Validation
git diff --checkThe ROS 2 toolchain is not available on the local macOS host, so the package test target is left for the repository CI matrix.
Closes #2091