mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
APMRover2: Allow scripting to run
This commit is contained in:
parent
76743b7f1d
commit
1420ac868d
@ -703,6 +703,11 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = {
|
|||||||
// @User: Standard
|
// @User: Standard
|
||||||
AP_GROUPINFO("BAL_PITCH_TRIM", 40, ParametersG2, bal_pitch_trim, 0),
|
AP_GROUPINFO("BAL_PITCH_TRIM", 40, ParametersG2, bal_pitch_trim, 0),
|
||||||
|
|
||||||
|
#ifdef ENABLE_SCRIPTING
|
||||||
|
// Scripting is intentionally not showing up in the parameter docs until it is a more standard feature
|
||||||
|
AP_SUBGROUPINFO(scripting, "SCR_", 41, ParametersG2, AP_Scripting),
|
||||||
|
#endif
|
||||||
|
|
||||||
AP_GROUPEND
|
AP_GROUPEND
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -399,6 +399,11 @@ public:
|
|||||||
|
|
||||||
// balance both pitch trim
|
// balance both pitch trim
|
||||||
AP_Float bal_pitch_trim;
|
AP_Float bal_pitch_trim;
|
||||||
|
|
||||||
|
#ifdef ENABLE_SCRIPTING
|
||||||
|
AP_Scripting scripting;
|
||||||
|
#endif // ENABLE_SCRIPTING
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const AP_Param::Info var_info[];
|
extern const AP_Param::Info var_info[];
|
||||||
|
@ -81,6 +81,11 @@
|
|||||||
#include <AP_Follow/AP_Follow.h>
|
#include <AP_Follow/AP_Follow.h>
|
||||||
#include <AP_OSD/AP_OSD.h>
|
#include <AP_OSD/AP_OSD.h>
|
||||||
#include <AP_WindVane/AP_WindVane.h>
|
#include <AP_WindVane/AP_WindVane.h>
|
||||||
|
|
||||||
|
#ifdef ENABLE_SCRIPTING
|
||||||
|
#include <AP_Scripting/AP_Scripting.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
|
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
|
||||||
#include <SITL/SITL.h>
|
#include <SITL/SITL.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -196,6 +196,12 @@ void Rover::startup_ground(void)
|
|||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#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
|
// we don't want writes to the serial port to cause us to pause
|
||||||
// so set serial ports non-blocking once we are ready to drive
|
// so set serial ports non-blocking once we are ready to drive
|
||||||
serial_manager.set_blocking_writes_all(false);
|
serial_manager.set_blocking_writes_all(false);
|
||||||
|
Loading…
Reference in New Issue
Block a user