How jobitjoseph/litewing works
1. LiteWing is a multi-part drone platform, not a single app. The repository contains the onboard flight firmware, ground-control software, Arduino prototypes, PCB designs, and prebuilt flashing images. The architectural center is the ESP32-S3-based flight controller.
2. The main runtime is an ESP-IDF/CMake firmware build. The main/ entrypoint boots the system, while components/ holds reusable modules and drivers. This is a componentized embedded system built on FreeRTOS-style tasking and ESP32 hardware abstraction.
3. The flight stack is largely a Crazyflie-derived port under components/core/crazyflie/. That subsystem contains the core control loop and state machine: commander input, estimator, attitude/position controllers, stabilizer, logging, parameters, and CRTP-style communication services.
4. Sensor acquisition sits below the control stack in components/drivers/ and the Crazyflie HAL layer. The hardware set includes IMU support, barometer, optical flow, range finders, Wi-Fi, motors, LEDs, buzzer, and deck interfaces. These drivers feed raw measurements upward to estimation and telemetry downward to actuation.
5. The estimation boundary is important: IMU, altitude, optical flow, and range data are fused before control decisions are made. The repo includes complementary and Kalman estimator paths, plus dead-reckoning and position-hold experiments in Python that mirror or validate the onboard estimator behavior.
6. Actuation is separated from sensing. Motor control lives in components/drivers/general/motors/, while power distribution and stabilizer logic are in the Crazyflie modules. That boundary is where flight commands become individual motor outputs.
7. Communication is centered on wireless control rather than a traditional tethered ground station. The firmware includes ESP-NOW and Wi-Fi support, and the Python utilities contain joystick, Bluetooth, and flight-control scripts that generate control packets or telemetry requests. The architecture expects an external operator device to send commands over a short-range link.
8. The Python tree is the main offboard control and testing layer. It includes one-off flight behaviors, sensor readers, dead-reckoning experiments, takeoff/height-hold flows, and diagnostics for IMU, ToF, optical flow, battery voltage, and motion flow. These scripts are not one product; they are operational tools around the same onboard vehicle.
9. Python-Scripts/crazyflie-clients-python/ is a substantial ground-control client fork. It provides a GUI, headless client, ZMQ-based automation, input device handling, log/param tools, and calibration/tuning tabs. In the diagram, this is the operator console layer connecting to the drone through the communication stack.
10. Arduino sketches in LiteWing-Arduino/ appear to be legacy or alternate control implementations. They include drone flight logic, ESP-NOW joystick control, and a ground-station HTML page. These are useful as separate experimental control paths, but they are not the primary firmware architecture.
11. The hardware subtree defines the physical platform and its revisions. KiCad projects for LiteWing V2.5C and V2.6C, BOMs, Gerbers, 3D models, and datasheets show the board-level boundary: ESP32-S3 module, sensor chips, motor connectors, USB-C, and support circuitry. This is the hardware target for the firmware and the source of all sensor/actuator interfaces.
12. The repository also ships binary firmware images under LiteWing Firmware binary files/, including bootloader, partition table, and application images. That means the project supports direct flashing/deployment, not only source builds.
13. For an architecture diagram, the clearest layout is: operator tools on one side, wireless link in the middle, onboard ESP32-S3 flight firmware in the center, and physical sensors/motors on the other side. The firmware center should be split into communication, estimation, control, and hardware-driver layers, with the Crazyflie-derived modules called out as the main control framework.
Main entry points: stabilizer.c Crazyflie core · wifilink.c Wireless link · LieWingV2.6.C.kicad_sch Board V2.6C · main.c Main boot
Components 19
Onboard firmware
ESP32-S3 flight controller firmware and embedded control stack.
- Main boot · Firmware startup and system wiring for the onboard controller.
main/main.c - Platform · Board/platform glue between ESP32-specific services and the flight stack.
components/platform/platform_esp32.c - Crazyflie core · Ported control framework and task-oriented flight runtime.
components/core/crazyflie/modules/src/stabilizer.c - Commander · Receives control commands and high-level flight intents.
components/core/crazyflie/modules/src/commander.c - Estimator · Fuses IMU, altitude, flow, and range data into vehicle state.
components/core/crazyflie/modules/src/estimator.c - Controllers · Attitude and position control loops that turn state and setpoints into thrust and rates.
components/core/crazyflie/modules/src/controller.c - Stabilizer · Main stabilization loop and power distribution coordination.
components/core/crazyflie/modules/src/stabilizer.c - Wireless link · Command and telemetry transport over Wi-Fi, ESP-NOW, and related links.
components/core/crazyflie/hal/src/wifilink.c - Sensor HAL · Low-level sensor and peripheral interfaces for IMU, barometer, flow, range, power, and I/O.
components/core/crazyflie/hal/src/sensors.c - Drivers · Reusable device drivers for motors, LEDs, buzzer, Wi-Fi, I2C, SPI, and deck interfaces.
components/drivers/general/motors/motors.c - Motors · Motor output control and motor mapping for the airframe.
components/drivers/general/motors/motors.c - Sensors · IMU, barometer, optical flow, and range sensing inputs feeding estimation.
components/drivers/i2c_devices/mpu6050/mpu6050.c
Offboard tools
Python, Arduino, and ground-control tooling around the vehicle.
- CF client · Forked Crazyflie operator console with GUI, headless mode, logging, tuning, and input handling.
Python-Scripts/crazyflie-clients-python/src/cfclient/gui.py - Python tools · Flight behaviors, sensor readers, hold flows, and validation scripts for the drone.
Python-Scripts/main.py - Arduino forks · Legacy or experimental Arduino-based flight and ESP-NOW control sketches.
LiteWing-Arduino/Arduino-LiteWing-DMP/LiteWing.ino
Hardware
PCB revisions and manufacturing artifacts for the physical platform.
- Board V2.5C · Earlier LiteWing PCB revision and its fabrication outputs.
hardware/LiteWingV2.5C/LiteWingV2.5C.kicad_sch - Board V2.6C · Current LiteWing PCB revision with schematic, layout, BOM, and production data.
hardware/LieWingV2.6.C/LieWingV2.6.C.kicad_sch - Datasheets · Reference documentation for the ESP32-S3, sensors, and flow hardware.
hardware/datasheet/ESP32-S3-WROOM-1/ESP32-S3_datasheet_en.pdf
Binary images
Prebuilt firmware images for flashing and deployment.
- Flash images · Bootloader, partition table, and application binaries for direct flashing.
LiteWing Firmware binary files/LiteWing.bin
Connections 21
- Main boot → Platform: boots on · Main firmware initializes board services and runtime glue.
- Main boot → Crazyflie core: starts · Entrypoint launches the flight stack.
- Crazyflie core → Commander: consumes · Flight stack reads operator commands and setpoints.
- Crazyflie core → Estimator: uses · Control loops depend on fused state estimates.
- Crazyflie core → Controllers: runs · Core invokes attitude and position controllers.
- Controllers → Stabilizer: feeds · Controller outputs are stabilized and mixed for actuation.
- Stabilizer → Motors: drives · Stabilization resolves into motor commands.
- Sensor HAL → Estimator: supplies · Sensor measurements are passed into estimation.
- Sensors → Sensor HAL: read by · Hardware sensors are accessed through HAL wrappers.
- Drivers → Sensors: hosts · Driver layer implements sensor and peripheral devices.
- Drivers → Motors: controls · Driver layer implements motor output hardware.
- Wireless link → Commander: carries · Wireless packets deliver control commands to the vehicle.
- Wireless link → CF client: connects · Operator console communicates with the onboard link stack.
- Python tools → Wireless link: sends · Python scripts generate control and telemetry traffic.
- Arduino forks → Wireless link: uses · Arduino sketches implement alternate ESP-NOW control paths.
- CF client → Python tools: orchestrates · Ground-control tooling and scripts complement the GUI client.
- Board V2.6C → Sensor HAL: targets · Current PCB revision defines the onboard sensor and I/O boundary.
- Board V2.6C → Drivers: maps to · Board peripherals are realized by the firmware drivers.
- Board V2.5C → Board V2.6C: evolves to · Earlier PCB revision precedes the current board design.
- Datasheets → Board V2.6C: documents · Reference specs describe the board's integrated parts.
- Flash images → Main boot: deploys · Prebuilt images correspond to the onboard firmware.