Browse Source

Copter: Allow scripting to run

master
Michael du Breuil 6 years ago committed by Andrew Tridgell
parent
commit
cac4b91671
  1. 4
      ArduCopter/Copter.h
  2. 5
      ArduCopter/Parameters.cpp
  3. 5
      ArduCopter/Parameters.h
  4. 6
      ArduCopter/system.cpp

4
ArduCopter/Copter.h

@ -170,6 +170,10 @@ @@ -170,6 +170,10 @@
#include <AP_RPM/AP_RPM.h>
#endif
#ifdef ENABLE_SCRIPTING
#include <AP_Scripting/AP_Scripting.h>
#endif
// Local modules
#ifdef USER_PARAMS_ENABLED
#include "UserParameters.h"

5
ArduCopter/Parameters.cpp

@ -929,6 +929,11 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = { @@ -929,6 +929,11 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = {
// @Path: ../libraries/AC_AutoTune/AC_AutoTune.cpp
AP_SUBGROUPPTR(autotune_ptr, "AUTOTUNE_", 29, ParametersG2, Copter::AutoTune),
#endif
#ifdef ENABLE_SCRIPTING
// Scripting is intentionally not showing up in the parameter docs until it is a more standard feature
AP_SUBGROUPINFO(scripting, "SCR_", 30, ParametersG2, AP_Scripting),
#endif
AP_GROUPEND
};

5
ArduCopter/Parameters.h

@ -583,6 +583,11 @@ public: @@ -583,6 +583,11 @@ public:
// we need a pointer to autotune for the G2 table
void *autotune_ptr;
#endif
#ifdef ENABLE_SCRIPTING
AP_Scripting scripting;
#endif // ENABLE_SCRIPTING
};
extern const AP_Param::Info var_info[];

6
ArduCopter/system.cpp

@ -244,6 +244,12 @@ void Copter::init_ardupilot() @@ -244,6 +244,12 @@ void Copter::init_ardupilot()
startup_INS_ground();
#ifdef ENABLE_SCRIPTING
if (!g2.scripting.init()) {
gcs().send_text(MAV_SEVERITY_ERROR, "Scripting failed to start");
}
#endif // ENABLE_SCRIPTING
// set landed flags
set_land_complete(true);
set_land_complete_maybe(true);

Loading…
Cancel
Save