diff --git a/ArduCopter/Copter.cpp b/ArduCopter/Copter.cpp index fe74c38820..0e50c5d00d 100644 --- a/ArduCopter/Copter.cpp +++ b/ArduCopter/Copter.cpp @@ -66,9 +66,6 @@ Copter::Copter(void) mainLoop_count(0), rtl_loiter_start_time(0), auto_trim_counter(0), -#if SPRAYER == ENABLED - sprayer(&inertial_nav), -#endif #if PARACHUTE == ENABLED parachute(relay), #endif diff --git a/ArduCopter/Copter.h b/ArduCopter/Copter.h index a0c9315f3f..e5c42000d8 100644 --- a/ArduCopter/Copter.h +++ b/ArduCopter/Copter.h @@ -571,7 +571,7 @@ private: // Crop Sprayer #if SPRAYER == ENABLED - AC_Sprayer sprayer; + AC_Sprayer sprayer = AC_Sprayer::create(&inertial_nav); #endif // Parachute release