-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Set altitude target functionality #11147
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
Open
xznhj8129
wants to merge
12
commits into
iNavFlight:maintenance-9.x
Choose a base branch
from
xznhj8129:msp_set_alt
base: maintenance-9.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
This reverts commit eec5481.
Contributor
PR Compliance Guide 🔍All compliance sections have been disabled in the configurations. |
Contributor
Author
|
Tested functionality and works in althold, cruise and poshold; ignored in RTH, i think this is ready to merge |
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.
User description
This is an experimental addition to be able to set the navigation altitude target without RC. It's implemented as an MSP command, Programming operator and Mavlink (MAV_CMD_DO_CHANGE_ALTITUDE).
This isn't final, i'm showing the general concept, specifics like exact way to check for altitude control state and how to actually set the altitude target may be wrong; this is a first draft and no time to test immediately
How it works is a dual-purpose get/set MSP message MSP2_INAV_ALT_TARGET; empty request to get current target, data in request to set the new target.
It only works if:
Dual purpose get/set MSP is a thing i'm not sure about, if we want to maintain seperate GET/SET messages or combine them as general rule.
We use geoAltitudeDatumFlag_e as a reference frame flag, so default is NAV_WP_TAKEOFF_DATUM (0).
With the enum, we can set different altitude frames: ASL, Takeoff (default), or, in the future, AGL.
Programming Framework supports new logic operator LOGIC_CONDITION_SET_ALTITUDE_TARGET through the same navigation function, allowing you to do that too.
MAVLink also handles it with MAV_CMD_DO_CHANGE_ALTITUDE via COMMAND_INT with frame GLOBAL and GLOBAL_RELATIVE
Comments encouraged
PR Type
Enhancement, New Feature
Description
This description is generated by an AI tool. It may have inaccuracies
Add altitude target setting via MSP, MAVLink, and Programming Framework
Implement
navigationSetAltitudeTargetWithDatum()function supporting multiple altitude reference framesSupport
MAV_CMD_DO_CHANGE_ALTITUDEMAVLink command with frame conversion logicAdd
LOGIC_CONDITION_SET_ALTITUDE_TARGEToperator for automation rulesExtend altitude datum enum with
NAV_WP_TERRAIN_DATUMfor future terrain-relative supportUpdate documentation generation regex and regenerate enum/message references
Diagram Walkthrough
File Walkthrough
6 files
Handle MAVLink altitude change commandImplement altitude target setting functionAdd altitude datum enum and function declarationHandle MSP altitude target commandAdd altitude target logic condition operatorDefine altitude target logic condition enum1 files
Define MSP2 altitude target message code6 files
Fix enum parsing regex for named enumsRegenerate enum reference documentationAdd altitude target MSP command documentationAdd altitude target message schema definitionUpdate message schema checksumIncrement MSP documentation revision2 files