mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-09 17:38:32 -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>
|
#include <AP_RPM/AP_RPM.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef ENABLE_SCRIPTING
|
||||||
|
#include <AP_Scripting/AP_Scripting.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
// Local modules
|
// Local modules
|
||||||
#ifdef USER_PARAMS_ENABLED
|
#ifdef USER_PARAMS_ENABLED
|
||||||
#include "UserParameters.h"
|
#include "UserParameters.h"
|
||||||
|
@ -930,6 +930,11 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = {
|
|||||||
AP_SUBGROUPPTR(autotune_ptr, "AUTOTUNE_", 29, ParametersG2, Copter::AutoTune),
|
AP_SUBGROUPPTR(autotune_ptr, "AUTOTUNE_", 29, ParametersG2, Copter::AutoTune),
|
||||||
#endif
|
#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
|
AP_GROUPEND
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -583,6 +583,11 @@ public:
|
|||||||
// we need a pointer to autotune for the G2 table
|
// we need a pointer to autotune for the G2 table
|
||||||
void *autotune_ptr;
|
void *autotune_ptr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef ENABLE_SCRIPTING
|
||||||
|
AP_Scripting scripting;
|
||||||
|
#endif // ENABLE_SCRIPTING
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const AP_Param::Info var_info[];
|
extern const AP_Param::Info var_info[];
|
||||||
|
@ -244,6 +244,12 @@ void Copter::init_ardupilot()
|
|||||||
|
|
||||||
startup_INS_ground();
|
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 landed flags
|
||||||
set_land_complete(true);
|
set_land_complete(true);
|
||||||
set_land_complete_maybe(true);
|
set_land_complete_maybe(true);
|
||||||
|
Loading…
Reference in New Issue
Block a user