您好,欢迎访问三七文档
///-*-tab-width:4;Mode:C++;c-basic-offset:4;indent-tabs-mode:nil-*-#defineTHISFIRMWAREArduCopterV3.1-rc5/*Thisprogramisfreesoftware:youcanredistributeitand/ormodifyitunderthetermsoftheGNUGeneralPublicLicenseaspublishedbytheFreeSoftwareFoundation,eitherversion3oftheLicense,or(atyouroption)anylaterversion.Thisprogramisdistributedinthehopethatitwillbeuseful,butWITHOUTANYWARRANTY;withouteventheimpliedwarrantyofMERCHANTABILITYorFITNESSFORAPARTICULARPURPOSE.SeetheGNUGeneralPublicLicenseformoredetails.YoushouldhavereceivedacopyoftheGNUGeneralPublicLicensealongwiththisprogram.Ifnot,see*//**ArduCopterVersion3.0*Creator:JasonShort*LeadDeveloper:RandyMackay*BasedoncodeandideasfromtheArducopterteam:PatHickey,JoseJulio,JaniHirvinen,AndrewTridgell,JustinBeech,AdamRivera,Jean-LouisNaudin,RobertoNavoni*Thanksto:ChrisAnderson,MikeSmith,JordiMunoz,DougWeibel,JamesGoppert,BenjaminPelletier,RobertLefebvre,MarcoRobustini**SpecialThanksforContributors(inalphabeticalorderbyfirstname):**AdamMRivera:AutoCompassDeclination*AmilcarLucas:Cameramountlibrary*AndrewTridgell:Generaldevelopment,MavlinkSupport*AngelFernandez:Alphatesting*DougWeibel:Libraries*ChristofSchmid:Alphatesting*DaniSaez:VOctoSupport*GregoryFletcher:Cameramountorientationmath*Guntars:Armingsafetysuggestion*HappyKillmore:MavlinkGCS*HeinHollander:OctoSupport*IgorvanAirde:ControlLawoptimization*LeonardHall:FlightDynamics,Throttle,LoiterandNavigationControllers*JonathanChallinger:InertialNavigation*Jean-LouisNaudin:AutoLanding*MaxLevine:TriSupport,Graphics*JackDunkle:Alphatesting*JamesGoppert:MavlinkSupport*JaniHiriven:Testingfeedback*JohnArneBirkeland:PPMEncoder*JoseJulio:StabilizationControllaws*MarcoRobustini:Leadtester*MichaelOborne:MissionPlannerGCS*MikeSmith:Libraries,Codingsupport*Oliver:Piezosupport*OlivierAdler:PPMEncoder*RobertLefebvre:HeliSupport&LEDs*SandroBenigno:Camerasupport**AndmuchmoresoPLEASEPMmeonDIYDRONEStoaddyourcontributiontotheList**RequiresmodifiedmrelaxversionofArduino,whichcanbefoundhere:***///////////////////////////////////////////////////////////////////////////////////Headerincludes////////////////////////////////////////////////////////////////////////////////#includemath.h#includestdio.h#includestdarg.h//Commondependencies#includeAP_Common.h#includeAP_Progmem.h#includeAP_Menu.h#includeAP_Param.h//AP_HAL#includeAP_HAL.h#includeAP_HAL_AVR.h#includeAP_HAL_AVR_SITL.h#includeAP_HAL_PX4.h#includeAP_HAL_FLYMAPLE.h#includeAP_HAL_Linux.h#includeAP_HAL_Empty.h//Applicationdependencies#includeGCS_MAVLink.h//MAVLinkGCS定义#includeAP_GPS.h//ArduPilotGPSlibrary#includeAP_GPS_Glitch.h//全球定位系统干扰保护库#includeDataFlash.h//ArduPilotMegaFlashMemoryLibrary#includeAP_ADC.h//ArduPilotMegaAnalogtoDigitalConverterLibrary#includeAP_ADC_AnalogSource.h#includeAP_Baro.h#includeAP_Compass.h//ArduPilotMegaMagnetometerLibrary#includeAP_Math.h//ArduPilotMegaVector/MatrixmathLibrary#includeAP_Curve.h//Curveusedtolinearlisethrottlepwmtothrust#includeAP_InertialSensor.h//ArduPilotMegaInertialSensor(accel&gyro)Library#includeAP_AHRS.h#includeAPM_PI.h//PIlibrary#includeAC_PID.h//PIDlibrary#includeRC_Channel.h//遥控通道库#includeAP_Motors.h//APMotorslibrary#includeAP_RangeFinder.h//Rangefinderlibrary#includeAP_OpticalFlow.h//OpticalFlowlibrary#includeFilter.h//Filterlibrary#includeAP_Buffer.h//APMFIFOBuffer#includeAP_Relay.h//APMrelay#includeAP_Camera.h//Photoorvideocamera#includeAP_Mount.h//Camera/Antennamount#includeAP_Airspeed.h//neededforAHRSbuild#includeAP_Vehicle.h//neededforAHRSbuild#includeAP_InertialNav.h//ArduPilotMegainertial导航library#includeAC_WPNav.h//ArduCopterwaypointnavigationlibrary#includeAP_Declination.h//ArduPilotMegaDeclinationHelperLibrary#includeAC_Fence.h//ArducopterFencelibrary#includememcheck.h//memorylimitchecker#includeSITL.h//softwareintheloopsupport#includeAP_Scheduler.h//主循环调度程序#includeAP_RCMapper.h//RCinputmappinglibrary#includeAP_Notify.h//Notifylibrary#includeAP_BattMonitor.h//Batterymonitorlibrary#ifSPRAYER==ENABLED#includeAC_Sprayer.h//cropsprayerlibrary#endif//AP_HALArduino兼容性层#includecompat.h//配置#includedefines.h#includeconfig.h#includeconfig_channels.h//Localmodules#includeParameters.h#includeGCS.h//////////////////////////////////////////////////////////////////////////////////cliSerial//////////////////////////////////////////////////////////////////////////////////cliSerialisn'tstrictlynecessary-itisanaliasforhal.console.Itmay//bedeprecatedinfavorofhal.consoleinlaterreleases.staticAP_HAL::BetterStream*cliSerial;//N.B.weneedtokeepastaticdeclarationwhichisn'tguardedbymacros//atthetoptocooperatewiththeprototypemangler.//////////////////////////////////////////////////////////////////////////////////AP_HALinstance////////////////////////////////////////////////////////////////////////////////constAP_HAL::HAL&hal=AP_HAL_BOARD_DRIVER;////////////////////////////////////
本文标题:APM飞控程序解读
链接地址:https://www.777doc.com/doc-4295521 .html