# Flight Code

> A system used to control the trajectory of an aircraft without constant 'hands-on' control by a human operator being required. Autopilots do not replace human operators but assist them in controlling aircraft, allowing them to focus on broader aspects of operations such as monitoring the trajectory, weather and systems. [Wikipedia](https://en.wikipedia.org/wiki/Autopilot)
>
> "Wait!" you ask, "Why do you need flight controller for simulator?". The primary job of flight controller is to take in desired state as input, estimate actual state using sensors data and then drive the actuators in such a way so that actual state comes as close to the desired state. For quadrotors, desired state can be specified as roll, pitch and yaw, for example. It than estimates actual roll, pitch and yaw using gyroscope and accelerometer. Then it generates appropriate motor signals so actual state becomes desired state. [AirSim Docs](https://github.com/Microsoft/AirSim/blob/master/docs/flight_controller.md)

* Fligt Controller
  * Inputs .. Sensors(IMU, Compass, Barometer, Somar, Cameras)
  * Inputs .. User Commands
  * Outputs .. Propeller Speeds
* Companion Computer


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://theiotlearninginitiative.gitbook.io/bitol/virtual-drone-solution/flight-code.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
