Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 17 additions & 0 deletions .clusterfuzzlite/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM gcr.io/oss-fuzz-base/base-builder:v1

COPY cmake/CustomOptions.cmake $SRC/qgroundcontrol/cmake/CustomOptions.cmake
COPY test/Fuzz $SRC/qgroundcontrol/test/Fuzz

RUN set -eux; \
mavlink_repository="$(sed -n 's/^set(QGC_MAVLINK_GIT_REPO "\([^"]*\)".*/\1/p' "$SRC/qgroundcontrol/cmake/CustomOptions.cmake")"; \
mavlink_ref="$(sed -n 's/^set(QGC_MAVLINK_GIT_TAG "\([^"]*\)".*/\1/p' "$SRC/qgroundcontrol/cmake/CustomOptions.cmake")"; \
test -n "$mavlink_repository"; \
test -n "$mavlink_ref"; \
git init "$SRC/mavlink"; \
git -C "$SRC/mavlink" fetch --depth=1 "$mavlink_repository" "$mavlink_ref"; \
git -C "$SRC/mavlink" checkout --detach FETCH_HEAD; \
git -C "$SRC/mavlink" submodule update --init --depth=1 pymavlink

COPY .clusterfuzzlite/build.sh $SRC/build.sh
WORKDIR $SRC/qgroundcontrol
45 changes: 45 additions & 0 deletions .clusterfuzzlite/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/bash -eu

custom_options="$SRC/qgroundcontrol/cmake/CustomOptions.cmake"
mavlink_dialect="$(sed -n 's/^set(QGC_MAVLINK_DIALECT "\([^"]*\)".*/\1/p' "$custom_options")"
mavlink_version="$(sed -n 's/^set(QGC_MAVLINK_VERSION "\([^"]*\)".*/\1/p' "$custom_options")"
generated_include="$WORK/mavlink-include"

test -n "$mavlink_dialect"
test -n "$mavlink_version"

PYTHONPATH="$SRC/mavlink" python3 -S -m pymavlink.tools.mavgen \
--no-validate \
--lang=C \
--wire-protocol="$mavlink_version" \
--output "$generated_include/mavlink" \
"$SRC/mavlink/message_definitions/v1.0/${mavlink_dialect}.xml"

include_flags=(
-I"$generated_include/mavlink"
-I"$generated_include/mavlink/$mavlink_dialect"
)
read -r -a cxx_flags <<< "$CXXFLAGS"
read -r -a fuzzing_engine <<< "$LIB_FUZZING_ENGINE"
fuzzer_source="$SRC/qgroundcontrol/test/Fuzz/MAVLinkParserFuzzer.cc"
fuzzer_name="mavlink_parser_fuzzer"

"$CXX" "${cxx_flags[@]}" -std=c++20 "${include_flags[@]}" \
"$fuzzer_source" "${fuzzing_engine[@]}" -o "$OUT/$fuzzer_name"

"$CXX" "${cxx_flags[@]}" -std=c++20 "${include_flags[@]}" \
-DQGC_MAVLINK_SEED_GENERATOR "$fuzzer_source" -o "$WORK/mavlink_seed_generator"
mkdir -p "$WORK/mavlink-corpus"
"$WORK/mavlink_seed_generator" "$WORK/mavlink-corpus/heartbeat"
python3 - "$WORK/mavlink-corpus" "$OUT/${fuzzer_name}_seed_corpus.zip" <<'PY'
from pathlib import Path
import sys
import zipfile

corpus_dir = Path(sys.argv[1])
with zipfile.ZipFile(sys.argv[2], "w", compression=zipfile.ZIP_DEFLATED) as archive:
for seed in corpus_dir.iterdir():
archive.write(seed, arcname=seed.name)
PY

cp "$SRC/qgroundcontrol/test/Fuzz/MAVLinkParserFuzzer.dict" "$OUT/${fuzzer_name}.dict"
1 change: 1 addition & 0 deletions .clusterfuzzlite/project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
language: c++
1 change: 0 additions & 1 deletion .cmake-format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@ markup:
fence_pattern: '^\s*([`~]{3}[`~]*)(.*)$'
ruler_pattern: '^\s*[^\w\s]{3}.*[^\w\s]{3}$'
hashruler_min_length: 10
canonical_bullet: '*'

# -----------------------------------------------------------------------------
# Linting
Expand Down
32 changes: 13 additions & 19 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,25 @@
"build": {
"context": "..",
"dockerfile": "../deploy/docker/Dockerfile",
"target": "linux"
"target": "devcontainer"
},
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools",
"llvm-vs-code-extensions.vscode-clangd",
"ms-vscode.cmake-tools",
"twxs.cmake",
"QML.qml-official",
"vadimcn.vscode-lldb",
"theqtcompany.qt-qml",
"ms-python.python",
"GitHub.copilot"
"streetsidesoftware.code-spell-checker",
"DavidAnson.vscode-markdownlint",
"EditorConfig.EditorConfig",
"redhat.vscode-yaml",
"tamasfe.even-better-toml"
],
"settings": {
"clangd.arguments": [
"--background-index",
"--clang-tidy",
"--header-insertion=iwyu",
"--completion-style=detailed"
],
"cmake.buildDirectory": "${workspaceFolder}/build",
"cmake.configureOnOpen": true,
"cmake.generator": "Ninja",
"editor.formatOnSave": true,
"files.associations": {
"*.qml": "qml"
}
"python.defaultInterpreterPath": "/opt/qgc-venv/bin/python"
}
}
},
Expand All @@ -36,8 +29,9 @@
"ghcr.io/devcontainers/features/github-cli:1": {}
},
"name": "QGroundControl Dev",
"postCreateCommand": "git submodule update --init --recursive",
"remoteUser": "root",
"overrideCommand": true,
"postCreateCommand": "git submodule update --init --recursive && /opt/qgc-venv/bin/python tools/setup/setup_vscode.py --exclude settings",
"remoteUser": "vscode",
"workspaceFolder": "/workspaces/qgroundcontrol",
"workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/qgroundcontrol,type=bind,consistency=cached"
}
16 changes: 14 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,19 @@ indent_size = 4
indent_style = space
indent_size = 2

