Browse Source

removed DCM reference from OPT FLOW

master
Jason Short 14 years ago
parent
commit
f79b8de5e8
  1. 12
      ArduCopter/ArduCopter.pde
  2. 2
      ArduCopter/config.h

12
ArduCopter/ArduCopter.pde

@ -168,7 +168,7 @@ static AP_Int8 *flight_modes = &g.flight_mode1;
AP_Compass_HIL compass; // never used AP_Compass_HIL compass; // never used
AP_IMU_Shim imu; // never used AP_IMU_Shim imu; // never used
#ifdef OPTFLOW_ENABLED #ifdef OPTFLOW_ENABLED
AP_OpticalFlow_ADNS3080 optflow(&dcm); AP_OpticalFlow_ADNS3080 optflow;
#endif #endif
static int32_t gps_base_alt; static int32_t gps_base_alt;
#else #else
@ -200,16 +200,10 @@ static AP_Int8 *flight_modes = &g.flight_mode1;
AP_DCM dcm(&imu, g_gps); AP_DCM dcm(&imu, g_gps);
#ifdef OPTFLOW_ENABLED #ifdef OPTFLOW_ENABLED
AP_OpticalFlow_ADNS3080 optflow(&dcm); AP_OpticalFlow_ADNS3080 optflow();
#endif #endif
#endif #endif
#if HIL_MODE == HIL_MODE_ATTITUDE
#ifdef OPTFLOW_ENABLED
AP_OpticalFlow_ADNS3080 optflow(&dcm);
#endif
#endif
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// GCS selection // GCS selection
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -621,7 +615,7 @@ static void medium_loop()
#ifdef OPTFLOW_ENABLED #ifdef OPTFLOW_ENABLED
if(g.optflow_enabled){ if(g.optflow_enabled){
optflow.read(); 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 // write to log
if (g.log_bitmask & MASK_LOG_OPTFLOW){ if (g.log_bitmask & MASK_LOG_OPTFLOW){

2
ArduCopter/config.h

@ -207,7 +207,7 @@
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// OPTICAL_FLOW // OPTICAL_FLOW
#if defined( __AVR_ATmega2560__ ) // determines if optical flow code is included #if defined( __AVR_ATmega2560__ ) // determines if optical flow code is included
#define OPTFLOW_ENABLED //#define OPTFLOW_ENABLED
#endif #endif
//#define OPTFLOW_ENABLED //#define OPTFLOW_ENABLED

Loading…
Cancel
Save