CRSF Baro Altitude and Vario, AirSpeed
User description
The previous merge request unfortunately had to be closed. Attempting to merge it with the main branch resulted in a huge number of conflicts.
This implementation has been tested and has the crsf_use_legacy_baro_packet setting disabled by default.
If this setting is disabled:
- The GNSS packet (0x02) contains ASL altitude.
- The VARIO packet (0x07) is not transmitted.
- The Barometric Altitude and Vertical Speed packet (0x09) contains the altitude relative to the takeoff point and the vertical speed.
If this setting is enabled, data is transmitted in compatibility mode with current scripts:
- The GNSS packet contains the altitude relative to the takeoff point.
- The Barometric Altitude and Vertical Speed packet is not transmitted.
- The VARIO packet contains the vertical speed.
The airspeed packet (0x0A) is transmitted in any case (if Pitot in use).
PR Type
Enhancement
Description
-
Adds barometric altitude and vertical speed sensor packet (0x09)
-
Implements airspeed sensor packet (0x0A) for Pitot tube support
-
Introduces legacy mode toggle for backward compatibility
-
Refactors GPS altitude handling based on configuration mode
Diagram Walkthrough
flowchart LR
A["CRSF Telemetry"] --> B["Legacy Mode OFF"]
A --> C["Legacy Mode ON"]
B --> D["GPS: ASL Altitude"]
B --> E["BaroVario: Altitude + Vario"]
B --> F["Airspeed: Pitot Data"]
C --> G["GPS: Relative Altitude"]
C --> H["Vario: Vertical Speed"]
File Walkthrough
| Relevant files | |||||||
|---|---|---|---|---|---|---|---|
| Enhancement |
| ||||||
| Configuration changes |
| ||||||
| Documentation |
|
PR Compliance Guide 🔍
All compliance sections have been disabled in the configurations.
PR Code Suggestions ✨
Explore these optional code suggestions:
| Category | Suggestion | Impact |
| Possible issue |
Fix incorrect airspeed unit conversionFix the airspeed calculation in src/main/telemetry/crsf.c [298-309]
Suggestion importance[1-10]: 9__ Why: The suggestion correctly identifies a unit conversion bug in the new | High |
Prevent altitude calculation integer underflowPrevent a potential integer underflow in the altitude calculation for the CRSF src/main/telemetry/crsf.c [218]
Suggestion importance[1-10]: 8__ Why: The suggestion correctly identifies a potential integer underflow when handling negative altitudes, which could lead to incorrect telemetry data. Applying a constraint is a robust way to prevent this bug. | Medium | |
| ||
Looking good. For the docs. Did you update it using the Python script?
Oops, i did it manualy. Fixed
Can you resolve the conflicts please.
@MrD-RC I don't understand how I can resolve conflicts with a branch that isn't yet in master without creating a new branch and a new merge request for the merged version. Could you please merge pull request 11025 so I can change my pull request later?
@MrD-RC I don't understand how I can resolve conflicts with a branch that isn't yet in master without creating a new branch and a new merge request for the merged version. Could you please merge pull request 11025 so I can change my pull request later?
He may have been referring to conflicts you later fixed here:
https://github.com/iNavFlight/inav/pull/11100/commits/f3eccbdc4054debcbdd83ba71e7cdfe650b55640
If Mr D can please confirm that's what you meant and this commit is good for RC1?
Yes, there are no longer any conflicts.
Conflicts appear in the status box. They need to be resolved before merging.
Configuration de la carte de vol 04 Air Unit DJI
@MrD-RC , can you tell me why the MP was not included in the RC? I am return airspeed because MR #11025 was rejected
I tested this in SITL. It seems to do pretty much the right thing without causing any framing errors or similar. (based on my parser, not testing with EdgeTX or OpenTX).
It would be good to have someone else test it, though.
Here is a copy with the merge conflicts fixed https://github.com/iNavFlight/inav/pull/11168