# YAML files
[*.{yml,yaml}]
# Other structured configuration files
[*.{yml,yaml,toml}]
indent_style = space
indent_size = 2

[*.{ini,cfg,conf,properties}]
indent_style = space
indent_size = 4

[{Dockerfile,Dockerfile-*}]
indent_style = space
indent_size = 4

# Markdown files
[*.md]
indent_style = space
Expand All @@ -62,3 +70,7 @@ max_line_length = 100
# Makefiles (require tabs)
[{Makefile,*.mk}]
indent_style = tab

# Windows command files are the only tracked text files that require CRLF.
[*.{bat,cmd,ps1}]
end_of_line = crlf
9 changes: 6 additions & 3 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Contributor Covenant Code of Conduct

For the contribution workflow, see [CONTRIBUTING.md](CONTRIBUTING.md). For general help and private
security reporting, use [SUPPORT.md](SUPPORT.md) and [SECURITY.md](SECURITY.md).

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
Expand Down Expand Up @@ -40,7 +43,7 @@ Project maintainers who do not follow or enforce the Code of Conduct in good fai

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [https://www.contributor-covenant.org/version/1/4/][version].

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
[homepage]: https://www.contributor-covenant.org/
[version]: https://www.contributor-covenant.org/version/1/4/
82 changes: 55 additions & 27 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ Thank you for considering contributing to QGroundControl! This guide will help y
contributing code, reporting issues, and improving documentation.

> **AI coding agents** (Claude Code, Codex, etc.): see [AGENTS.md](../AGENTS.md) for the canonical
> agent-facing guide (golden rules, `just` build/test commands, definition of done, commit conventions).
> This document remains the human-facing source of truth for the
> [Architecture Patterns](#architecture-patterns) that AGENTS.md links back to.
> agent-facing entry point and definition of done. This document remains the human-facing
> contribution workflow; topic-specific rules live in the guides linked below.

## Table of Contents

1. [Getting Started](#getting-started)
2. [How to Contribute](#how-to-contribute)
3. [Coding Standards](#coding-standards)
4. [Testing Requirements](#testing-requirements)
5. [Pull Request Process](#pull-request-process)
6. [License Requirements](#license-requirements)
7. [Additional Resources](#additional-resources)
4. [Commit Messages](#commit-messages)
5. [Testing Requirements](#testing-requirements)
6. [Pull Request Process](#pull-request-process)
7. [License Requirements](#license-requirements)
8. [Additional Resources](#additional-resources)

---

Expand Down Expand Up @@ -95,7 +95,7 @@ QGroundControl uses [Crowdin](https://crowdin.com/project/qgroundcontrol) for co
- Test on all relevant platforms when possible
- Test with both PX4 and ArduPilot if applicable

5. **Commit your changes** using [Conventional Commits](../AGENTS.md#commit--review-conventions)
5. **Commit your changes** using [Conventional Commits](#commit-messages)

```bash
git add .
Expand All @@ -119,32 +119,61 @@ conventions. Run `just lint` (or `pre-commit run --all-files`) before committing

### Architecture Patterns

QGroundControl has several core architecture patterns you must follow. See [CODING_STYLE.md](../CODING_STYLE.md)
for full details with code examples:
The canonical architecture rules and examples are in
[CODING_STYLE.md](../CODING_STYLE.md#common-pitfalls). Its
[Qt/QML integration section](../CODING_STYLE.md#qt6--qml-integration) covers type registration,
properties, signals, and QML structure.

- **Fact System**: ALL vehicle parameters use Facts — never create custom parameter storage
- **Multi-Vehicle**: ALWAYS null-check `activeVehicle()` before use
- **Firmware Plugin**: Use `vehicle->firmwarePlugin()` for firmware-specific behavior
- **QML Integration**: Use `QML_ELEMENT`/`QML_SINGLETON`/`QML_UNCREATABLE` macros, `Q_PROPERTY` for bindings
#### Architecture Entry Points

Start with these interfaces when changing vehicle parameters, multi-vehicle behavior, or
firmware-specific integration:

1. `src/FactSystem/Fact.h` — parameter system foundation
2. `src/Vehicle/Vehicle.h` — core vehicle model
3. `src/FirmwarePlugin/FirmwarePlugin.h` — firmware abstraction

### Repository Layout

The primary application modules are under `src/`:

```text
src/
├── Vehicle/ # Vehicle state/comms
├── Comms/ # Link layer (serial, UDP, TCP, Bluetooth)
├── FactSystem/ # Parameter management
├── FirmwarePlugin/ # PX4/ArduPilot abstraction
├── AutoPilotPlugins/ # Vehicle setup UI
├── MissionManager/ # Mission planning
├── MAVLink/ # Protocol handling
├── VideoManager/ # Video pipeline (GStreamer)
├── FlyView/ # In-flight UI
├── PlanView/ # Mission planning UI
├── QmlControls/ # Reusable QML components
└── Settings/ # Persistent settings
```

---

## Testing Requirements
## Commit Messages

See [test/README.md](../test/README.md) for the complete testing guide, including base classes, CTest labels,
`MultiSignalSpy`, and coverage.
Use [Conventional Commits](https://www.conventionalcommits.org/) because the type drives release
automation through `.releaserc.json` and semantic-release.

- Release-triggering types: `feat`, `fix`, `perf`, `revert`
- Non-release types: `docs`, `style`, `chore`, `refactor`, `test`, `build`, `ci`
- Example: `fix(Vehicle): guard null activeVehicle in telemetry handler`

**Key points:**
---

- Add unit tests for new functionality in `test/` mirroring `src/` structure
- Use the `UnitTest` base class (or `VehicleTest`, `MissionTest`, etc.)
- Run `ctest --output-on-failure -L Unit` before submitting
- Test on multiple platforms and both PX4/ArduPilot when applicable
## Testing Requirements

### Pre-commit Checks
See [test/README.md](../test/README.md) for the complete testing guide, including base classes, CTest labels,
`MultiSignalSpy`, and coverage.

Run the lint gate before committing (`just lint`, or `pre-commit run --all-files` for the full sweep) —
see [tools/README.md](../tools/README.md) for all available development commands.
Run the checks appropriate to the change. The canonical commands and lint gate are documented in
[tools/README.md](../tools/README.md#quality); test selection and labels are documented in
[test/README.md](../test/README.md#running-tests).

---

Expand Down Expand Up @@ -173,8 +202,7 @@ see [tools/README.md](../tools/README.md) for all available development commands
- Code follows style guidelines
- Tests added for new features
- No unrelated changes
- Commit messages are clear and descriptive (Conventional Commits, see
[AGENTS.md](../AGENTS.md#commit--review-conventions))
- Commit messages follow [Conventional Commits](#commit-messages)

### Review Process

Expand Down
6 changes: 5 additions & 1 deletion .github/COPYING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

QGroundControl is dual-licensed under **Apache 2.0** and **GPL v3**. You may choose either license.

For contribution requirements, see [CONTRIBUTING.md](CONTRIBUTING.md). Community standards and
security reporting are covered by [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) and
[SECURITY.md](SECURITY.md).

## Apache License 2.0

Permissive license that allows QGroundControl to be built and used in any environment, including proprietary applications and mobile app stores. **Requires a commercial Qt license.**
Expand All @@ -18,7 +22,7 @@ Full text: [LICENSE-GPL](../LICENSE-GPL) · <http://www.gnu.org/licenses/gpl-3.0

Contributions must be compatible with **both** licenses. Acceptable sources: original work, or code under BSD-2-Clause, BSD-3-Clause, MIT, or Apache 2.0. GPL-only code cannot be accepted.

See [CONTRIBUTING.md](CONTRIBUTING.md) for the full process.
The contributor workflow is maintained in [CONTRIBUTING.md](CONTRIBUTING.md).

## Questions

Expand Down
8 changes: 4 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE/bugfix.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ Fixes #
## Checklist

- [ ] I have read the [Contribution Guidelines](../CONTRIBUTING.md)
- [ ] My code follows the project's coding standards
- [ ] I have added a test that reproduces the bug
- [ ] New and existing unit tests pass locally
- [ ] My code follows [CODING_STYLE.md](../../CODING_STYLE.md)
- [ ] I added a regression test and ran the relevant checks from the [test guide](../../test/README.md)

---
By submitting this pull request, I confirm that my contribution is made under the terms of the project's dual license (Apache 2.0 and GPL v3).
By submitting this pull request, I confirm that my contribution follows the project's
[dual-license terms](../COPYING.md).
4 changes: 3 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
## Checklist

- [ ] I have read the [Contribution Guidelines](../CONTRIBUTING.md)
- [ ] The change follows the [CI conventions](../README.md#ci-conventions)
- [ ] Workflow permissions follow least-privilege principle
- [ ] No secrets are exposed in logs

---
By submitting this pull request, I confirm that my contribution is made under the terms of the project's dual license (Apache 2.0 and GPL v3).
By submitting this pull request, I confirm that my contribution follows the project's
[dual-license terms](../COPYING.md).
4 changes: 3 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

## Checklist

- [ ] I have read the [Contribution Guidelines](../CONTRIBUTING.md)
- [ ] I have checked for spelling/grammar errors
- [ ] Links are valid and working
- [ ] Screenshots are up to date (if applicable)
Expand All @@ -15,4 +16,5 @@
<!-- Link related issues if any -->

---
By submitting this pull request, I confirm that my contribution is made under the terms of the project's dual license (Apache 2.0 and GPL v3).
By submitting this pull request, I confirm that my contribution follows the project's
[dual-license terms](../COPYING.md).
8 changes: 4 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE/feature.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
## Checklist

- [ ] I have read the [Contribution Guidelines](../CONTRIBUTING.md)
- [ ] My code follows the project's coding standards
- [ ] I have added tests that prove my feature works
- [ ] New and existing unit tests pass locally
- [ ] My code follows [CODING_STYLE.md](../../CODING_STYLE.md)
- [ ] I added appropriate coverage and ran the relevant checks from the [test guide](../../test/README.md)

## Related Issues
<!-- Link related issues: Fixes #123, Relates to #456 -->

---
By submitting this pull request, I confirm that my contribution is made under the terms of the project's dual license (Apache 2.0 and GPL v3).
By submitting this pull request, I confirm that my contribution follows the project's
[dual-license terms](../COPYING.md).
2 changes: 2 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/maintainer.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Summary
<!-- Brief description of changes -->

> Maintainer PRs follow the same [review requirements](../CONTRIBUTING.md#pr-requirements).

## Related Issues
<!-- Optional: Fixes #123 -->
Loading
Loading