APM飞控程序解读Word下载.docx
《APM飞控程序解读Word下载.docx》由会员分享,可在线阅读,更多相关《APM飞控程序解读Word下载.docx(66页珍藏版)》请在冰豆网上搜索。
withouteventheimpliedwarrantyof
MERCHANTABILITYorFITNESSFORAPARTICULARPURPOSE.Seethe
GNUGeneralPublicLicenseformoredetails.
YoushouldhavereceivedacopyoftheGNUGeneralPublicLicense
alongwiththisprogram.Ifnot,see<
http:
//www.gnu.org/licenses/>
.
*/
*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:
*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:
*JamesGoppert:
MavlinkSupport
*JaniHiriven:
Testingfeedback
*JohnArneBirkeland:
PPMEncoder
*JoseJulio:
StabilizationControllaws
*MarcoRobustini:
Leadtester
*MichaelOborne:
MissionPlannerGCS
*MikeSmith:
Libraries,Codingsupport
*Oliver:
Piezosupport
*OlivierAdler:
*RobertLefebvre:
HeliSupport&
LEDs
*SandroBenigno:
Camerasupport
*AndmuchmoresoPLEASEPMmeonDIYDRONEStoaddyourcontributiontotheList
*Requiresmodified"
mrelax"
versionofArduino,whichcanbefoundhere:
*
////////////////////////////////////////////////////////////////////////////////
//Headerincludes
#include<
math.h>
stdio.h>
stdarg.h>
//Commondependencies
AP_Common.h>
AP_Progmem.h>
AP_Menu.h>
AP_Param.h>
//AP_HAL
AP_HAL.h>
AP_HAL_AVR.h>
AP_HAL_AVR_SITL.h>
AP_HAL_PX4.h>
AP_HAL_FLYMAPLE.h>
AP_HAL_Linux.h>
AP_HAL_Empty.h>
//Applicationdependencies
GCS_MAVLink.h>
//MAVLinkGCS定义
AP_GPS.h>
//ArduPilotGPSlibrary
AP_GPS_Glitch.h>
//全球定位系统干扰保护库
DataFlash.h>
//ArduPilotMegaFlashMemoryLibrary
AP_ADC.h>
//ArduPilotMegaAnalogtoDigitalConverterLibrary
AP_ADC_AnalogSource.h>
AP_Baro.h>
AP_Compass.h>
//ArduPilotMegaMagnetometerLibrary
AP_Math.h>
//ArduPilotMegaVector/MatrixmathLibrary
AP_Curve.h>
//Curveusedtolinearlisethrottlepwmtothrust
AP_InertialSensor.h>
//ArduPilotMegaInertialSensor(accel&
gyro)Library
AP_AHRS.h>
APM_PI.h>
//PIlibrary
AC_PID.h>
//PIDlibrary
RC_Channel.h>
//遥控通道库
AP_Motors.h>
//APMotorslibrary
AP_RangeFinder.h>
//Rangefinderlibrary
AP_OpticalFlow.h>
//OpticalFlowlibrary
Filter.h>
//Filterlibrary
AP_Buffer.h>
//APMFIFOBuffer
AP_Relay.h>
//APMrelay
AP_Camera.h>
//Photoorvideocamera
AP_Mount.h>
//Camera/Antennamount
AP_Airspeed.h>
//neededforAHRSbuild
AP_Vehicle.h>
AP_InertialNav.h>
//ArduPilotMegainertial导航library
AC_WPNav.h>
//ArduCopterwaypointnavigationlibrary
AP_Declination.h>
//ArduPilotMegaDeclinationHelperLibrary
AC_Fence.h>
//ArducopterFencelibrary
memcheck.h>
//memorylimitchecker
SITL.h>
//softwareintheloopsupport
AP_Scheduler.h>
//主循环调度程序
AP_RCMapper.h>
//RCinputmappinglibrary
AP_Notify.h>
//Notifylibrary
AP_BattMonitor.h>
//Batterymonitorlibrary
#ifSPRAYER==ENABLED
AC_Spraye