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

Scripting/AP_Arming: add pre-arm check that scripting has initialised successfull #12894

merged 8 commits into from Dec 3, 2019


Copy link

rmackay9 commented Nov 26, 2019

This PR resolves issue #12798 by adding a pre-arm check to alert the user if scripting has failed to initialise because it has run out of memory. In my tests a CubeBlack (and thus probably many other boards) are very close to running out of memory when using Copter in the default configuration so it is fairly likely that users will hit this issue and so we should provide protection and a decent warning.

This also removes the automatic setting of SCR_ENABLE to zero which we've recently agreed is not a good pattern because users may inadvertantly save/re-load parameter and permanently disable scripting.

This has been tested on a real board and a screen shot of the pre-arm check message is shown below.

This PR also makes an unrelated change to print an initialisation failure message from the scripting library itself instead of duplicating it in each vehicle.

Copy link

WickedShell left a comment

Generally looks good. I think there is maybe a slight tweak around the enabled logic, but I am quite happy to see the scripting failure handling moved out of the vehicle code.

libraries/AP_Scripting/AP_Scripting.h Outdated Show resolved Hide resolved
libraries/AP_Arming/AP_Arming.cpp Outdated Show resolved Hide resolved
@CraigElder CraigElder removed the DevCallTopic label Dec 3, 2019
@rmackay9 rmackay9 force-pushed the rmackay9:scripting-init-check branch from c240b83 to c4115ab Dec 3, 2019
@rmackay9 rmackay9 force-pushed the rmackay9:scripting-init-check branch from c4115ab to c673b6c Dec 3, 2019
@rmackay9 rmackay9 merged commit 952517c into ArduPilot:master Dec 3, 2019
4 checks passed
4 checks passed
ArduPilot.ardupilot #20191203.5 succeeded
ArduPilot.ardupilot (Cygwin SITL build) Cygwin SITL build succeeded
continuous-integration/travis-ci/pr The Travis CI build passed
semaphoreci The build passed on Semaphore.

This comment has been minimized.

Copy link
Contributor Author

rmackay9 commented Dec 3, 2019

Merged after discussing with @WickedShell

@rmackay9 rmackay9 deleted the rmackay9:scripting-init-check branch Dec 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.