Change the compass calibration calculation #8341
Closed
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.
"result = px4_ioctl (fd, MAGIOCCALIBRATE, fd);" This sentence will cause the compass driver to self-calibrate.
The driver program of hmc5883 compass can self-calibration. This will change the scale factor of hmc5883 driver. Therefore, compass calibration input data may have been multiplied by a scale factor.So we have to consider that the scale factor in the driver might not be 1.0.
If mscale._scale is 1.0f, then it will not affect the calculation results. If mscale._scale is not 1.0, then take the scale of the driver into account.