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: allow scripting to get mission item/s by index, and wp data, and details of wp #13685

Merged
merged 2 commits into from May 11, 2020

Conversation

davidbuzz
Copy link
Collaborator

… from lua

@davidbuzz
Copy link
Collaborator Author

davidbuzz commented Feb 28, 2020

example lua snippet that loop over all mission items and sends them all to the user as sent_text messages, just because. Warming, doing this specific example with big mission/s will cause lua to timeout or exceed limits etc.

missionsize = mission:num_commands()
gcs:send_text(0, string.format("LUA: missionsize %d", missionsize ))
for x = 1, missionsize do
gcs:send_text(0, string.format("LUA: mission-item %d", x ))
mitem = mission:get_waypoint(x)
gcs:send_text(0, string.format("LUA p1-4 %f,%f,%f,%f", mitem:param1(),mitem:param2(),mitem:param3(),mitem:param4() ))
gcs:send_text(0, string.format("LUA x,y,z %0.6f,%0.6f,%0.2f", mitem:x()/10000000.0, mitem:y()/10000000.0, mitem:z() ))
gcs:send_text(0, string.format("LUA seq,cmd,frm,cur %d,%d,%d,%d", mitem:seq(),mitem:command(),mitem:frame(),mitem:current() ))
end

@davidbuzz davidbuzz changed the title allow scripting to get mission item/s, and wp data, and details of wp… AP_SCripting: allow scripting to get mission item/s by index, and wp data, and details of wp Mar 2, 2020
@davidbuzz davidbuzz self-assigned this Mar 4, 2020
@davidbuzz davidbuzz force-pushed the scripting-mission-items-pr branch 3 times, most recently from 06bf935 to 18d624e Compare March 28, 2020 08:54
tridge
tridge previously requested changes Apr 14, 2020
Copy link
Contributor

@tridge tridge left a comment

Choose a reason for hiding this comment

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

needs to run code style fixer (or manually)

@davidbuzz
Copy link
Collaborator Author

needs to run code style fixer (or manually)

done

@davidbuzz davidbuzz requested a review from tridge May 1, 2020 01:17
@davidbuzz davidbuzz force-pushed the scripting-mission-items-pr branch 2 times, most recently from 95e3c30 to c353e3d Compare May 1, 2020 01:54
@davidbuzz davidbuzz force-pushed the scripting-mission-items-pr branch from c353e3d to 406ce8f Compare May 5, 2020 00:43
@davidbuzz
Copy link
Collaborator Author

all previous requests have been fixed. and i rebased on master today to hopefully get current CI to pass. .... hopefully.

@davidbuzz davidbuzz changed the title AP_SCripting: allow scripting to get mission item/s by index, and wp data, and details of wp AP_Scripting: allow scripting to get mission item/s by index, and wp data, and details of wp May 5, 2020
tridge
tridge previously requested changes May 5, 2020
Copy link
Contributor

@tridge tridge left a comment

Choose a reason for hiding this comment

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

I'd prefer the auto-gen to be a separate commit

@tridge
Copy link
Contributor

tridge commented May 5, 2020

needs approval from @WickedShell

fetch item/s by their index, and review wp data, etc.  
AP_Mission: ran mission files through approved astyle  as they were non-compliant before this( astyle --options=Tools/CodeStyle/astylerc   )
@davidbuzz davidbuzz force-pushed the scripting-mission-items-pr branch from 406ce8f to d055a0c Compare May 5, 2020 01:58
@davidbuzz
Copy link
Collaborator Author

split bindings regeneration into two separate commits as per @tridge request.

@tridge
Copy link
Contributor

tridge commented May 11, 2020

merging after discussion on dev call

@tridge tridge merged commit 816474b into ArduPilot:master May 11, 2020
@davidbuzz davidbuzz deleted the scripting-mission-items-pr branch May 12, 2020 00: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.

None yet

5 participants