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: added copter deploy example #26651

Merged
merged 3 commits into from
Aug 3, 2024
Merged

Conversation

tridge
Copy link
Contributor

@tridge tridge commented Mar 29, 2024

this monitors climb with raw pressure and force arms in LAND mode on descent
this script was written to help a student project dropping a copter from a rocket, but I have wanted force arm in other places

@rmackay9
Copy link
Contributor

rmackay9 commented Apr 1, 2024

I guess we can't use the existing arm() binding because of one of these issues?

  • Lua script bindings don't support calling C++ functions which contain optional arguments
    OR
  • The Lua script binding doesn't currently have the optinal argument and we would break existing scripts if we added it

@tridge
Copy link
Contributor Author

tridge commented Apr 6, 2024

* The Lua script binding doesn't currently have the optinal argument and we would break existing scripts if we added it

this one, plus I think it is clearer to have arm_force so users don't use it by mistake

Copy link
Contributor

@rmackay9 rmackay9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the binding name, "arm_force".

@peterbarker
Copy link
Contributor

Ping @tridge - should be an easy fix/merge

@@ -96,6 +96,7 @@ class AP_Arming {
// these functions should not be used by Copter which holds the armed state in the motors library
Required arming_required() const;
virtual bool arm(AP_Arming::Method method, bool do_arming_checks=true);
virtual bool arm_force(AP_Arming::Method method) { return arm(method, false); }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be preferable to check the number of arguments being passed to the C function (lua_gettop?) rather than creating methods like this, IMO.

@tridge tridge merged commit d48f9ef into ArduPilot:master Aug 3, 2024
94 checks passed
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.

3 participants