Update vehicle_local_position.ref_alt comment to reflect how ref_alt … #12658
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.
…is being used in PX4
(from my original post in slack)
[The comment currently] indicates to me that ref_alt is meant to be the altitude AMSL of the ground immediately below the current position of the vehicle, but when I look at all the uses of ref_alt in PX4, it is never used in this way. ref_alt tends to be set once in an estimator module on the first gps fix, and then is treated as the global reference altitude of the local frame origin by said estimator module. Further, in the mavlink module, the ref_alt value is used to determine current altitude AMSL by adding it to vehicle_local_position.z, but z is relative to the local frame origin, so ref_alt must be altitude AMSL of local frame origin, else such calculations for current altitude AMSL are wrong. All of this to say: I think the comment is wrong...