-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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
Add support for Baro/Vario in CRSF #26880
Conversation
Is it possible for me to do some test? Hardware Kakute F7 Mini and SpeedyBee F405 Wing Mini. br Karl |
With a SpeedyBee F405 Wing I would also like to have a look at this. I would just need the right firmware for it ... |
If it is OK!? I build for the SpeedyBee F405 WING parameter list version: 4.6.0 dev FW Karl |
No baro values on SpeedyBee F405 WING mini with FW 4.6.0 dev. FrSky X10S Express, EdgeTX 2.9.4, HiYounger TX module + BETAFPV 2.4GHz Nano RX ELRS 3.3.2, SppedyBee F405 Wing mini only with BT slave on Serial 6 for communication. No GPS connected. |
Do you get any extra sensors if you search for them? I only did ID 9, not ID 7 (Baro only) |
@andyp1per Can you please provide a firmware for SpeedyBee F405 Wing? |
I think, there is an error on my side. I cloned your fork But checking, if your modifications like are actually in the code I did build here I see that My apologize for the confusion Best you provide a firmware for the SpeedyBee F405 Wing Karl |
Do you have a GPS? Worth checking this when armed and outside as it is relative alt above home position which needs to be set. I used the code from the CRSF spec, so it could be wrong - but not sure how I would tell. What about the vario data? |
Try this one, I think I need to invert the sign since AP deals in down rather than up |
Ethos can evaluate the frame CRSF_FRAMETYPE_BARO_ALTITUDE with ID9 (Alt and VSpd). EdgeTX only evaluates CRSF_FRAMETYPE_VARIO with ID7 (VSpd). It would be an advantage for Ardupilot if we could use both. Possibly switchable with a flag in RC_OPTIONS or similar. This would cover all transmitter systems. As for the values themselves, the calculations used for the S.Port protocol can be found in AP_Frsky_Telem. Presumably you can see there which sign is used and adopt this in part for CRSF. |
b38b880
to
52b0788
Compare
This includes ID 7 - please try it |
EdgeTX 2.9.4 Ethos 1.5.6 |
Alt and VSpd show up, but irregular values. 50' YT video showing first baro values on QGroundcontrol and then values on my radio. |
So there was a bug in the new code where it was using absolute alt instead of relative. Should be fixed now. I think the errors in vspd are actually quantization errors since this is only an 8-bit int. We might have to special-case 0 to return 0; |
VSpd id 7. moving up down in between +1xx.x m/s and -9x.x m/s ALT id 9. -1000.0 m fix, not moving at all ELRS |
arduplane.zip - think there was a sign conversion issue. Can you send me a disarmed log of your vehicle? There is not a lot going on in these calculations, but there is some weird conversion. |
I am just a user and at the moment there is no vehicle. It is just the SpeedBee in the window sill. |
VSpd - varying between -/+ xxx m/s What is that "disarmed log"?? MP or QG |
I think, 'data log' in MP. I am on Linux here with QG, but I have a WIN with MP in a Vbox. So I'll try .... |
Log 1: original 4.6.0 with ER8GV Vario RX You should be able to make a good comparison. |
Hope, that is the right one. Good night, shut down now ;-) |
I see on MP, that the FC is ARMED (ARM/DISARM on toggle switch) Alt here with me rock solid -4.5m. Putting a plastic bag over the FC and putting hand pressure on the bag, in MP see - 30 ... -40m, but value is 9 rock solid. For VSpd same. a little variation, but not a measurement as expected ... ELRS |
Do you have a GPS? Its the same code as FPort, will only work with GPS |
Then the fault is on my side. I removed the GPS for the bag testing. So, ARMED, GPS has fix. Ratio VSpd 0.1, Alt Ratio 0.1 But how to verify those values? I used this here to simulate altitude changes with baro sensors some years ago, but this is to small to take it all inside. Or I need a plane and record, but I don't have that at the moment. |
Pete showed me perhaps a better way to determine the altitude which will not require GPS. I'll chat to Alex about using this. |
The good thing is, ID 7 and ID 9 are on the radio and we do have values. |
Do this ... Alex has conjured up a quick Vario / VSpd for S.Port. I actually wanted to test your current solution against F.Port, but I should probably wait a little longer? |
a6e34c9
to
18fbad0
Compare
Can you try this? This adds better support for relative home, so baro on its own should work. |
Looks the best so far. However, I still have to test it tomorrow outdoors with a GPS fix. |
Works here without arming and without GPS. RATIO to 0.2 for quite reasonable values VSpd and Alt. x.x m/s and x.x m. But how to verify? |
So only 20% of the respective value would be displayed? Because according to the EdgeTX manual: Ratio: Specifies the ratio value to multiply with the sensor value as needed by some sensors.
I will compare with another Vario sensor. oXs would be a candidate or like here a Radiomaster ER8GV. |
Alt (ID 9) is still strange here. Immediately after resetting the telemetry, -380 m is displayed here. Mostly values in the minus range. There is another Alt value (ID 2/4) which is approximately at the height of the location (27 m). |
can be merged once testing passes |
For ID9 to be displayed correctly your TX needs to know how to decode it |
Tested ok. Can be merged now. |
I think there is still a little/big endian issue in the code. |
Fixes the CRSF part of #26699