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 PWM mapping/failsafe to RX Lua #1763
Conversation
I did some testing of this today, one thing I noticed is that the 750us option is missing from the LUA. Also, it might be good to merge master into these 2 branches to make testing easier. |
I sorted your disadvantage of the RX IsArmed problem, by removing IsArmed from RXes altogether 😄 See PR #1765 |
I didn't include that one because Lua params are pretty fat and I didn't want to include an option I think zero people use. It has to be loaded every time through the OTA. I wasn't sure about the output mode, but I think people will actually use that option. If I were to add something else, I'd probably want the failsafe position but I didn't want to rejigger our entire Lua system just to add it (since our entire system is based on the value only being one byte currently).
The alternative would be to download 16 channels x 4 Lua parameters, and that's why this wasn't in the original PWM update PR-- that's just not viable. I came up with this "selector" pattern instead, but it is a little confusing how it works at first. There's no good way to describe it in 15 chars or less. It should have come up with |
That makes sense why its no there then.
I fully agree with this, it's just that the names were a little confusing, i.e.
It did come up with 5, but when I changed that to 1, 2, 3 ,4 etc all the input channels were 1. |
Yeah that's why in the webui I went with just "Output". It seemed more confusing with just "Output" versus "Output Ch". I think we should allow people to remap the channels even on CRSF output as well, to work with fixed-input FCs that have stuff on CH5. If that were the case then "Output Ch" is more appropriate. What about I'm pretty wary of changing the option type to a select, since that changes the size of the option:
At just 5 bytes of data per telemetry packet those really really slow down the loading of the parameter list, 100Hz FullRes takes 7-8 seconds to load that last one, 50Hz takes around 12s. Every time you change anything on the Mapping page it take 7-9 seconds for the list to refresh, even if we went with the 70 byte version it really crushes the usability, so I think this is a bad idea even if it is a little clearer.
Sounds like your config has them all set to 1 for all those Outputs? If that's what you're seeing then I'd check the webui to see if the same values are there. I've flashed a few random RXes and they all have the default mapping (1->1, 2->2 , 3->3, etc), and the PWM RXes I use with CH5 remapped showed the correct values I'd configured. |
Sad trombone! I think you're right, theres just no good option on the name and changing the number to an enum is going to be too slow, especially for the people on slower rates (which is really the target audience as they'll be using this the most). Could we use the The problem with the config, I'm pretty sure it was a me problem, but it just exacerbated the confusion. 😄 |
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 would not add the remapping for "no pwm users". If it's just about channel 5 we could think about options to skip it from the output. But that is probably also confusing to configure.
# Conflicts: # src/lib/LUA/rx_devLUA.cpp
I see what you're saying. You're talking about the questions Cap has in the Discussion section. |
Adds the ability to change PWM output mappings and failsafe positions from Lua
Details
Builds on #1757
Adds "Output Mapping" folder with the following items:
In addition there is also a new command:
For Discussion
How do we feel about allowing everyone to remap their channel outputs, not just PWM users? This would be a separate PR since that would require a lot of changes to the RX in a lot of places and would make this PR harder to review.
Advantages: The use case is that there are external stabilization units which have functions assigned to fixed channels, and CH5 (AUX1) is usually one of them. If every RX can remap their channels, then the user can set CH5 in the output CRSF stream to come from input CH8 or something.
Disadvantages: The code would have to swizzle the channels around every time which adds overhead (latency) to every packet. IsArmed would also have to reverse map back to original input CH5, not the new output CH5, which is minor.
Major Disadvantage: People are dumb AF and really will F / confuse themselves doing this.