-
Notifications
You must be signed in to change notification settings - Fork 275
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
Added magnetometer value based on location #1907
Conversation
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
I think that we need some documentation on the derivation of these tables. It's worth-while to note that these are for a) earth only and b) only valid in a certain window (I think they are updated every 5 years). A more generic solution would allow for the consumption of the world magnetic model: https://www.ncei.noaa.gov/products/world-magnetic-model, but I understand if that's out of the scope of the current PR. |
I used this code from this other Gazebo classic plugin https://github.com/PX4/PX4-SITL_gazebo-classic/blob/5610c3fb441a2f3babc8ad7a63c8c4ce3e40abfa/src/geo_mag_declination.cpp |
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
Ah, makes sense, all good then. I think the only other thing I would request is a switch to be able to switch between a constant magnetic declination/field and a varying one. That way people can opt into the new behavior (in the unlikely case someone was depending on a constant field?) |
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
the spherical coordinates should turn on and off this feature. |
Perfect, I think that is reasonable. |
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
Codecov Report
@@ Coverage Diff @@
## gz-sim7 #1907 +/- ##
===========================================
- Coverage 64.68% 64.54% -0.15%
===========================================
Files 343 347 +4
Lines 27430 27766 +336
===========================================
+ Hits 17743 17921 +178
- Misses 9687 9845 +158
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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.
LGTM with green ci
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
CI Failures here aren't from this PR. |
🦟 Bug fix
Summary
The magnetometer sensor is publishing a value but it's not based on the location. This PR calculate the value based on the location.
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.