Browse Source

AntennaTracker: Allow scripting to run

mission-4.1.18
Michael du Breuil 6 years ago committed by Andrew Tridgell
parent
commit
76743b7f1d
  1. 5
      AntennaTracker/Parameters.cpp
  2. 2
      AntennaTracker/Parameters.h
  3. 8
      AntennaTracker/Tracker.h
  4. 6
      AntennaTracker/system.cpp

5
AntennaTracker/Parameters.cpp

@ -370,6 +370,11 @@ const AP_Param::Info Tracker::var_info[] = { @@ -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.

2
AntennaTracker/Parameters.h

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

8
AntennaTracker/Tracker.h

@ -69,6 +69,10 @@ @@ -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: @@ -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

6
AntennaTracker/system.cpp

@ -53,6 +53,12 @@ void Tracker::init_tracker() @@ -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…
Cancel
Save