From f79b8de5e8276ed126897818a7628b64ee3231a9 Mon Sep 17 00:00:00 2001 From: Jason Short Date: Fri, 16 Sep 2011 19:17:50 -0700 Subject: [PATCH] removed DCM reference from OPT FLOW --- ArduCopter/ArduCopter.pde | 12 +++--------- ArduCopter/config.h | 2 +- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/ArduCopter/ArduCopter.pde b/ArduCopter/ArduCopter.pde index 0691b88635..0f0a93c438 100644 --- a/ArduCopter/ArduCopter.pde +++ b/ArduCopter/ArduCopter.pde @@ -168,7 +168,7 @@ static AP_Int8 *flight_modes = &g.flight_mode1; AP_Compass_HIL compass; // never used AP_IMU_Shim imu; // never used #ifdef OPTFLOW_ENABLED - AP_OpticalFlow_ADNS3080 optflow(&dcm); + AP_OpticalFlow_ADNS3080 optflow; #endif static int32_t gps_base_alt; #else @@ -200,16 +200,10 @@ static AP_Int8 *flight_modes = &g.flight_mode1; AP_DCM dcm(&imu, g_gps); #ifdef OPTFLOW_ENABLED - AP_OpticalFlow_ADNS3080 optflow(&dcm); + AP_OpticalFlow_ADNS3080 optflow(); #endif #endif -#if HIL_MODE == HIL_MODE_ATTITUDE - #ifdef OPTFLOW_ENABLED - AP_OpticalFlow_ADNS3080 optflow(&dcm); - #endif -#endif - //////////////////////////////////////////////////////////////////////////////// // GCS selection //////////////////////////////////////////////////////////////////////////////// @@ -621,7 +615,7 @@ static void medium_loop() #ifdef OPTFLOW_ENABLED if(g.optflow_enabled){ optflow.read(); - optflow.update_position(cos_yaw_x, sin_yaw_y, current_loc.alt); // updates internal lon and lat with estimation based on optical flow + optflow.update_position(dcm.roll, dcm.pitch, cos_yaw_x, sin_yaw_y, current_loc.alt); // updates internal lon and lat with estimation based on optical flow // write to log if (g.log_bitmask & MASK_LOG_OPTFLOW){ diff --git a/ArduCopter/config.h b/ArduCopter/config.h index 3adcd5a07a..d2e40adec0 100644 --- a/ArduCopter/config.h +++ b/ArduCopter/config.h @@ -207,7 +207,7 @@ ////////////////////////////////////////////////////////////////////////////// // OPTICAL_FLOW #if defined( __AVR_ATmega2560__ ) // determines if optical flow code is included - #define OPTFLOW_ENABLED + //#define OPTFLOW_ENABLED #endif //#define OPTFLOW_ENABLED