> For the complete documentation index, see [llms.txt](https://px4.gitbook.io/px4-user-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://px4.gitbook.io/px4-user-guide/development/concept/px4_systems_architecture.md).

# PX4 Architecture

The sections below provide high-level overview of the PX4 hardware and software stack for two "typical" PX4 systems; one that has just a flight controller, and another that has a flight controller and a companion computer (also known as a "mission computer").

:::note The [PX4 Architectural Overview](/px4-user-guide/development/concept/architecture.md) provides information about the flight stack and middleware. Offboard APIs are covered in [ROS](/px4-user-guide/robotics/ros.md) and [MAVSDK](https://mavsdk.mavlink.io/main/en/). :::

## Flight Controller (only)

The diagram below provides a high level overview of a typical "simple" PX4 system based around a flight controller.

![PX4 architecture - FC only system](https://4155462212-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LArEa7z2SPawfl3HpCD%2Fuploads%2Fgit-blob-248ec3f46da2fc2c257c5e8cfbd53b78b7171226%2Fpx4_arch_fc.svg?alt=media)

The hardware consists of

* [Flight controller](/px4-user-guide/drone_parts/flight_controller.md) (running the PX4 flight stack). This often includes internal IMUs, compass and barometer.
* [Motor ESCs](/px4-user-guide/drone_parts/peripherals/esc_motors.md) connected to [PWM outputs](/px4-user-guide/drone_parts/peripherals/esc_motors/pwm_escs_and_servo.md), [DroneCAN](/px4-user-guide/drone_parts/peripherals/esc_motors/escs.md) (DroneCAN allows two-way communication, not single direction as shown) or some other bus.
* Sensors ([GPS](/px4-user-guide/drone_parts/peripherals/gps_compass.md), [compass](/px4-user-guide/drone_parts/peripherals/gps_compass.md), distance sensors, barometers, optical flow, barometers, ADSB transponders, etc.) connected via I2C, SPI, CAN, UART etc.
* [Camera](/px4-user-guide/drone_parts/peripherals/camera.md) or other payload. Cameras can be connected to PWM outputs or via MAVLink.
* [Telemetry radios](/px4-user-guide/drone_parts/peripherals/telemetry.md) for connecting to a ground station computer/software.
* [RC Control System](/px4-user-guide/getting_started/rc_transmitter_receiver.md) for manual control

The left hand side of the diagram shows the software stack, which is horizontally aligned (approximately) with the hardware parts of the diagram.

* The ground station computer typically runs [QGroundControl](/px4-user-guide/getting_started/px4_basic_concepts.md#qgroundcontrol) (or some other ground station software). It may also run robotics software like [MAVSDK](https://mavsdk.mavlink.io/) or [ROS](/px4-user-guide/robotics/ros.md).
* The PX4 flight stack running on the flight controller includes [drivers](/px4-user-guide/development/modules_main/modules_driver.md), [comms modules](/px4-user-guide/development/modules_main/modules_communication.md), [controllers](/px4-user-guide/development/modules_main/modules_controller.md), [estimators](/px4-user-guide/development/modules_main/modules_controller.md) and other [middleware and system modules](/px4-user-guide/development/modules_main.md).

## FC and Companion Computer

The diagram below shows a PX4 system that includes both a flight controller and a companion computer (here referred to as a "mission computer").

![PX4 architecture - FC + Companion Computer](https://4155462212-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LArEa7z2SPawfl3HpCD%2Fuploads%2Fgit-blob-bcc4b93d1422dc15b2937f70ce12f1c84f65c2b7%2Fpx4_arch_fc_companion.svg?alt=media)

The flight controller runs the normal PX4 flight stack, while a companion computer provides advanced features like [object avoidance](/px4-user-guide/drone_parts/companion_computer/computer_vision/obstacle_avoidance.md) and [collision prevention](/px4-user-guide/drone_parts/companion_computer/computer_vision/collision_prevention.md). The two systems are connected using a fast serial or IP link, and typically communicate using the [MAVLink protocol](https://mavlink.io/en/). Communications with the ground stations and the cloud are usually routed via the companion computer (e.g. using the [MAVLink Router](https://github.com/mavlink-router/mavlink-router) (from Intel)).

PX4 systems typically run a Linux OS on the companion computer (because the [PX4/PX4-Avoidance](https://github.com/PX4/PX4-Avoidance) project delivers ROS-based avoidance libraries designed for Linux). Linux is a much better platform for "general" software development than NuttX; there are many more Linux developers and a lot of useful software has already been written (e.g. for computer vision, communications, cloud integrations, hardware drivers). Companion computers sometimes run Android for the same reason.

:::note The diagram shows a cloud or ground station connection via LTE, an approach that has been used a number of PX4-based systems. PX4 does not deliver software specifically for LTE and/or cloud integration (this requires custom development). :::
