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: add send named float binding #13753

Merged
merged 2 commits into from
Feb 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions libraries/AP_Scripting/examples/simple_loop.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
-- This script is an example of saying hello. A lot.
-- Pick a random number to send back
local number = math.random()

function update() -- this is the loop which periodically runs
gcs:send_text(0, "hello, world") -- send the traditional message

gcs:send_named_float('Lua Float',number) -- send a value
number = number + math.random() -- change the value

return update, 1000 -- reschedules the loop
end

Expand Down
1 change: 1 addition & 0 deletions libraries/AP_Scripting/generator/description/bindings.desc
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ include GCS_MAVLink/GCS.h
singleton GCS alias gcs
singleton GCS method send_text void MAV_SEVERITY'enum MAV_SEVERITY_EMERGENCY MAV_SEVERITY_DEBUG "%s"'literal string
singleton GCS method set_message_interval MAV_RESULT'enum uint8_t 0 MAVLINK_COMM_NUM_BUFFERS uint32_t 0U UINT32_MAX int32_t -1 INT32_MAX
singleton GCS method send_named_float void string float -FLT_MAX FLT_MAX

include AP_Vehicle/AP_Vehicle.h
singleton AP_Vehicle alias vehicle
Expand Down