Ground Control Station for UAVs using MAVLink protocol. C++20/Qt 6.10.0 with QML UI.
Fact System - QGC's type-safe parameter management. Every vehicle parameter uses it.
// ALWAYS use this pattern for parameters
Fact* param = vehicle->parameterManager()->getParameter(-1, "PARAM_NAME");
if (param) {
param->setCookedValue(newValue); // cookedValue = UI (with units)
// param->rawValue() = MAVLink/storage
}Rules:
- Wait for
parametersReadysignal before accessing - Use cookedValue (display) vs rawValue (storage)
- Never create custom parameter storage
- Plugins: FirmwarePlugin (PX4/ArduPilot behavior), AutoPilotPlugin (setup UI), VehicleComponent (individual items)
- Managers: Singleton pattern -
MultiVehicleManager::instance()->activeVehicle()(always null-check!) - QML Integration:
QML_ELEMENT,Q_PROPERTY,Q_INVOKABLE - State Machines: Use
QGCStateMachinefor complex workflows (calibration, parameter loading)
src/
├── FactSystem/ # Parameter management (READ FIRST!)
├── Vehicle/ # Vehicle state (Vehicle.h is critical)
├── FirmwarePlugin/ # PX4/ArduPilot abstraction
├── AutoPilotPlugins/ # Vehicle setup UI
├── MissionManager/ # Mission planning
├── Comms/ # Serial/UDP/TCP/Bluetooth links
git submodule update --init --recursive
~/Qt/6.10.0/gcc_64/bin/qt-cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug
cmake --build build --config Debug
./build/Debug/QGroundControl --unittest # Run tests- Assume single vehicle (always null-check
activeVehicle()) - Access Facts before
parametersReady - Use
Q_ASSERTin production code - Bypass FirmwarePlugin for firmware-specific behavior
- Mix cookedValue/rawValue without conversion
.github/copilot-instructions.md- Detailed architecture guide.github/CONTRIBUTING.md- Contribution guidelinessrc/FactSystem/Fact.h- Parameter system (MOST CRITICAL!)src/Vehicle/Vehicle.h- Vehicle model (~1477 lines)
- Naming: Classes
PascalCase, methodscamelCase, privates_leadingUnderscore - Files:
ClassName.h,ClassName.cc - Defensive: Always validate inputs, null-check pointers, early returns
- Logging:
QGC_LOGGING_CATEGORY(MyLog, "qgc.component")+qCDebug(MyLog) - Braces: Always use, even for single-line if statements
- Formatting:
.clang-format,.clang-tidy,.editorconfigconfigured in repo root - Comments: Keep minimal - code should be self-documenting. No verbose headers or documentation files unless explicitly requested.
- Dev Guide: https://dev.qgroundcontrol.com/
- User Docs: https://docs.qgroundcontrol.com/
- MAVLink: https://mavlink.io/
- Qt 6: https://doc.qt.io/qt-6/
Key Principle: Match existing code style. Use defensive coding. Respect the Fact System architecture.