ImageVerifierCode 换一换
格式:DOCX , 页数:66 ,大小:37.23KB ,
资源ID:5067492      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/5067492.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(APM飞控程序解读.docx)为本站会员(b****3)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

APM飞控程序解读.docx

1、APM飞控程序解读/ -*- tab-width: 4; Mode: C+; c-basic-offset: 4; indent-tabs-mode: nil -*-#define THISFIRMWARE ArduCopter V3.1-rc5/* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either

2、 version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Y

3、ou should have received a copy of the GNU General Public License along with this program. If not, see . */* * ArduCopter Version 3.0 * Creator: Jason Short * Lead Developer: Randy Mackay * Based on code and ideas from the Arducopter team: Pat Hickey, Jose Julio, Jani Hirvinen, Andrew Tridgell, Justi

4、n Beech, Adam Rivera, Jean-Louis Naudin, Roberto Navoni * Thanks to: Chris Anderson, Mike Smith, Jordi Munoz, Doug Weibel, James Goppert, Benjamin Pelletier, Robert Lefebvre, Marco Robustini * * Special Thanks for Contributors (in alphabetical order by first name): * * Adam M Rivera :Auto Compass De

5、clination * Amilcar Lucas :Camera mount library * Andrew Tridgell :General development, Mavlink Support * Angel Fernandez :Alpha testing * Doug Weibel :Libraries * Christof Schmid :Alpha testing * Dani Saez :V Octo Support * Gregory Fletcher :Camera mount orientation math * Guntars :Arming safety su

6、ggestion * HappyKillmore :Mavlink GCS * Hein Hollander :Octo Support * Igor van Airde :Control Law optimization * Leonard Hall :Flight Dynamics, Throttle, Loiter and Navigation Controllers * Jonathan Challinger :Inertial Navigation * Jean-Louis Naudin :Auto Landing * Max Levine :Tri Support, Graphic

7、s * Jack Dunkle :Alpha testing * James Goppert :Mavlink Support * Jani Hiriven :Testing feedback * John Arne Birkeland :PPM Encoder * Jose Julio :Stabilization Control laws * Marco Robustini :Lead tester * Michael Oborne :Mission Planner GCS * Mike Smith :Libraries, Coding support * Oliver :Piezo su

8、pport * Olivier Adler :PPM Encoder * Robert Lefebvre :Heli Support & LEDs * Sandro Benigno :Camera support * * And much more so PLEASE PM me on DIYDRONES to add your contribution to the List * * Requires modified mrelax version of Arduino, which can be found here: * * */ Header includes/#include #in

9、clude #include / Common dependencies#include #include #include #include / AP_HAL#include #include #include #include #include #include #include / Application dependencies#include / MAVLink GCS定义#include / ArduPilot GPS library#include / 全球定位系统干扰保护库#include / ArduPilot Mega Flash Memory Library#includ

10、e / ArduPilot Mega Analog to Digital Converter Library#include #include #include / ArduPilot Mega Magnetometer Library#include / ArduPilot Mega Vector/Matrix math Library#include / Curve used to linearlise throttle pwm to thrust#include / ArduPilot Mega Inertial Sensor (accel & gyro) Library#include

11、 #include / PI library#include / PID library#include /遥控通道库#include / AP Motors library#include / Range finder library#include / Optical Flow library#include / Filter library#include / APM FIFO Buffer#include / APM relay#include / Photo or video camera#include / Camera/Antenna mount#include / needed

12、 for AHRS build#include / needed for AHRS build#include / ArduPilot Mega inertial 导航 library#include / ArduCopter waypoint navigation library#include / ArduPilot Mega Declination Helper Library#include / Arducopter Fence library#include / memory limit checker#include / software in the loop support#i

13、nclude / 主循环调度程序#include / RC input mapping library#include / Notify library#include / Battery monitor library#if SPRAYER = ENABLED#include / crop sprayer library#endif/ AP_HAL Arduino兼容性层#include compat.h/配置#include defines.h#include config.h#include config_channels.h/ Local modules#include Paramet

14、ers.h#include GCS.h/ cliSerial/ cliSerial isnt strictly necessary - it is an alias for hal.console. It may/ be deprecated in favor of hal.console in later releases.static AP_HAL:BetterStream* cliSerial;/ N.B. we need to keep a static declaration which isnt guarded by macros/ at the top to cooperate

