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

Scripted CRSF Menus #29368

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Conversation

andyp1per
Copy link
Collaborator

@andyp1per andyp1per commented Feb 24, 2025

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.

image
image
image
image
image

@andyp1per andyp1per added the WIP label Feb 24, 2025
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
@andyp1per andyp1per requested a review from IamPete1 February 28, 2025 17:21
@andyp1per andyp1per marked this pull request as ready for review February 28, 2025 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant