From bf3effcd109b9e48f7c73334a1fb45a622ffe87f Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Fri, 14 Feb 2014 16:28:26 +0900 Subject: [PATCH] AC_WPNav: fix example sketch --- .../examples/AC_WPNav_test/AC_WPNav_test.pde | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/libraries/AC_WPNav/examples/AC_WPNav_test/AC_WPNav_test.pde b/libraries/AC_WPNav/examples/AC_WPNav_test/AC_WPNav_test.pde index f5e7d54460..cb58a3475a 100644 --- a/libraries/AC_WPNav/examples/AC_WPNav_test/AC_WPNav_test.pde +++ b/libraries/AC_WPNav/examples/AC_WPNav_test/AC_WPNav_test.pde @@ -10,7 +10,9 @@ #include #include +#include // Notify library #include // ArduPilot GPS library +#include // GPS glitch protection library #include // ArduPilot Mega Analog to Digital Converter Library #include #include // ArduPilot Mega Barometer Library @@ -19,12 +21,18 @@ #include #include // ArduPilot Mega Inertial Sensor (accel & gyro) Library #include +#include // needed for AHRS build #include #include // PID library -#include // PID library +#include // P library #include // ArduPilot general purpose FIFO buffer #include // Inertial Navigation library #include // Waypoint Navigation library +#include // Position Control library +#include // Attitude Control library +#include // curve library (used by motors) +#include // RC Channel library (used by motors) +#include // Motor library #include #include @@ -46,12 +54,13 @@ AP_Baro_BMP085 baro; // GPS declaration GPS *gps; AP_GPS_Auto auto_gps(&gps); +GPS_Glitch gps_glitch(gps); AP_Compass_HMC5843 compass; -AP_AHRS_DCM ahrs(&ins, gps); +AP_AHRS_DCM ahrs(ins, baro, gps); // Inertial Nav declaration -AP_InertialNav inertialnav(&ahrs, &ins, &baro, &gps); +AP_InertialNav inertialnav(ahrs, baro, gps, gps_glitch); void setup() { @@ -60,9 +69,9 @@ void setup() void loop() { - // call update function - hal.console->printf_P(PSTR("hello")); - hal.scheduler->delay(1); + // print message to user + hal.console->printf_P(PSTR("this example tests compilation only")); + hal.scheduler->delay(5000); } AP_HAL_MAIN();