15、with the prototype mangler. / AP_HAL instance/const AP_HAL:HAL& hal = AP_HAL_BOARD_DRIVER;/ Parameters/ Global parameters are all contained within the g class./static Parameters g;/ main loop schedulerstatic AP_Scheduler scheduler;/ AP_Notify instancestatic AP_Notify notify;/ prototypes/static void

16、update_events(void);static void print_flight_mode(AP_HAL:BetterStream *port, uint8_t mode);/ Dataflash/#if CONFIG_HAL_BOARD = HAL_BOARD_APM2static DataFlash_APM2 DataFlash;#elif CONFIG_HAL_BOARD = HAL_BOARD_APM1static DataFlash_APM1 DataFlash;#elif CONFIG_HAL_BOARD = HAL_BOARD_AVR_SITL/static DataFl

17、ash_File DataFlash(/tmp/APMlogs);static DataFlash_SITL DataFlash;#elif CONFIG_HAL_BOARD = HAL_BOARD_PX4static DataFlash_File DataFlash(/fs/microsd/APM/logs);#elif CONFIG_HAL_BOARD = HAL_BOARD_LINUXstatic DataFlash_File DataFlash(logs);#elsestatic DataFlash_Empty DataFlash;#endif/运行主循环/静态常量AP_Inertia

18、lSensor:Sample_rate ins_sample_rate = AP_InertialSensor:RATE_100HZ;/ Sensors/ There are three basic options related to flight sensor selection./ - Normal flight mode. Real sensors are used./ - HIL Attitude mode. Most sensors are disabled, as the HIL/ protocol supplies attitude information directly./

19、 - HIL Sensors mode. Synthetic sensors are configured that/ supply data from the simulation./ All GPS access should be through this pointer.static GPS *g_gps;static GPS_Glitch gps_glitch(g_gps);/ flight modes convenience arraystatic AP_Int8 *flight_modes = &g.flight_mode1;#if HIL_MODE = HIL_MODE_DIS

20、ABLED #if CONFIG_ADC = ENABLEDstatic AP_ADC_ADS7844 adc; #endif #if CONFIG_IMU_TYPE = CONFIG_IMU_MPU6000static AP_InertialSensor_MPU6000 ins;#elif CONFIG_IMU_TYPE = CONFIG_IMU_OILPANstatic AP_InertialSensor_Oilpan ins(&adc);#elif CONFIG_IMU_TYPE = CONFIG_IMU_SITLstatic AP_InertialSensor_HIL ins;#eli

21、f CONFIG_IMU_TYPE = CONFIG_IMU_PX4static AP_InertialSensor_PX4 ins;#elif CONFIG_IMU_TYPE = CONFIG_IMU_FLYMAPLEAP_InertialSensor_Flymaple ins;#elif CONFIG_IMU_TYPE = CONFIG_IMU_L3G4200DAP_InertialSensor_L3G4200D ins;#endif #if CONFIG_HAL_BOARD = HAL_BOARD_AVR_SITL / When building for SITL we use the

22、HIL barometer and compass driversstatic AP_Baro_HIL barometer;static AP_Compass_HIL compass;static SITL sitl; #else/ Otherwise, instantiate a real barometer and compass driver #if CONFIG_BARO = AP_BARO_BMP085static AP_Baro_BMP085 barometer; #elif CONFIG_BARO = AP_BARO_PX4static AP_Baro_PX4 barometer

23、; #elif CONFIG_BARO = AP_BARO_MS5611 #if CONFIG_MS5611_SERIAL = AP_BARO_MS5611_SPIstatic AP_Baro_MS5611 barometer(&AP_Baro_MS5611:spi); #elif CONFIG_MS5611_SERIAL = AP_BARO_MS5611_I2Cstatic AP_Baro_MS5611 barometer(&AP_Baro_MS5611:i2c); #else #error Unrecognized CONFIG_MS5611_SERIAL setting. #endif

24、#endif #if CONFIG_HAL_BOARD = HAL_BOARD_PX4static AP_Compass_PX4 compass; #elsestatic AP_Compass_HMC5843 compass; #endif #endif/ real GPS selection #if GPS_PROTOCOL = GPS_PROTOCOL_AUTOAP_GPS_Auto g_gps_driver(&g_gps); #elif GPS_PROTOCOL = GPS_PROTOCOL_NMEAAP_GPS_NMEA g_gps_driver; #elif GPS_PROTOCOL = GPS_PROTOCOL_SIRFAP_GPS_SIRF g_gps_driver; #elif GPS_PROTOCOL = GPS_P

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1