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

AP_Scripting: added get_aux_cached() #21928

Merged
merged 6 commits into from
Oct 11, 2022

Conversation

tridge
Copy link
Contributor

@tridge tridge commented Oct 10, 2022

This allows for scripts to implement aux functions. This complements the new Aux Function tab in MissionPlanner, allowing for scripts to implement aux functions via DO_AUX_FUNCTION in mavlink or missions or via rc switches
It also adds a binding for scripts to read relay state

libraries/AP_Scripting/docs/docs.lua Outdated Show resolved Hide resolved
local last_aux_pos = nil

function update()
local aux_pos = rc:get_aux_cached(AUX_FUNCTION_NUM)
Copy link
Contributor

Choose a reason for hiding this comment

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

I would like a plane for when we can di:

   local aux_pos = aux:get_cached(AuxFunc::Number)

(or whatever).

Do we put stub functions in? Forever-more?

Just want a plan, this isn't a blocker.

Copy link
Member

Choose a reason for hiding this comment

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

We could do it as a manual binding to allow us to give it a custom name for now and change it when the aux split happens

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we could make that possible if/when we have aux:

Copy link
Member

Choose a reason for hiding this comment

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

One its in rc were stuck with it in rc unless we make a braking change, something we have avoided thus far.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think it is terrible it being in rc, but if/when we added aux we could make it available in both
note that we have the same problem already with rc:run_aux_function

@tridge tridge merged commit 938df19 into ArduPilot:master Oct 11, 2022
@rmackay9 rmackay9 added this to Pending in Copter 4.3 Oct 14, 2022
@rmackay9 rmackay9 moved this from Pending to 4.3.0-beta3 in Copter 4.3 Oct 14, 2022
@rmackay9 rmackay9 moved this from 4.3.0-beta3 to Pending in Copter 4.3 Oct 14, 2022
@tridge tridge added this to Pending in Plane 4.3 Oct 15, 2022
@tridge tridge moved this from Pending to 4.3.1-beta1 in Plane 4.3 Oct 15, 2022
@rmackay9 rmackay9 moved this from Pending to 4.3.0-beta4 in Copter 4.3 Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Copter 4.3
4.3.0 / 4.3.0-beta4
Plane 4.3
4.3.1-beta1
Development

Successfully merging this pull request may close these issues.

None yet

4 participants