crsf_rc: add bind command
Solved Problem
Ability to bind using the crsf protocol
Fixes https://github.com/PX4/PX4-Autopilot/issues/23281
Solution
- based on spectrum bind method in rc_input and bind packet from betaflight source code
- adds capability to the crsf_rc module using cli or vehicle_command
Changelog Entry
For release notes:
crsf_rc: add bind command
Alternatives
Add to rc_input module if needed
Test coverage
- [x] todo test on hardware
I assume vehicle command to bind comes from QGC and we may need to update QGC's UI
@dagar I've tested and verified that this works.
I verified both crsf_rc bind and using the spectrum bind button in QGC works although any spectrum option will work and it's a bit confusing. We'll need to update QGC to have a generic bind for crossfire and ELRS receivers.
The https://mavlink.io/en/messages/common.html#MAV_CMD_START_RX_PAIR message that this hooks into assumes you're going to specify a type of RC. If it is possible to have multiple radios that might pair on a vehicle then you should add ELRS as an option to https://mavlink.io/en/messages/common.html#RC_TYPE and check the command for the type being set.
QGC assumes Spektrum RC because that is the only thing that is supported by the message. Do you plan to update that section of QGC to allow ELRS to to be configured too? If not, how were you expecting this to be called?
Either way, we should document that this can be used and how in https://docs.px4.io/main/en/config/radio.html#additional-radio-setup
The https://mavlink.io/en/messages/common.html#MAV_CMD_START_RX_PAIR message that this hooks into assumes you're going to specify a type of RC. If it is possible to have multiple radios that might pair on a vehicle then you should add ELRS as an option to https://mavlink.io/en/messages/common.html#RC_TYPE and check the command for the type being set.
Yeah I agree. Right now it accepts any bind message since most vehicles just have one RC receiver, but I can imagine having multiple. Not sure when I'll get around to it
QGC assumes Spektrum RC because that is the only thing that is supported by the message. Do you plan to update that section of QGC to allow ELRS to to be configured too? If not, how were you expecting this to be called?
Either way, we should document that this can be used and how in https://docs.px4.io/main/en/config/radio.html#additional-radio-setup
Either with the command-line or with a QGC button. Currently the spektrum bind button works, but it's a little confusing. I'm also not sure when I'll get around to it
@hamishwillee could you take another look at these changes? I think I addressed all your concerns
This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:
https://discuss.px4.io/t/px4-sync-q-a-nov-27-2024/42604/1