mirror of https://github.com/ArduPilot/ardupilot
AntennaTracker: Allow scripting to run
This commit is contained in:
parent
7183b504a7
commit
76743b7f1d
|
@ -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.
|
||||
|
|
|
@ -108,6 +108,8 @@ public:
|
|||
k_param_rc_channels,
|
||||
k_param_servo_channels,
|
||||
|
||||
k_param_scripting = 219,
|
||||
|
||||
//
|
||||
// 220: Waypoint data
|
||||
//
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue