Canged code to convert compass readings into a bearing #6568
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.
Changed example code to convert compass readings into a bearing since it produced an angle using the x-axis as north rather than the y-axis as explained in the description above it.
Description
The example code in the compass page of the documentation for computing the bearing in degrees from compass readings produces the incorrect output or it is misleading given the description above it. This is caused by the function adjusting the produced angle to consider the positive x-axis as the north direction rather than the positive y-axis as described in the description above the example code in the documentation.
Related Issues
None.
Tasks
No tasks.
Documentation
Original documentation: https://cyberbotics.com/doc/reference/compass?version=R2023b
Also present in the main branch documentation: https://cyberbotics.com/doc/reference/compass?version=master
Screenshots
None.
Additional context
I noticed this after using this function in a project and later having issues understanding why my headings where wrong.