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

Added support for ROMFS scripts #13749

Closed
wants to merge 4 commits into from

Conversation

tridge
Copy link
Contributor

@tridge tridge commented Mar 7, 2020

This allows for scripts to be embedded in ROMFS, which removes the dependency on a microSD card for flight critical scripts.
The PR is WIP as the code to load the lua script in AP_Scripting is just a placeholder ready for @WickedShell
files are embedded from two places:

  • scripts/ directory at top level of build for SITL
  • ROMFS/ directory inside hwdef directory for ChibiOS builds

@tridge tridge added the WIP label Mar 7, 2020
@tridge tridge requested a review from WickedShell March 7, 2020 01:17
@rmackay9
Copy link
Contributor

rmackay9 commented Mar 7, 2020

This is very cool. This should remove reliance on the sometimes unreliable SD Cards and also make it possible to embed a script right into the firmware right? Will that be done using apjtools or something similar?

@tridge
Copy link
Contributor Author

tridge commented Mar 7, 2020

This should remove reliance on the sometimes unreliable SD Cards and also make it possible to embed a script right into the firmware right?

that is right

Will that be done using apjtools or something similar?

at the moment I've set it up so you put the lua scripts in the hwdef directory. For example, if you want CubeBlack to have a myhello.lua you would do:

  • mkdir -p libraries/AP_HAL_ChibiOS/hwdef/CubeBlack/ROMFS/scripts
  • cp myhello.lua libraries/AP_HAL_ChibiOS/hwdef/CubeBlack/ROMFS/scripts/

it will then put all files in that ROMFS directory into ROMFS where lua scripting engine will load them.
We can certainly add other mechanisms, possibly including apjtool, but for now I'm targeting this at users who want to do their own custom builds. Usually a commercial user will create a custom build using the include mechanism in hwdef.dat to create something derived from a base build, and put a defaults.parm in the directory along with any scripts they want.

@tridge
Copy link
Contributor Author

tridge commented Mar 12, 2020

replaced by #13793, closing

@tridge tridge closed this Mar 12, 2020
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.

None yet

2 participants