AntennaTracker: Allow scripting to run

This commit is contained in:
Michael du Breuil 2019-02-28 23:40:18 -07:00 committed by Andrew Tridgell
parent 7183b504a7
commit 76743b7f1d
4 changed files with 21 additions and 0 deletions

View File

@ -370,6 +370,11 @@ const AP_Param::Info Tracker::var_info[] = {
// @User: Standard
GGROUP(pidYaw2Srv, "YAW2SRV_", AC_PID),
#ifdef ENABLE_SCRIPTING
// Scripting is intentionally not showing up in the parameter docs until it is a more standard feature
GOBJECT(scripting, "SCR_", AP_Scripting),
#endif
// @Param: CMD_TOTAL
// @DisplayName: Number of loaded mission items
// @Description: Set to 1 if HOME location has been loaded by the ground station. Do not change this manually.

View File

@ -108,6 +108,8 @@ public:
k_param_rc_channels,
k_param_servo_channels,
k_param_scripting = 219,
//
// 220: Waypoint data
//

View File

@ -69,6 +69,10 @@
#include "GCS_Mavlink.h"
#include "GCS_Tracker.h"
#ifdef ENABLE_SCRIPTING
#include <AP_Scripting/AP_Scripting.h>
#endif
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
#include <SITL/SITL.h>
#endif
@ -155,6 +159,10 @@ private:
enum ControlMode control_mode = INITIALISING;
#ifdef ENABLE_SCRIPTING
AP_Scripting scripting;
#endif
// Vehicle state
struct {
bool location_valid; // true if we have a valid location for the vehicle

View File

@ -53,6 +53,12 @@ void Tracker::init_tracker()
log_init();
#endif
#ifdef ENABLE_SCRIPTING
if (!scripting.init()) {
gcs().send_text(MAV_SEVERITY_ERROR, "Scripting failed to start");
}
#endif // ENABLE_SCRIPTING
// initialise compass
init_compass();