-
Notifications
You must be signed in to change notification settings - Fork 13.4k
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
crsf_rc: add bind command #23294
base: main
Are you sure you want to change the base?
crsf_rc: add bind command #23294
Conversation
8a47282
to
17aa86a
Compare
if (!strcmp(verb, "bind")) { | ||
uORB::Publication<vehicle_command_s> vehicle_command_pub{ORB_ID(vehicle_command)}; | ||
vehicle_command_s vcmd{}; | ||
vcmd.command = vehicle_command_s::VEHICLE_CMD_START_RX_PAIR; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI this might get weird if other modules (px4io, other rc_input, etc) are running.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in general there's only one rc module running per vehicle. If we expect multiple, then maybe we can handle this with the command parameters
0xE8, // Packet CRC8 | ||
}; | ||
|
||
return _uart->write((void *) bindFrame, 9); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any acknowledgement or mechanism for checking?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't see any in the betaflight code or ardupilot code. To verify it was successful I think the assumption is you verify the receiver lights blink rapidly signifying it's in bind mode
@dagar I've tested and verified that this works. |
bd9560b
to
e0f70a6
Compare
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 |
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
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 |
Solved Problem
Ability to bind using the crsf protocol
Fixes #23281
Solution
Changelog Entry
For release notes:
Alternatives
Add to rc_input module if needed
Test coverage
I assume vehicle command to bind comes from QGC and we may need to update QGC's UI