Browse Source

APMRover2: Allow scripting to run

master
Michael du Breuil 6 years ago committed by Andrew Tridgell
parent
commit
1420ac868d
  1. 5
      APMrover2/Parameters.cpp
  2. 5
      APMrover2/Parameters.h
  3. 5
      APMrover2/Rover.h
  4. 6
      APMrover2/system.cpp

5
APMrover2/Parameters.cpp

@ -703,6 +703,11 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = { @@ -703,6 +703,11 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = {
// @User: Standard
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
};

5
APMrover2/Parameters.h

@ -399,6 +399,11 @@ public: @@ -399,6 +399,11 @@ public:
// balance both pitch trim
AP_Float bal_pitch_trim;
#ifdef ENABLE_SCRIPTING
AP_Scripting scripting;
#endif // ENABLE_SCRIPTING
};
extern const AP_Param::Info var_info[];

5
APMrover2/Rover.h

@ -81,6 +81,11 @@ @@ -81,6 +81,11 @@
#include <AP_Follow/AP_Follow.h>
#include <AP_OSD/AP_OSD.h>
#include <AP_WindVane/AP_WindVane.h>
#ifdef ENABLE_SCRIPTING
#include <AP_Scripting/AP_Scripting.h>
#endif
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
#include <SITL/SITL.h>
#endif

6
APMrover2/system.cpp

@ -196,6 +196,12 @@ void Rover::startup_ground(void) @@ -196,6 +196,12 @@ void Rover::startup_ground(void)
);
#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
// so set serial ports non-blocking once we are ready to drive
serial_manager.set_blocking_writes_all(false);

Loading…
Cancel
Save