From: Sina @walkant seventh part source code preview and Apm:copter Library
English reference: http://dev.ardupilot.com/wiki/apmcopter-code-overview/
This section Source: Http://liung.github.io/blog/apm/2014-08-30-APM-Arducopter code Preview. html
the apm::copter code is placed primarily in the Arducopter folder, and the same library files are used with Arduplane and ardurover .
The following diagram shows the call relationship from airplane mode to motor output:
Apm:copter Program Library
http://dev.ardupilot.com/wiki/apmcopter-programming-libraries/
Http://liung.github.io/blog/apm/2014-08-30-APM-Arducopter Related library introduction. html
These library files are also used by Arduplane and Ardurover. A description of a series of high-level libraries and their function descriptions are listed below.
1 Core Library
- ap_ahrs: Use DCM (Direction cosine matrix method) or EKF (Extended Kalman filter method) to estimate aircraft attitude.
- Ap_common: All execution files (sketch format, Arduino IDE files) and other libraries are required by the base Core library.
- Ap_math: Contains a number of mathematical functions, especially for vector operations
- Ac_pid:pid Controller Library
- Ap_inertialnav: Extending the inertial navigation library with GPS and barometer data
- Ac_attitudecontrol: Attitude control Related Library
- Ap_wpnav: Waypoint-related navigation library
- Ap_motors: Hybrid Motor Library with multi-rotor and conventional helicopters
- Rc_channel: More information on the conversion of PWM input/output data from APM_RC to internal common units, such as angle
- AP_HAL,AP_HAL_AVR,AP_HAL_PX4: A hardware abstraction Layer library that provides a consistent interface to other advanced control codes without worrying about the underlying dissimilar hardware.
2 sensor-related libraries
- Ap_inertialsensor: Reads the gyroscope and accelerometer data and executes standard procedures and provides standard unit data (DEG/S,M/S) to the main program.
- Ap_rangerfinder: Interactive Library of sonar and infrared distance measurement sensors
- Ap_baro: Barometer Related Library
- Ap_gps:gps Related libraries
- Ap_compass: three-axis Compass related Library
- Ap_opticalflow: Optical flow sensor related library
3 Other Libraries
- Ap_mount,ap_camera, Ap_relay: Camera mount Control Library, camera shutter control Library
- Ap_mission: Store/Read flight instruction related library from EEPROM (electrically erasable read-only memory)
- Ap_buffer: A simple Stack (FIFO, first-out) buffer used in inertial navigation
The navigation map for the library is as follows:
Reprint: Pixhawk Source Note Six: Source Preview and Apm:copter Library