-
Notifications
You must be signed in to change notification settings - Fork 18.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
Scripted CRSF Menus #29368
Scripted CRSF Menus #29368
Conversation
f48663e
to
01785fd
Compare
just FYI, I added this as a bullet point on the Partners slides for this month |
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.
a more fleshed out example would be good
suggestion is ability to call an auxiliary function
compass cal?
accel cal?
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.
Would be nice to augment the existing CRSF test to cover some of this code
28f1fd9
to
9bca83d
Compare
add CRSF menu example add scripted CRSF menu events custom CRSFMenu helpers play Beethoven's 5th on CRSF command use native packed strings for CRSF menus and payloads support CRSF submenus
scripted menu event processing encoding for parameter entries propagated payload length in processing frames and use it in scripting support CRSF submenus refactor parameter read and write so that custom responses can be sent ensure parameter write responses do not override parameter metadata
1e9a102
to
5595354
Compare
Added a crsf-calibrate.lua applet |
Scripting stuff looks OK. |
Work kindly sponsored by Team Black Sheep and FOSS UAV
This PR adds the ability to create arbitrary custom menus in CRSF using lua scripting. This allows arbitrary scripted commands, including with user feedback, to be driven by transmitter menu interactions without requiring any additional installation on the transmitter. It opens up the possibility of allowing people to add arbitrary menus to individual lua scripts that can be the used easily from a transmitter. (I think this is quite a usability win fyi @rmackay9).
As much of the encoding as possible is done in lua to avoid the additional flash cost, but the menu structure itself still needs to be help in C++ in order to work correctly and efficiently.
An example menu can be seen in libraries/AP_Scripting/examples/crsf-menu.lua
and the output can be seen below.