AP_Scripting: Add user accessable script parameters

This commit is contained in:
Henry Wurzburg 2020-07-09 07:36:45 -05:00 committed by Peter Barker
parent a00b5cb770
commit 8bfda973db
2 changed files with 27 additions and 0 deletions

View File

@ -77,6 +77,30 @@ const AP_Param::GroupInfo AP_Scripting::var_info[] = {
// @User: Advanced
AP_GROUPINFO("DEBUG_LVL", 4, AP_Scripting, _debug_level, 0),
// @Param: USER1
// @DisplayName: Scripting User Parameter1
// @Description: General purpose user variable input for scripts
// @User: Standard
AP_GROUPINFO("USER1", 5, AP_Scripting, _user[0], 0.0),
// @Param: USER2
// @DisplayName: Scripting User Parameter2
// @Description: General purpose user variable input for scripts
// @User: Standard
AP_GROUPINFO("USER2", 6, AP_Scripting, _user[1], 0.0),
// @Param: USER3
// @DisplayName: Scripting User Parameter3
// @Description: General purpose user variable input for scripts
// @User: Standard
AP_GROUPINFO("USER3", 7, AP_Scripting, _user[2], 0.0),
// @Param: USER4
// @DisplayName: Scripting User Parameter4
// @Description: General purpose user variable input for scripts
// @User: Standard
AP_GROUPINFO("USER4", 8, AP_Scripting, _user[3], 0.0),
AP_GROUPEND
};

View File

@ -41,6 +41,9 @@ public:
MAV_RESULT handle_command_int_packet(const mavlink_command_int_t &packet);
// User parameters for inputs into scripts
AP_Float _user[4];
struct terminal_s {
int output_fd;
off_t input_offset;