Skip to content
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

RC_TYPE for binding #2163

Closed
wants to merge 2 commits into from
Closed

RC_TYPE for binding #2163

wants to merge 2 commits into from

Conversation

hamishwillee
Copy link
Collaborator

@hamishwillee hamishwillee commented Nov 5, 2024

This adds a type for binding CRSF RC radios, which is being supported in PX4/PX4-Autopilot#23294

There is an alternative proposal #2162 this is probably better - but I created this before I saw that. Lets discuss in mav call.

@benjinne I've described this as "CRSF radio". The way I saw this message is that is was poorly designed originally with just spectrum and then the other options were added later with RC_TYPE when someone wanted to implement those. In other words it wasn't a design to go type/and subtype. I could be wrong though.

FWIW I'm not even sure having an RC type is actually useful. You could just say "I get this command, then I check what types of RC radios I have, and if they support binding, I attempt to bind them. Too late to change now I guess - we just need to work out how to take this forward.
Note, the RC type isn't even useful for the two RC on vehicle case, since they might be the same kind.

@auturgy @julianoes

FMI Is it ever useful to specify the RC "kind" here?

@hamishwillee hamishwillee mentioned this pull request Nov 5, 2024
@hamishwillee hamishwillee marked this pull request as draft November 5, 2024 21:58
@hamishwillee
Copy link
Collaborator Author

Thanks @julianoes But would the approach in #2162 be better? That essentially makes the param 1 into RC_TYPE and then suggests sub-types.

I'd really like to know if RC_TYPE is ever useful - from a vehicle point of view you just want to know that you should start the binding process - how that is done would depend on the vehicles knowledge of what RC it had attached.

@julianoes
Copy link
Collaborator

RC sub types 🤯, I'd try to keep it simple.

@hamishwillee
Copy link
Collaborator Author

hamishwillee commented Nov 6, 2024

@julianoes Hmmm, my immediate response was agreement, but then I checked that PX4 existing behaviour parses this as a type and sub-type https://github.com/PX4/PX4-Autopilot/blob/main/src/drivers/px4io/px4io.cpp#L545-L578

If you look at that code it also shows that the flight stack does do different things for the different RC types. Now I think that is all the wrong way round - we should just sent "bind": the flight stack should know what RC it has and configure itself appropriately. But that's not what we have and we can't break that implementation.

Further, if we add this rc type, then we also need to specify what the param 1 should be in this case - it can't be zero because PX4 would parse that as a spektrum.

Upshot, I think that we have to effectively define a type and subtype, to not break anything, which means that we need to look at the other PR.

Hope that makes sense. I'm closing this, because sadly the simple way doesn't work without making it into the hard way (i.e. I could make this param 1 != 0 mean "undefined", but that's even more complicated.

@auturgy
Copy link
Collaborator

auturgy commented Nov 7, 2024 via email

@benjinne
Copy link
Contributor

benjinne commented Nov 7, 2024

Obviously a little thinking required.But specifically for this: “CRSF” is a wire protocol, not an RC type. We’d need to confirm that RC “types” that implement CRSF all behave the same for binding, or document how this is actually going to work

CRSF is indeed a wire protocol, As defined in the protocol, binding is a feature supported. It depends on the receiver that implements it if it's supported.

Currently I'm only aware of ELRS 3.4+ that works. I assume crossfire supports it earlier
https://www.expresslrs.org/quick-start/binding/?h=bind#updated-binding-procedure-since-expresslrs-340

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants