Skip to content

Commit

Permalink
AP_Scripting: Add user accessable script parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Hwurzburg committed Jul 19, 2020
1 parent be3a2cc commit dc49770
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
24 changes: 24 additions & 0 deletions libraries/AP_Scripting/AP_Scripting.cpp
Expand Up @@ -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
};

Expand Down
3 changes: 3 additions & 0 deletions libraries/AP_Scripting/AP_Scripting.h
Expand Up @@ -41,6 +41,9 @@ class AP_Scripting

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;
Expand Down

0 comments on commit dc49770

Please sign in to comment.