mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-22 07:44:03 -04:00
Sub: Allow scripting to run
This commit is contained in:
parent
cac4b91671
commit
e8401671e3
@ -634,6 +634,11 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = {
|
||||
// @Path: ../libraries/RC_Channel/RC_Channels_VarInfo.h
|
||||
AP_SUBGROUPINFO(rc_channels, "RC", 17, ParametersG2, RC_Channels),
|
||||
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
// Scripting is intentionally not showing up in the parameter docs until it is a more standard feature
|
||||
AP_SUBGROUPINFO(scripting, "SCR_", 18, ParametersG2, AP_Scripting),
|
||||
#endif
|
||||
|
||||
AP_GROUPEND
|
||||
};
|
||||
|
||||
|
@ -4,6 +4,10 @@
|
||||
|
||||
#include <AP_Gripper/AP_Gripper.h>
|
||||
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
#include <AP_Scripting/AP_Scripting.h>
|
||||
#endif
|
||||
|
||||
// Global parameter class.
|
||||
//
|
||||
class Parameters {
|
||||
@ -331,6 +335,11 @@ public:
|
||||
|
||||
// control over servo output ranges
|
||||
SRV_Channels servo_channels;
|
||||
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
AP_Scripting scripting;
|
||||
#endif // ENABLE_SCRIPTING
|
||||
|
||||
};
|
||||
|
||||
extern const AP_Param::Info var_info[];
|
||||
|
@ -119,6 +119,10 @@
|
||||
#include <AP_Camera/AP_Camera.h> // Photo or video camera
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
#include <AP_Scripting/AP_Scripting.h>
|
||||
#endif
|
||||
|
||||
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
|
||||
#include <SITL/SITL.h>
|
||||
#endif
|
||||
|
@ -190,6 +190,12 @@ void Sub::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
|
||||
|
||||
// we don't want writes to the serial port to cause us to pause
|
||||
// mid-flight, so set the serial ports non-blocking once we are
|
||||
// ready to fly
|
||||
|
Loading…
Reference in New Issue
Block a user