mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-08 17:08:28 -04:00
Copter: Allow scripting to run
This commit is contained in:
parent
1420ac868d
commit
cac4b91671
@ -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"
|
||||
|
@ -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
|
||||
};
|
||||
|
@ -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[];
|
||||
|
@ -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…
Reference in New Issue
Block a user