forked from ArduPilot/ardupilot
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AP_Scripting: added gcs:command_int() binding
- Loading branch information
Showing
5 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--[[ | ||
demonstrate using the gcs:command_int() interface to send commands from MAVLink MAV_CMD_xxx set | ||
--]] | ||
|
||
local MAV_FRAME_GLOBAL = 0 | ||
|
||
local MAV_CMD_DO_SET_MODE = 176 | ||
|
||
local MODE_ACRO = 4 -- for plane | ||
|
||
local MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1 | ||
|
||
local function update() | ||
-- force mode ACRO once a second via DO_SET_MODE | ||
gcs:command_int(MAV_FRAME_GLOBAL, MAV_CMD_DO_SET_MODE, { MAV_MODE_FLAG_CUSTOM_MODE_ENABLED, MODE_ACRO }) | ||
return update, 1000 | ||
end | ||
|
||
return update, 1000 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters