ArduPilot 架构分析

 ArduPilot 基本架构 点击打开链接

1.vehicle directories 

       定义了每种载具的固件,目前支持4 vehicle types – Plane, Copter, APMrover2 and AntennaTracker.Along with the *.cpp files, each vehicle directory contains a make.inc file which lists library dependencies. The Makefiles read this to create the -I and -L flags for the build.

2.AP_HAL

        硬件抽象层(Hardware Abstraction Layer),There is a top level AP_HAL in libraries(AP_HAL) that defines the interface(定义接口) that the rest of the code has to specific board features(指明特定的板子特性), then there is a AP_HAL_XXX subdirectory for each board type, for example AP_HAL_AVR for AVR based boards, AP_HAL_PX4 for PX4 boards and AP_HAL_Linux for Linux based boards.

3.libraries

4.tools directories

       The tools directories are miscellaneous support directories. For examples, tools/autotest provides the autotest infrastructure behind theautotest.diydrones.com site and tools/Replay provides our log replay utility.

5.external support code

       On some platforms we need external support code to provide additional features or board support. Currently the external trees are:

  • PX4NuttX – the core NuttX RTOS used on PX4 boards
  • PX4Firmware – the base PX4 middleware(中间件) and drivers(驱动) used on PX4 boards
  • uavcan – the uavcan CANBUS implementation used in ArduPilot
  • mavlink – the mavlink protocol and code generator

Build System

      The build system is based around make, but also supports the old arduino IDE for AVR builds. The makefiles are in themk/ directory, and define build rules for each type of supported board

      To build a vehicle or other ‘sketch’ for a particular board target you would type “make TARGET”, where TARGET is the board type. The following board types are currently available:

  • make apm1 – the APM1 board
  • make apm2 – the APM2 board
  • make px4-v1 – the PX4v1
  • make px4-v2 – the Pixhawk (and Arsov AUAV-X2)
  • make pxf – the BBB+PXF cape combination
  • make navio – the RaspberryPi+NavIO cape combination
  • make linux – a generic Linux build
  • make flymaple – the FlyMaple board
  • make vrbain – the VRBrain boards
  • make sitl – the SITL software in the loop simulation

    More ports are being added all the time, so check “make help” file for new targets.









你可能感兴趣的:(飞控)