Compare commits
105 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c72cfe437e | |||
| 3ab7895af7 | |||
| 3c5574c051 | |||
| eb9a76cfaf | |||
| f545f2227d | |||
| 4e5c0fac7a | |||
| fa0618463d | |||
| f025bb42eb | |||
| 5dba9990b4 | |||
| aaace556cd | |||
| 36c3bfcde8 | |||
| 70e31870af | |||
| 45baeccb01 | |||
| 4917b17116 | |||
| c0633d89ff | |||
| f798d7ce16 | |||
| 35cbbc1967 | |||
| 8ff7255ba7 | |||
| 395236dc7f | |||
| 1ada559eff | |||
| c838206024 | |||
| 582a50030c | |||
| 2dd5c48a82 | |||
| 75b3e9f0d0 | |||
| b17da3caa0 | |||
| 0831782d3a | |||
| 9f9171575e | |||
| 60db79f35e | |||
| 2798910293 | |||
| f77a1a44a0 | |||
| 1ba562f400 | |||
| 4da1c11db9 | |||
| e4d46f20f4 | |||
| 86f0dc2cb1 | |||
| 6b8ee5cba4 | |||
| 823f033abe | |||
| d74db56a06 | |||
| 89e575ed34 | |||
| c592af7e8e | |||
| 461042f3f9 | |||
| cf517f50d8 | |||
| be631ed584 | |||
| 9e0cd2fcf3 | |||
| 44c128aade | |||
| 6912ae7b14 | |||
| f19adb896c | |||
| c3f90af3ef | |||
| a5e55ffd75 | |||
| 3b4df0aead | |||
| 8576e07b73 | |||
| 83c41dcf87 | |||
| 550b7148a5 | |||
| 047fddbcd8 | |||
| dd2530bb09 | |||
| 897ff241ce | |||
| 6f18fa39e8 | |||
| 348a558a15 | |||
| b412796fc7 | |||
| 6597c4680c | |||
| df8747eb10 | |||
| 04134dccab | |||
| 4d0efccb55 | |||
| 115f205cbc | |||
| 039ec78d35 | |||
| 9cfd3a4506 | |||
| 4281faa98a | |||
| 5189d42d68 | |||
| 9b6e7cb800 | |||
| ed387555e9 | |||
| dd03e18fee | |||
| 1079c57fd0 | |||
| ebe0b727d8 | |||
| ad895f7010 | |||
| 685f9248e4 | |||
| 0ffa4e72ac | |||
| c8a1a38147 | |||
| 8624682db1 | |||
| 4caee55a76 | |||
| fffc1b5d04 | |||
| 6a7e39aa64 | |||
| 6306c78f79 | |||
| b9a1c429b3 | |||
| 0dd1640a54 | |||
| 2828162f72 | |||
| 76eca4b7a4 | |||
| 0b621009d5 | |||
| 56c69f4c07 | |||
| c7295c8a4f | |||
| 3ba440c332 | |||
| b04518c0bc | |||
| 45abdb14b3 | |||
| 701ac9b257 | |||
| 6db00a2326 | |||
| 935a21d05c | |||
| d2e3668ad9 | |||
| 541ee6f81d | |||
| 8b870e364e | |||
| b142342c3a | |||
| f444402e6c | |||
| 0d18be5049 | |||
| 197a1a6214 | |||
| 93955bd313 | |||
| 65c96fb2bf | |||
| f4c820c7e1 | |||
| c260794122 |
@@ -0,0 +1,207 @@
|
||||
---
|
||||
name: review-pr
|
||||
description: Review a pull request with structured, domain-aware feedback
|
||||
argument-hint: "<PR number or URL>"
|
||||
allowed-tools: Bash, Read, Glob, Grep, Agent
|
||||
---
|
||||
|
||||
# PX4 Pull Request Review
|
||||
|
||||
Review a pull request with domain-aware checks based on which files are changed.
|
||||
|
||||
**No Claude attribution anywhere.**
|
||||
|
||||
## Steps
|
||||
|
||||
1. **Fetch PR context.** Run these in parallel:
|
||||
- `gh pr view <PR> --json number,title,body,baseRefName,headRefName,files,commits,reviewRequests,reviews,author`
|
||||
- `gh pr checks <PR>` (exit code 8 means some checks are pending, this is normal, not an error)
|
||||
- `gh pr diff <PR>` -- if this fails with HTTP 406 (300+ files), do NOT retry. Instead use `gh api repos/OWNER/REPO/pulls/NUMBER/files --paginate` to get the full file list in one call, then fetch patches for key infrastructure files individually and sample representative changes from each domain touched.
|
||||
- `gh api repos/OWNER/REPO/pulls/NUMBER/comments --paginate --jq '.[] | {user: .user.login, body: .body, path: .path, created_at: .created_at}'` to get inline review comments
|
||||
- `gh api repos/OWNER/REPO/issues/NUMBER/comments --paginate --jq '.[] | {user: .user.login, body: .body, created_at: .created_at}'` to get PR conversation comments
|
||||
|
||||
From the PR metadata, note:
|
||||
- **Assigned reviewers**: who has been requested to review (from `reviewRequests`)
|
||||
- **Existing reviews**: who has already reviewed and their verdict (from `reviews` -- approved, changes_requested, commented, dismissed)
|
||||
- **PR comments and inline comments**: read all existing feedback to avoid duplicating points already raised by other reviewers, and to build on their discussion rather than ignoring it
|
||||
|
||||
2. **Check CI status.** From the `gh pr checks` output in step 1, summarize pass/fail/pending. If there are failures, fetch logs with `gh run view <run-id> --log-failed`. Include CI status in the output.
|
||||
|
||||
3. **Recommend merge strategy.** Analyze the commit history and recommend squash or rebase merge. This decision informs all subsequent commit hygiene feedback.
|
||||
|
||||
**Recommend rebase merge** when:
|
||||
- Commits are atomic, each builds/works independently
|
||||
- Each commit has a proper `type(scope): description` message
|
||||
- The PR intentionally separates logical changes (e.g., refactor + feature, or one commit per module)
|
||||
- The commit history tells a useful story that would be lost by squashing
|
||||
|
||||
**Recommend squash merge** when:
|
||||
- There are WIP, fixup, or review-response commits
|
||||
- Commit messages are messy or inconsistent
|
||||
- The PR is a single logical change spread across multiple commits
|
||||
- There are "oops" or "make format" commits mixed in
|
||||
|
||||
Include the recommendation in the output. If recommending rebase, flag any commits that break atomicity or have bad messages. If recommending squash, don't bother flagging individual commit messages (they'll be discarded) but ensure the PR title is correct since it becomes the squash commit message.
|
||||
|
||||
4. **Check conventional commit title.** Verify the PR title follows `type(scope): description` per CONTRIBUTING.md. The PR title becomes the commit message on squash-merge, so it must be accurate and descriptive. Verify the scope matches the primary area of changed files. If the PR introduces breaking changes, the title must include `!` before the colon. If rebase merge was recommended in step 3, also scan individual commit messages for anti-patterns: vague messages ("fix", "update"), missing type prefix, review-response noise ("apply suggestions from code review", "do make format"), or WIP markers. Flag these for rewording.
|
||||
|
||||
5. **Identify domains touched.** Classify changed files into domains based on paths (a PR may touch multiple):
|
||||
- **Estimation**: `src/modules/ekf2/`, `src/lib/wind_estimator/`, `src/lib/world_magnetic_model/`
|
||||
- **Control**: `src/modules/mc_*control*/`, `src/modules/fw_*control*/`, `src/modules/flight_mode_manager/`, `src/lib/rate_control/`, `src/lib/npfg/`, `src/modules/vtol_att_control/`
|
||||
- **Drivers/CAN**: `src/drivers/`, `src/modules/cyphal/`, `src/drivers/uavcan*/`
|
||||
- **Simulation**: `src/modules/simulation/`, `Tools/simulation/`
|
||||
- **System**: `src/modules/commander/`, `src/modules/logger/`, `src/systemcmds/`, `platforms/`, `src/modules/dataman/`
|
||||
- **Board Addition**: `boards/{manufacturer}/{board}/` (new directories only, not modifications to existing boards)
|
||||
- **CI/Build**: `.github/`, `CMakeLists.txt`, `Makefile`, `cmake/`, `Tools/`, `Kconfig`
|
||||
- **Messages/Protocol**: `msg/`, `src/modules/mavlink/`, `src/modules/uxrce_dds_client/`
|
||||
|
||||
6. **Apply core checks** (always):
|
||||
- **Correctness**: logic errors, off-by-ones, unhandled edge cases
|
||||
- **Type safety**: int16 overflow, float/double promotion, unsigned subtraction, use `uint64_t` for absolute time
|
||||
- **Initialization**: uninitialized variables, missing default construction
|
||||
- **Buffer safety**: unchecked array access, stack allocation of large buffers, snprintf bounds
|
||||
- **Magic numbers**: every numeric literal needs a named constant or justification
|
||||
- **Framework reuse**: use PX4_ERR/WARN/INFO, existing libraries (AlphaFilter, SlewRate, RateControl), MAVLink constants from the library
|
||||
- **Naming**: accurate, no unjustified abbreviations, current terminology (GPS -> GNSS for new code)
|
||||
- **Unnecessary complexity**: can code be removed instead of added? Is there a simpler pattern?
|
||||
- **Test coverage**: new features should include unit or integration tests; bug fixes should include regression tests where practical. When automated testing is infeasible (hardware-specific), require a flight log link from https://logs.px4.io or bench test evidence.
|
||||
- **PR hygiene**: focused scope, no unrelated formatting, no stale submodule changes. Commits should be atomic and independently revertable. Multiple WIP or review-response commits should be squashed. Clean, logical commits will be preserved individually on main via rebase merge. **Do NOT assume PRs are squash-merged. Both squash and rebase merge are enabled; merge commits are disabled.** Verify the PR targets `main` unless it is a backport or release-specific fix.
|
||||
- **Formatting**: `make format` / `make check_format` (astyle) for C/C++ files; `clang-tidy` clean. Python files checked with `mypy` and `flake8`. PRs failing CI format or lint checks will not be merged.
|
||||
- **Coding style**: C/C++ must follow the [PX4 coding style](https://docs.px4.io/main/en/contribute/code.html)
|
||||
- **Necessity**: challenge every addition with "Why?" Is this actually needed or just copied? Can we change a default instead of adding runtime detection?
|
||||
- **Root cause vs symptom**: is this fixing the real problem or masking it?
|
||||
- **Ecosystem impact**: what does this change mean for QGC users, log analysis tools, and third-party integrations?
|
||||
- **Sustainability**: who will maintain this? Does it create long-term burden?
|
||||
- **Architecture fit**: does the code live in the module that naturally owns the data? Are there unnecessary cross-module dependencies?
|
||||
- **End user impact**: will parameters confuse less-technical users? Are error messages actionable in QGC?
|
||||
|
||||
7. **Apply domain checks** based on step 5:
|
||||
|
||||
**Estimation:**
|
||||
- Singularities in aerospace math (euler angles near gimbal lock, sideslip at low airspeed)
|
||||
- Aliasing from downsampling sensor data without filtering
|
||||
- Kalman filter correctness (Joseph form, innovation variance, covariance symmetry)
|
||||
- CPU cost on embedded targets (avoid unnecessary sqrt, limit fusion rate)
|
||||
- Frame/coordinate system correctness (FRD vs NED, body vs earth)
|
||||
|
||||
**Control:**
|
||||
- Phase margin: output filters consume margin for no benefit; prefer adjusting gyro/d-gyro cutoffs
|
||||
- Circular dependencies: sensor data feeding back into its own control loop (e.g., throttle-based airspeed in TECS)
|
||||
- NaN propagation in flight-critical math; check `PX4_ISFINITE` before magnitude checks
|
||||
- Setpoint generation vs output-stage hacks: prefer proper setpoint smoothing over controller output filtering
|
||||
- Yaw control edge cases: heading lock, drift, setpoint propagation
|
||||
- Flight task inheritance chain: correct base class for the desired behavior
|
||||
- Control allocation: actuator function ordering, motor index mapping
|
||||
|
||||
**Drivers/CAN:**
|
||||
- CAN bus devices behave differently from serial/SPI; check driver assumptions
|
||||
- ESC index mapping: telemetry index != channel when motors are disabled
|
||||
- ESC hardware quirks: 4-in-1 ESCs may report current on only one channel
|
||||
- device_id correctness and I2CSPIDriver patterns
|
||||
- Time representation: prefer `hrt_abstime` over iteration counts
|
||||
|
||||
**Simulation:**
|
||||
- Physics fidelity: noise models should match reality (GPS noise is not Gaussian)
|
||||
- Keep gz_bridge generic; vehicle-specific logic belongs in plugins
|
||||
- Prefer gz-transport over ROS2 dependencies when possible
|
||||
- Wrench commands for physics correctness vs kinematic constraints
|
||||
- Library generic/specific boundary: only base classes in common libs
|
||||
|
||||
**System:**
|
||||
- Race conditions and concurrency: no partial fixes, demand complete solutions
|
||||
- Semaphore/scheduling edge cases; understand RTOS guarantees
|
||||
- State machine sequential-logic bugs (consecutive RTL, armed/disarmed alternation)
|
||||
- uORB-driven scheduling (`SubscriptionCallback`), not extra threads
|
||||
- param_set triggers auto-save; no redundant param_save_default
|
||||
- Flash/memory efficiency: avoid `std::string` on embedded, minimize SubscriptionData usage
|
||||
- Constructor initialization order matters
|
||||
|
||||
**CI/Build:**
|
||||
- Pipeline race conditions (tag + branch push double-trigger, git describe correctness)
|
||||
- Container image size (check layer bloat)
|
||||
- Ubuntu LTS support policy (latest + one prior only)
|
||||
- Build time impact
|
||||
- CMake preferred over Makefiles
|
||||
|
||||
**Messages/Protocol:**
|
||||
- Backwards compatibility: will this break QGC, post-flight tools, or uLog parsers?
|
||||
- uORB: `timestamp` for publication metadata, `timestamp_sample` close to physical sample, include `device_id`
|
||||
- Don't version messages unless strictly needed
|
||||
- Parameter UX: will this confuse users in a GCS? Every new param is a configuration burden
|
||||
- MAVLink: use library constants, don't implement custom stream rates
|
||||
|
||||
**Board Addition:**
|
||||
- **Flight logs**: require a link to https://logs.px4.io demonstrating basic operation for the vehicle type (hover for multicopters, stable flight for fixed-wing, driving for rovers, etc.); short bench-only logs are insufficient
|
||||
- **Documentation**: require a docs page in `docs/en/flight_controller/` with pinout, where-to-buy, connector types, version badge, and manufacturer-supported notice block
|
||||
- **USB VID/PID**: must not reuse another manufacturer's Vendor ID; manufacturer must use their own
|
||||
- **Board naming**: directory is `boards/{manufacturer}/{board}/`, both lowercase, hyphens for board name
|
||||
- **Unique board_id**: registered in `boards/boards.json`, no collisions
|
||||
- **Copied code cleanup**: check for leftover files, configs, or comments from the template board; "Is this real or leftover?"
|
||||
- **RC configuration**: prefer `CONFIG_DRIVERS_COMMON_RC` over legacy `CONFIG_DRIVERS_RC_INPUT`
|
||||
- **No board-specific custom modules**: reject copy-pasted drivers (e.g., custom heater) when existing infrastructure works
|
||||
- **Bootloader**: expect a bootloader defconfig (`nuttx-config/bootloader/defconfig`) or explanation of shared bootloader
|
||||
- **CI integration**: board must be added to CI compile workflows so it builds on every PR
|
||||
- **Flash constraints**: verify enabled modules fit in flash; we are running low across all board targets
|
||||
- **Port labels**: serial port labels must match what is physically printed on the board
|
||||
- **Hardware availability**: for unknown manufacturers, verify the product exists and is purchasable (no vaporware)
|
||||
|
||||
8. **Format output** as:
|
||||
- **CI status**: pass/fail summary, link to failed runs if any
|
||||
- **Merge strategy**: recommend squash or rebase merge with reasoning
|
||||
- **Title check**: pass/fail with suggestion
|
||||
- **Review status**: list assigned reviewers and any existing reviews (who approved, who requested changes, key points already raised). Note if your review would duplicate feedback already given.
|
||||
- **Domains detected**: list which domain checks were applied
|
||||
- **Summary**: one paragraph on what the PR does and whether the approach is sound
|
||||
- **Issues**: numbered list, each with file:line, severity (blocker/warning/nit), and explanation. Skip issues already raised by other reviewers unless you have something to add.
|
||||
- **Verdict**: approve, request changes, or needs discussion
|
||||
|
||||
After the structured output, also display a **draft PR comment** formatted using the PR comment formatting rules from step 9. This gives the user a preview of what would be posted.
|
||||
|
||||
9. **Interactive dialog.** After displaying the review, present the user with these options:
|
||||
|
||||
Present options based on the verdict:
|
||||
|
||||
If verdict is **approve**:
|
||||
```
|
||||
What would you like to do?
|
||||
1. Chat about this PR (ask questions, explore code) [default]
|
||||
2. Approve this PR and post the review comment
|
||||
3. Adjust the review or draft (tell me what to change)
|
||||
4. Done for now
|
||||
```
|
||||
|
||||
If verdict is **request changes**:
|
||||
```
|
||||
What would you like to do?
|
||||
1. Chat about this PR (ask questions, explore code) [default]
|
||||
2. Request changes on this PR and post the review comment
|
||||
3. Adjust the review or draft (tell me what to change)
|
||||
4. Done for now
|
||||
```
|
||||
|
||||
If verdict is **needs discussion**:
|
||||
```
|
||||
What would you like to do?
|
||||
1. Chat about this PR (ask questions, explore code) [default]
|
||||
2. Post the review as a comment (no approval or rejection)
|
||||
3. Adjust the review or draft (tell me what to change)
|
||||
4. Done for now
|
||||
```
|
||||
|
||||
Wait for the user to choose before proceeding. If they pick:
|
||||
- **1 (chat)**: enter a free-form conversation about the PR. The user can ask about specific files, code paths, or decisions. When done, loop back to the options. This is the default if the user just presses enter.
|
||||
- **2 (submit)**: use the draft PR comment already shown. Before posting, check if you have review permissions: run `gh api repos/OWNER/REPO/collaborators/$(gh api user --jq .login)/permission --jq .permission` -- if `admin` or `write`, submit as a formal review with `gh pr review <PR> --approve --body "..."` or `gh pr review <PR> --request-changes --body "..."` based on the verdict. If no write access, fall back to `gh pr comment <PR> --body "..."`. Always confirm with the user before posting.
|
||||
- **3 (adjust)**: ask what to change, update the review and draft, then loop back to the options.
|
||||
- **4 (done)**: stop.
|
||||
|
||||
**PR comment formatting rules** (for the draft):
|
||||
When writing the GitHub comment, rewrite the review to sound like a human reviewer, not a structured report. Do NOT include the full skill output. Instead:
|
||||
- Drop most meta-sections (CI status, title check, domains detected, severity labels) but keep the merge strategy recommendation (e.g., "I'd suggest a rebase merge here since the commits are clean and atomic" or "This should be squash-merged, the commit history is messy")
|
||||
- Write conversationally: "Nice work on this. A few things I noticed:" not "Issues: 1. file:line (warning):"
|
||||
- Lead with a brief take on the overall change (1-2 sentences)
|
||||
- List only actionable feedback as natural review comments, not numbered checklists
|
||||
- Skip nits unless they are particularly useful
|
||||
- End with a clear stance: looks good to merge, needs a few changes, or let's discuss X
|
||||
- Post with `gh pr comment <PR> --body "$(cat <<'EOF' ... EOF)"`. Do not post without explicit confirmation.
|
||||
|
||||
If the user provided arguments, use them as context: $ARGUMENTS
|
||||
@@ -0,0 +1 @@
|
||||
build/
|
||||
@@ -0,0 +1,115 @@
|
||||
name: Build PX4 .deb Package
|
||||
description: Build PX4 SITL, run cpack, validate the .deb, and upload artifact
|
||||
|
||||
inputs:
|
||||
target:
|
||||
description: 'Build target: default or sih'
|
||||
required: true
|
||||
artifact-name:
|
||||
description: Name for the uploaded artifact
|
||||
required: true
|
||||
ccache-key-prefix:
|
||||
description: Prefix for ccache cache keys
|
||||
default: deb-ccache
|
||||
ccache-max-size:
|
||||
description: Maximum ccache size
|
||||
default: 400M
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Restore ccache
|
||||
id: ccache-restore
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: ~/.ccache
|
||||
key: ${{ inputs.ccache-key-prefix }}-${{ github.ref_name }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ inputs.ccache-key-prefix }}-${{ github.ref_name }}-
|
||||
${{ inputs.ccache-key-prefix }}-${{ github.base_ref || 'main' }}-
|
||||
${{ inputs.ccache-key-prefix }}-
|
||||
|
||||
- name: Configure ccache
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p ~/.ccache
|
||||
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
|
||||
echo "compression = true" >> ~/.ccache/ccache.conf
|
||||
echo "compression_level = 6" >> ~/.ccache/ccache.conf
|
||||
echo "max_size = ${{ inputs.ccache-max-size }}" >> ~/.ccache/ccache.conf
|
||||
echo "hash_dir = false" >> ~/.ccache/ccache.conf
|
||||
echo "compiler_check = content" >> ~/.ccache/ccache.conf
|
||||
ccache -s
|
||||
ccache -z
|
||||
|
||||
- name: Build PX4 SITL
|
||||
shell: bash
|
||||
run: make px4_sitl_${{ inputs.target }}
|
||||
|
||||
- name: ccache stats
|
||||
if: always()
|
||||
shell: bash
|
||||
run: ccache -s
|
||||
|
||||
- name: Save ccache
|
||||
uses: actions/cache/save@v4
|
||||
if: always()
|
||||
with:
|
||||
path: ~/.ccache
|
||||
key: ${{ inputs.ccache-key-prefix }}-${{ github.ref_name }}-${{ github.sha }}
|
||||
|
||||
- name: Build .deb package
|
||||
shell: bash
|
||||
run: |
|
||||
cd build/px4_sitl_${{ inputs.target }}
|
||||
cpack -G DEB
|
||||
|
||||
- name: Print package info and contents
|
||||
shell: bash
|
||||
run: |
|
||||
cd build/px4_sitl_${{ inputs.target }}
|
||||
echo "--- Package info ---"
|
||||
dpkg-deb -I *.deb
|
||||
echo "--- Package contents ---"
|
||||
dpkg-deb -c *.deb
|
||||
|
||||
- name: Validate sih package
|
||||
if: inputs.target == 'sih'
|
||||
shell: bash
|
||||
run: |
|
||||
cd build/px4_sitl_sih
|
||||
echo "--- Verify NO Gazebo resources ---"
|
||||
! dpkg-deb -c px4_*.deb | grep share/gz > /dev/null && echo "PASS: no Gazebo" || { echo "FAIL: Gazebo found"; exit 1; }
|
||||
echo "--- Install test ---"
|
||||
dpkg -i px4_*.deb
|
||||
test -x /opt/px4/bin/px4 || { echo "FAIL: px4 binary not found"; exit 1; }
|
||||
test -L /usr/bin/px4 || { echo "FAIL: symlink not created"; exit 1; }
|
||||
test ! -d /opt/px4/share/gz || { echo "FAIL: Gazebo dir should not exist"; exit 1; }
|
||||
echo "--- Smoke test ---"
|
||||
/opt/px4/bin/px4 -h
|
||||
echo "PASS: sih package validation successful"
|
||||
|
||||
- name: Validate gazebo package
|
||||
if: inputs.target == 'default'
|
||||
shell: bash
|
||||
run: |
|
||||
cd build/px4_sitl_default
|
||||
echo "--- Verify Gazebo resources in package ---"
|
||||
dpkg-deb -c px4-gazebo_*.deb | grep share/gz/models > /dev/null || { echo "FAIL: models missing"; exit 1; }
|
||||
dpkg-deb -c px4-gazebo_*.deb | grep share/gz/worlds > /dev/null || { echo "FAIL: worlds missing"; exit 1; }
|
||||
echo "--- Install test ---"
|
||||
dpkg -i px4-gazebo_*.deb
|
||||
test -x /opt/px4-gazebo/bin/px4 || { echo "FAIL: px4 binary not found"; exit 1; }
|
||||
test -x /opt/px4-gazebo/bin/px4-gazebo || { echo "FAIL: wrapper not found"; exit 1; }
|
||||
test -L /usr/bin/px4-gazebo || { echo "FAIL: symlink not created"; exit 1; }
|
||||
test -d /opt/px4-gazebo/share/gz/models || { echo "FAIL: Gazebo models not installed"; exit 1; }
|
||||
echo "--- Smoke test ---"
|
||||
/opt/px4-gazebo/bin/px4 -h
|
||||
echo "PASS: gazebo package validation successful"
|
||||
|
||||
- name: Upload .deb artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ inputs.artifact-name }}
|
||||
path: build/px4_sitl_${{ inputs.target }}/*.deb
|
||||
if-no-files-found: error
|
||||
@@ -0,0 +1,21 @@
|
||||
name: Build Gazebo Classic SITL
|
||||
description: Build PX4 firmware and Gazebo Classic plugins with ccache stats
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Build - PX4 Firmware (SITL)
|
||||
shell: bash
|
||||
run: make px4_sitl_default
|
||||
|
||||
- name: Cache - Stats after PX4 Firmware
|
||||
shell: bash
|
||||
run: ccache -s
|
||||
|
||||
- name: Build - Gazebo Classic Plugins
|
||||
shell: bash
|
||||
run: make px4_sitl_default sitl_gazebo-classic
|
||||
|
||||
- name: Cache - Stats after Gazebo Plugins
|
||||
shell: bash
|
||||
run: ccache -s
|
||||
@@ -0,0 +1,22 @@
|
||||
name: Save ccache
|
||||
description: Print ccache stats and save to cache
|
||||
|
||||
inputs:
|
||||
cache-primary-key:
|
||||
description: Primary cache key from setup-ccache output
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Cache - Stats
|
||||
if: always()
|
||||
shell: bash
|
||||
run: ccache -s
|
||||
|
||||
- name: Cache - Save ccache
|
||||
if: always()
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: ~/.ccache
|
||||
key: ${{ inputs.cache-primary-key }}
|
||||
@@ -0,0 +1,56 @@
|
||||
name: Setup ccache
|
||||
description: Restore ccache from cache and configure ccache.conf
|
||||
|
||||
inputs:
|
||||
cache-key-prefix:
|
||||
description: Cache key prefix (e.g. ccache-sitl)
|
||||
required: true
|
||||
max-size:
|
||||
description: Max ccache size (e.g. 300M)
|
||||
required: false
|
||||
default: '300M'
|
||||
base-dir:
|
||||
description: ccache base_dir value
|
||||
required: false
|
||||
default: '${GITHUB_WORKSPACE}'
|
||||
install-ccache:
|
||||
description: Install ccache via apt before configuring
|
||||
required: false
|
||||
default: 'false'
|
||||
|
||||
outputs:
|
||||
cache-primary-key:
|
||||
description: Primary cache key (pass to save-ccache)
|
||||
value: ${{ steps.restore.outputs.cache-primary-key }}
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Cache - Install ccache
|
||||
if: inputs.install-ccache == 'true'
|
||||
shell: bash
|
||||
run: apt-get update && apt-get install -y ccache
|
||||
|
||||
- name: Cache - Restore ccache
|
||||
id: restore
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: ~/.ccache
|
||||
key: ${{ inputs.cache-key-prefix }}-${{ github.ref_name }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ inputs.cache-key-prefix }}-${{ github.ref_name }}-
|
||||
${{ inputs.cache-key-prefix }}-${{ github.base_ref || 'main' }}-
|
||||
${{ inputs.cache-key-prefix }}-
|
||||
|
||||
- name: Cache - Configure ccache
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p ~/.ccache
|
||||
echo "base_dir = ${{ inputs.base-dir }}" > ~/.ccache/ccache.conf
|
||||
echo "compression = true" >> ~/.ccache/ccache.conf
|
||||
echo "compression_level = 6" >> ~/.ccache/ccache.conf
|
||||
echo "max_size = ${{ inputs.max-size }}" >> ~/.ccache/ccache.conf
|
||||
echo "hash_dir = false" >> ~/.ccache/ccache.conf
|
||||
echo "compiler_check = content" >> ~/.ccache/ccache.conf
|
||||
ccache -s
|
||||
ccache -z
|
||||
@@ -0,0 +1,21 @@
|
||||
---
|
||||
applyTo: "boards/**"
|
||||
---
|
||||
|
||||
# Board Addition Review Guidelines
|
||||
|
||||
In addition to the core code review guidelines, when reviewing new board additions:
|
||||
|
||||
- **Flight logs**: require a link to https://logs.px4.io demonstrating basic operation for the vehicle type (hover for multicopters, stable flight for fixed-wing, driving for rovers, etc.); short bench-only logs are insufficient
|
||||
- **Documentation**: require a docs page in `docs/en/flight_controller/` with pinout, where-to-buy, connector types, version badge, and manufacturer-supported notice block
|
||||
- **USB VID/PID**: must not reuse another manufacturer's Vendor ID; manufacturer must use their own
|
||||
- **Board naming**: directory is `boards/{manufacturer}/{board}/`, both lowercase, hyphens for board name
|
||||
- **Unique board_id**: registered in `boards/boards.json`, no collisions
|
||||
- **Copied code cleanup**: check for leftover files, configs, or comments from the template board. Ask "Is this real or leftover?"
|
||||
- **RC configuration**: prefer `CONFIG_DRIVERS_COMMON_RC` over legacy `CONFIG_DRIVERS_RC_INPUT`
|
||||
- **No board-specific custom modules**: reject copy-pasted drivers (e.g., custom heater) when existing infrastructure works
|
||||
- **Bootloader**: expect a bootloader defconfig (`nuttx-config/bootloader/defconfig`) or explanation of shared bootloader
|
||||
- **CI integration**: board must be added to CI compile workflows so it builds on every PR
|
||||
- **Flash constraints**: verify enabled modules fit in flash; we are running low across all board targets
|
||||
- **Port labels**: serial port labels must match what is physically printed on the board
|
||||
- **Hardware availability**: for unknown manufacturers, verify the product exists and is purchasable (no vaporware)
|
||||
@@ -0,0 +1,13 @@
|
||||
---
|
||||
applyTo: ".github/**,cmake/**,Makefile,CMakeLists.txt,Tools/**,**/Kconfig"
|
||||
---
|
||||
|
||||
# CI/Build Review Guidelines
|
||||
|
||||
In addition to the core code review guidelines:
|
||||
|
||||
- Check for pipeline race conditions (tag + branch push double-trigger, git describe correctness)
|
||||
- Container image size: check for layer bloat
|
||||
- Ubuntu LTS support policy: only latest + one prior LTS version
|
||||
- Consider build time impact of changes
|
||||
- Prefer CMake over Makefiles
|
||||
@@ -0,0 +1,32 @@
|
||||
---
|
||||
applyTo: "src/**,boards/**,platforms/**,msg/**,cmake/**,Makefile,CMakeLists.txt,Tools/**,.github/**"
|
||||
---
|
||||
|
||||
# PX4 Code Review Guidelines
|
||||
|
||||
## Conventions
|
||||
|
||||
- PR titles must follow conventional commits: `type(scope): description` (see CONTRIBUTING.md)
|
||||
- Types: `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `build`, `ci`, `chore`, `revert`
|
||||
- Scope should match the primary area of changed files
|
||||
- Append `!` before the colon for breaking changes
|
||||
- Both squash merge and rebase merge are enabled; merge commits are disabled
|
||||
- Commits should be atomic and independently revertable
|
||||
- WIP or review-response commits should be squashed before merge
|
||||
|
||||
## Core Checks (always apply)
|
||||
|
||||
- **Correctness**: logic errors, off-by-ones, unhandled edge cases
|
||||
- **Type safety**: int16 overflow, float/double promotion, unsigned subtraction, use `uint64_t` for absolute time
|
||||
- **Initialization**: uninitialized variables, missing default construction
|
||||
- **Buffer safety**: unchecked array access, stack allocation of large buffers, snprintf bounds
|
||||
- **Magic numbers**: every numeric literal needs a named constant or justification
|
||||
- **Framework reuse**: use PX4_ERR/WARN/INFO, existing libraries (AlphaFilter, SlewRate, RateControl), MAVLink constants from the library
|
||||
- **Naming**: accurate, no unjustified abbreviations, current terminology (GPS -> GNSS for new code)
|
||||
- **Unnecessary complexity**: can code be removed instead of added? Is there a simpler pattern?
|
||||
- **Test coverage**: new features should include unit or integration tests; bug fixes should include regression tests where practical
|
||||
- **Formatting**: `make format` / `make check_format` (astyle) for C/C++ files; `clang-tidy` clean
|
||||
- **Coding style**: C/C++ must follow the PX4 coding style (https://docs.px4.io/main/en/contribute/code.html)
|
||||
- **Necessity**: challenge every addition. Is this actually needed or just copied?
|
||||
- **Architecture fit**: does the code live in the module that naturally owns the data? No unnecessary cross-module dependencies
|
||||
- **Ecosystem impact**: consider QGC users, log analysis tools, and third-party integrations
|
||||
@@ -0,0 +1,15 @@
|
||||
---
|
||||
applyTo: "src/modules/mc_*control*/**,src/modules/fw_*control*/**,src/modules/flight_mode_manager/**,src/lib/rate_control/**,src/lib/npfg/**,src/modules/vtol_att_control/**"
|
||||
---
|
||||
|
||||
# Control Review Guidelines
|
||||
|
||||
In addition to the core code review guidelines:
|
||||
|
||||
- Phase margin: output filters consume margin for no benefit; prefer adjusting gyro/d-gyro cutoffs
|
||||
- Check for circular dependencies: sensor data feeding back into its own control loop (e.g., throttle-based airspeed in TECS)
|
||||
- NaN propagation in flight-critical math; check `PX4_ISFINITE` before magnitude checks
|
||||
- Prefer proper setpoint smoothing over controller output filtering (setpoint generation vs output-stage hacks)
|
||||
- Check yaw control edge cases: heading lock, drift, setpoint propagation
|
||||
- Verify flight task inheritance chain uses the correct base class for desired behavior
|
||||
- Control allocation: verify actuator function ordering and motor index mapping
|
||||
@@ -0,0 +1,13 @@
|
||||
---
|
||||
applyTo: "src/drivers/**,src/modules/cyphal/**"
|
||||
---
|
||||
|
||||
# Drivers/CAN Review Guidelines
|
||||
|
||||
In addition to the core code review guidelines:
|
||||
|
||||
- CAN bus devices behave differently from serial/SPI; check driver assumptions
|
||||
- ESC index mapping: telemetry index != channel when motors are disabled
|
||||
- ESC hardware quirks: 4-in-1 ESCs may report current on only one channel
|
||||
- Verify device_id correctness and I2CSPIDriver patterns
|
||||
- Time representation: prefer `hrt_abstime` over iteration counts
|
||||
@@ -0,0 +1,13 @@
|
||||
---
|
||||
applyTo: "src/modules/ekf2/**,src/lib/wind_estimator/**,src/lib/world_magnetic_model/**"
|
||||
---
|
||||
|
||||
# Estimation Review Guidelines
|
||||
|
||||
In addition to the core code review guidelines:
|
||||
|
||||
- Check for singularities in aerospace math (euler angles near gimbal lock, sideslip at low airspeed)
|
||||
- Flag aliasing from downsampling sensor data without proper filtering
|
||||
- Verify Kalman filter correctness (Joseph form, innovation variance, covariance symmetry)
|
||||
- Consider CPU cost on embedded targets (avoid unnecessary sqrt, limit fusion rate)
|
||||
- Verify frame/coordinate system correctness (FRD vs NED, body vs earth frame)
|
||||
@@ -0,0 +1,13 @@
|
||||
---
|
||||
applyTo: "msg/**,src/modules/mavlink/**,src/modules/uxrce_dds_client/**"
|
||||
---
|
||||
|
||||
# Messages/Protocol Review Guidelines
|
||||
|
||||
In addition to the core code review guidelines:
|
||||
|
||||
- Backwards compatibility: will this break QGC, post-flight tools, or uLog parsers?
|
||||
- uORB: `timestamp` for publication metadata, `timestamp_sample` close to physical sample, include `device_id`
|
||||
- Don't version messages unless strictly needed
|
||||
- Parameter UX: will this confuse users in a GCS? Every new param is a configuration burden
|
||||
- MAVLink: use library constants, don't implement custom stream rates
|
||||
@@ -0,0 +1,13 @@
|
||||
---
|
||||
applyTo: "src/modules/simulation/**,Tools/simulation/**"
|
||||
---
|
||||
|
||||
# Simulation Review Guidelines
|
||||
|
||||
In addition to the core code review guidelines:
|
||||
|
||||
- Physics fidelity: noise models should match reality (GPS noise is not Gaussian)
|
||||
- Keep gz_bridge generic; vehicle-specific logic belongs in plugins
|
||||
- Prefer gz-transport over ROS2 dependencies when possible
|
||||
- Use wrench commands for physics correctness vs kinematic constraints
|
||||
- Library generic/specific boundary: only base classes in common libs
|
||||
@@ -0,0 +1,15 @@
|
||||
---
|
||||
applyTo: "src/modules/commander/**,src/modules/logger/**,src/systemcmds/**,platforms/**,src/modules/dataman/**"
|
||||
---
|
||||
|
||||
# System Review Guidelines
|
||||
|
||||
In addition to the core code review guidelines:
|
||||
|
||||
- Race conditions and concurrency: no partial fixes, demand complete solutions
|
||||
- Semaphore/scheduling edge cases; understand RTOS guarantees
|
||||
- State machine sequential-logic bugs (consecutive RTL, armed/disarmed alternation)
|
||||
- Use uORB-driven scheduling (`SubscriptionCallback`), not extra threads
|
||||
- `param_set` triggers auto-save; no redundant `param_save_default`
|
||||
- Flash/memory efficiency: avoid `std::string` on embedded, minimize SubscriptionData usage
|
||||
- Constructor initialization order matters
|
||||
@@ -0,0 +1,220 @@
|
||||
name: SITL Packages and Containers
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ['v*']
|
||||
pull_request:
|
||||
paths:
|
||||
- 'cmake/package.cmake'
|
||||
- 'platforms/posix/CMakeLists.txt'
|
||||
- 'Tools/packaging/**'
|
||||
- 'boards/px4/sitl/sih.px4board'
|
||||
- '.github/workflows/build_deb_package.yml'
|
||||
- '.github/actions/build-deb/**'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
deploy_containers:
|
||||
description: 'Push container images to registry'
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
jobs:
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Setup: extract version and determine whether to push containers
|
||||
# ---------------------------------------------------------------------------
|
||||
setup:
|
||||
name: Setup
|
||||
runs-on: [runs-on,"runner=1cpu-linux-x64","image=ubuntu24-full-x64","run-id=${{ github.run_id }}",extras=s3-cache,spot=false]
|
||||
outputs:
|
||||
px4_version: ${{ steps.version.outputs.px4_version }}
|
||||
should_push: ${{ steps.push.outputs.should_push }}
|
||||
steps:
|
||||
- uses: runs-on/action@v2
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-tags: true
|
||||
submodules: false
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set PX4 version
|
||||
id: version
|
||||
run: echo "px4_version=$(git describe --tags --match 'v[0-9]*')" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Check if we should push containers
|
||||
id: push
|
||||
run: |
|
||||
if [[ "${{ startsWith(github.ref, 'refs/tags/') }}" == "true" ]] || \
|
||||
[[ "${{ github.event_name }}" == "workflow_dispatch" && "${{ github.event.inputs.deploy_containers }}" == "true" ]]; then
|
||||
echo "should_push=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "should_push=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Build .deb packages (all distros, arches, targets)
|
||||
# ---------------------------------------------------------------------------
|
||||
build-deb:
|
||||
name: "Build .deb (${{ matrix.target }}/${{ matrix.codename }}/${{ matrix.arch }})"
|
||||
needs: setup
|
||||
runs-on: [runs-on,"runner=4cpu-linux-${{ matrix.runner }}","image=ubuntu24-full-${{ matrix.runner }}","run-id=${{ github.run_id }}",extras=s3-cache,spot=false]
|
||||
container:
|
||||
image: ${{ matrix.container }}
|
||||
volumes:
|
||||
- /github/workspace:/github/workspace
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- { codename: noble, arch: amd64, runner: x64, container: "ubuntu:24.04", target: default, setup_flags: "" }
|
||||
- { codename: noble, arch: arm64, runner: arm64, container: "ubuntu:24.04", target: default, setup_flags: "" }
|
||||
- { codename: jammy, arch: amd64, runner: x64, container: "ubuntu:22.04", target: default, setup_flags: "" }
|
||||
- { codename: jammy, arch: arm64, runner: arm64, container: "ubuntu:22.04", target: default, setup_flags: "" }
|
||||
- { codename: noble, arch: amd64, runner: x64, container: "ubuntu:24.04", target: sih, setup_flags: "--no-sim-tools" }
|
||||
- { codename: noble, arch: arm64, runner: arm64, container: "ubuntu:24.04", target: sih, setup_flags: "--no-sim-tools" }
|
||||
- { codename: jammy, arch: amd64, runner: x64, container: "ubuntu:22.04", target: sih, setup_flags: "--no-sim-tools" }
|
||||
- { codename: jammy, arch: arm64, runner: arm64, container: "ubuntu:22.04", target: sih, setup_flags: "--no-sim-tools" }
|
||||
env:
|
||||
RUNS_IN_DOCKER: true
|
||||
steps:
|
||||
- uses: runs-on/action@v2
|
||||
|
||||
- name: Fix git in container
|
||||
run: |
|
||||
apt-get update && apt-get install -y git
|
||||
git config --global --add safe.directory $(realpath .)
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
fetch-tags: true
|
||||
|
||||
- name: Use AWS regional apt mirror
|
||||
if: startsWith(runner.name, 'runs-on--')
|
||||
run: ./Tools/ci/use_aws_apt_mirror.sh
|
||||
|
||||
- name: Cache apt packages
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: /var/cache/apt/archives
|
||||
key: apt-${{ matrix.target }}-${{ matrix.codename }}-${{ matrix.arch }}-${{ hashFiles('Tools/setup/ubuntu.sh') }}
|
||||
restore-keys: apt-${{ matrix.target }}-${{ matrix.codename }}-${{ matrix.arch }}-
|
||||
|
||||
- name: Install dependencies
|
||||
run: ./Tools/setup/ubuntu.sh --no-nuttx ${{ matrix.setup_flags }}
|
||||
|
||||
- name: Build and package .deb
|
||||
uses: ./.github/actions/build-deb
|
||||
with:
|
||||
target: ${{ matrix.target }}
|
||||
artifact-name: px4-sitl-debs-${{ matrix.target }}-${{ matrix.codename }}-${{ matrix.arch }}
|
||||
ccache-key-prefix: deb-ccache-${{ matrix.target }}-${{ matrix.codename }}-${{ matrix.arch }}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Build Docker images from Noble .debs
|
||||
# ---------------------------------------------------------------------------
|
||||
build-docker:
|
||||
name: "Build Image (${{ matrix.image }}/${{ matrix.arch }})"
|
||||
needs: [setup, build-deb]
|
||||
runs-on: [runs-on,"runner=4cpu-linux-${{ matrix.runner }}","image=ubuntu24-full-${{ matrix.runner }}","run-id=${{ github.run_id }}",extras=s3-cache,spot=false]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- { image: sih, repo: px4-sitl, target: sih, arch: amd64, runner: x64, platform: "linux/amd64", dockerfile: Dockerfile.sih }
|
||||
- { image: sih, repo: px4-sitl, target: sih, arch: arm64, runner: arm64, platform: "linux/arm64", dockerfile: Dockerfile.sih }
|
||||
- { image: gazebo, repo: px4-sitl-gazebo, target: default, arch: amd64, runner: x64, platform: "linux/amd64", dockerfile: Dockerfile.gazebo }
|
||||
- { image: gazebo, repo: px4-sitl-gazebo, target: default, arch: arm64, runner: arm64, platform: "linux/arm64", dockerfile: Dockerfile.gazebo }
|
||||
steps:
|
||||
- uses: runs-on/action@v2
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: false
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Download Noble .deb artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: px4-sitl-debs-${{ matrix.target }}-noble-${{ matrix.arch }}
|
||||
path: docker-context
|
||||
|
||||
- name: Prepare build context
|
||||
run: cp Tools/packaging/px4-entrypoint.sh docker-context/
|
||||
|
||||
- name: Login to registries
|
||||
if: needs.setup.outputs.should_push == 'true'
|
||||
run: |
|
||||
echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin
|
||||
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
driver: docker-container
|
||||
platforms: ${{ matrix.platform }}
|
||||
|
||||
- name: Build and push container image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: docker-context
|
||||
file: Tools/packaging/${{ matrix.dockerfile }}
|
||||
tags: |
|
||||
px4io/${{ matrix.repo }}:${{ needs.setup.outputs.px4_version }}-${{ matrix.arch }}
|
||||
px4io/${{ matrix.repo }}:latest-${{ matrix.arch }}
|
||||
ghcr.io/px4/${{ matrix.repo }}:${{ needs.setup.outputs.px4_version }}-${{ matrix.arch }}
|
||||
ghcr.io/px4/${{ matrix.repo }}:latest-${{ matrix.arch }}
|
||||
platforms: ${{ matrix.platform }}
|
||||
load: false
|
||||
push: ${{ needs.setup.outputs.should_push == 'true' }}
|
||||
provenance: false
|
||||
cache-from: type=gha,scope=sitl-${{ matrix.image }}-${{ matrix.arch }}
|
||||
cache-to: type=gha,mode=max,scope=sitl-${{ matrix.image }}-${{ matrix.arch }}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Deploy: create multi-arch manifests and push to registries
|
||||
# ---------------------------------------------------------------------------
|
||||
deploy:
|
||||
name: "Deploy (${{ matrix.image }})"
|
||||
needs: [setup, build-docker]
|
||||
if: needs.setup.outputs.should_push == 'true'
|
||||
runs-on: [runs-on,"runner=1cpu-linux-x64","image=ubuntu24-full-x64","run-id=${{ github.run_id }}",extras=s3-cache,spot=false]
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- { image: sih, repo: px4-sitl }
|
||||
- { image: gazebo, repo: px4-sitl-gazebo }
|
||||
steps:
|
||||
- uses: runs-on/action@v2
|
||||
|
||||
- name: Login to registries
|
||||
run: |
|
||||
echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin
|
||||
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
|
||||
|
||||
- name: Create and push multi-arch manifests
|
||||
run: |
|
||||
VERSION="${{ needs.setup.outputs.px4_version }}"
|
||||
|
||||
for REGISTRY in px4io ghcr.io/px4; do
|
||||
IMAGE="${REGISTRY}/${{ matrix.repo }}"
|
||||
|
||||
for TAG in ${VERSION} latest; do
|
||||
docker manifest create ${IMAGE}:${TAG} \
|
||||
--amend ${IMAGE}:${TAG}-arm64 \
|
||||
--amend ${IMAGE}:${TAG}-amd64
|
||||
|
||||
docker manifest annotate ${IMAGE}:${TAG} ${IMAGE}:${TAG}-arm64 --arch arm64
|
||||
docker manifest annotate ${IMAGE}:${TAG} ${IMAGE}:${TAG}-amd64 --arch amd64
|
||||
|
||||
docker manifest push ${IMAGE}:${TAG}
|
||||
done
|
||||
done
|
||||
@@ -49,6 +49,10 @@ jobs:
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Use AWS regional apt mirror
|
||||
if: startsWith(runner.name, 'runs-on--')
|
||||
run: ./Tools/ci/use_aws_apt_mirror.sh
|
||||
|
||||
- name: Install Deps, Build, and Make Quick Check
|
||||
run: |
|
||||
# we need to install dependencies and build on the same step
|
||||
|
||||
@@ -24,6 +24,11 @@ on:
|
||||
description: 'Container tag (e.g. v1.16.0)'
|
||||
required: true
|
||||
type: string
|
||||
build_ref:
|
||||
description: 'Git ref to build from (branch, tag, or SHA). Leave empty to build from the dispatch ref.'
|
||||
required: false
|
||||
type: string
|
||||
default: ''
|
||||
deploy_to_registry:
|
||||
description: 'Whether to push built images to the registry'
|
||||
required: false
|
||||
@@ -45,9 +50,10 @@ jobs:
|
||||
meta_tags: ${{ steps.meta.outputs.tags }}
|
||||
meta_labels: ${{ steps.meta.outputs.labels }}
|
||||
steps:
|
||||
- uses: runs-on/action@v1
|
||||
- uses: actions/checkout@v4
|
||||
- uses: runs-on/action@v2
|
||||
- uses: actions/checkout@v5
|
||||
with:
|
||||
ref: ${{ github.event.inputs.build_ref || github.ref }}
|
||||
fetch-tags: true
|
||||
submodules: false
|
||||
fetch-depth: 0
|
||||
@@ -64,7 +70,7 @@ jobs:
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
uses: docker/metadata-action@v6
|
||||
with:
|
||||
images: |
|
||||
ghcr.io/PX4/px4-dev
|
||||
@@ -89,22 +95,23 @@ jobs:
|
||||
runner: x64
|
||||
runs-on: [runs-on,"runner=4cpu-linux-${{ matrix.runner }}","image=ubuntu24-full-${{ matrix.runner }}","run-id=${{ github.run_id }}",extras=s3-cache,spot=false]
|
||||
steps:
|
||||
- uses: runs-on/action@v1
|
||||
- uses: actions/checkout@v4
|
||||
- uses: runs-on/action@v2
|
||||
- uses: actions/checkout@v5
|
||||
with:
|
||||
ref: ${{ github.event.inputs.build_ref || github.ref }}
|
||||
fetch-tags: true
|
||||
submodules: false
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@v4
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/') || (github.event_name == 'workflow_dispatch' && github.event.inputs.deploy_to_registry) }}
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@v4
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/') || (github.event_name == 'workflow_dispatch' && github.event.inputs.deploy_to_registry) }}
|
||||
with:
|
||||
registry: ghcr.io
|
||||
@@ -112,13 +119,13 @@ jobs:
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
uses: docker/setup-buildx-action@v4
|
||||
with:
|
||||
driver: docker-container
|
||||
platforms: ${{ matrix.platform }}
|
||||
|
||||
- name: Build and Load Container Image
|
||||
uses: docker/build-push-action@v6
|
||||
uses: docker/build-push-action@v7
|
||||
id: docker
|
||||
with:
|
||||
context: Tools/setup
|
||||
@@ -131,7 +138,7 @@ jobs:
|
||||
push: ${{ startsWith(github.ref, 'refs/tags/') || (github.event_name == 'workflow_dispatch' && github.event.inputs.deploy_to_registry) }}
|
||||
provenance: false
|
||||
cache-from: type=gha,scope=${{ matrix.arch }}
|
||||
cache-to: type=gha,mode=max,scope=${{ matrix.arch }}
|
||||
cache-to: type=gha,mode=max,scope=${{ matrix.arch }},ignore-error=true
|
||||
|
||||
deploy:
|
||||
name: Deploy To Registry
|
||||
@@ -140,23 +147,27 @@ jobs:
|
||||
packages: write
|
||||
runs-on: [runs-on,"runner=4cpu-linux-x64","image=ubuntu24-full-x64","run-id=${{ github.run_id }}",extras=s3-cache,spot=false]
|
||||
needs: [build, setup]
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/') || (github.event_name == 'workflow_dispatch' && github.event.inputs.deploy_to_registry) }}
|
||||
if: |
|
||||
!cancelled() &&
|
||||
needs.setup.result == 'success' &&
|
||||
(startsWith(github.ref, 'refs/tags/') || (github.event_name == 'workflow_dispatch' && github.event.inputs.deploy_to_registry == 'true'))
|
||||
steps:
|
||||
- uses: runs-on/action@v1
|
||||
- uses: actions/checkout@v4
|
||||
- uses: runs-on/action@v2
|
||||
- uses: actions/checkout@v5
|
||||
with:
|
||||
ref: ${{ github.event.inputs.build_ref || github.ref }}
|
||||
fetch-tags: true
|
||||
submodules: false
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@v4
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@v4
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
@@ -164,10 +175,10 @@ jobs:
|
||||
|
||||
- name: Verify Images Exist Before Creating Manifest
|
||||
run: |
|
||||
docker manifest inspect px4io/px4-dev:${{ needs.setup.outputs.px4_version }}-arm64 || echo "⚠️ Warning: No ARM64 image found!"
|
||||
docker manifest inspect px4io/px4-dev:${{ needs.setup.outputs.px4_version }}-amd64 || echo "⚠️ Warning: No AMD64 image found!"
|
||||
docker manifest inspect ghcr.io/px4/px4-dev:${{ needs.setup.outputs.px4_version }}-arm64 || echo "⚠️ Warning: No ARM64 image found!"
|
||||
docker manifest inspect ghcr.io/px4/px4-dev:${{ needs.setup.outputs.px4_version }}-amd64 || echo "⚠️ Warning: No AMD64 image found!"
|
||||
docker manifest inspect px4io/px4-dev:${{ needs.setup.outputs.px4_version }}-arm64
|
||||
docker manifest inspect px4io/px4-dev:${{ needs.setup.outputs.px4_version }}-amd64
|
||||
docker manifest inspect ghcr.io/px4/px4-dev:${{ needs.setup.outputs.px4_version }}-arm64
|
||||
docker manifest inspect ghcr.io/px4/px4-dev:${{ needs.setup.outputs.px4_version }}-amd64
|
||||
|
||||
- name: Create and Push Multi-Arch Manifest for Docker Hub
|
||||
run: |
|
||||
|
||||
@@ -89,7 +89,9 @@ jobs:
|
||||
. /opt/ros/galactic/setup.bash
|
||||
mkdir -p /opt/px4_ws/src
|
||||
cd /opt/px4_ws/src
|
||||
BRANCH="${GITHUB_HEAD_REF:-$GITHUB_REF_NAME}"
|
||||
# On a PR, target the branch we're merging into (main or release/X.Y).
|
||||
# On a direct push, fall back to the branch we're running on.
|
||||
BRANCH="${GITHUB_BASE_REF:-$GITHUB_REF_NAME}"
|
||||
REPO_URL="https://github.com/Auterion/px4-ros2-interface-lib.git"
|
||||
if git ls-remote --heads "$REPO_URL" "$BRANCH" | grep -q "$BRANCH"; then
|
||||
echo "Cloning px4-ros2-interface-lib with matching branch: $BRANCH"
|
||||
@@ -130,7 +132,7 @@ jobs:
|
||||
run: |
|
||||
. /opt/px4_ws/install/setup.bash
|
||||
/opt/Micro-XRCE-DDS-Agent/build/MicroXRCEAgent udp4 localhost -p 8888 -v 0 &
|
||||
test/ros_test_runner.py --verbose --model iris --upload --force-color
|
||||
test/ros_test_runner.py --verbose --model iris --force-color
|
||||
timeout-minutes: 45
|
||||
|
||||
- name: Upload failed logs
|
||||
|
||||
@@ -39,10 +39,10 @@ jobs:
|
||||
- name: Check for issues
|
||||
id: check
|
||||
run: |
|
||||
if grep -q "NOASSERTION" /tmp/sbom-verify.txt; then
|
||||
if grep -q "<-- UNRESOLVED" /tmp/sbom-verify.txt; then
|
||||
echo "has_issues=true" >> "$GITHUB_OUTPUT"
|
||||
# Extract NOASSERTION lines
|
||||
grep "NOASSERTION" /tmp/sbom-verify.txt | grep -v "skipped" > /tmp/sbom-issues.txt || true
|
||||
# Extract only genuinely unresolved license lines
|
||||
grep "<-- UNRESOLVED" /tmp/sbom-verify.txt > /tmp/sbom-issues.txt || true
|
||||
# Extract copyleft lines
|
||||
sed -n '/Copyleft licenses detected/,/^$/p' /tmp/sbom-verify.txt > /tmp/sbom-copyleft.txt || true
|
||||
else
|
||||
|
||||
@@ -173,13 +173,35 @@ set(config_module_list)
|
||||
set(config_kernel_list)
|
||||
|
||||
# Find Python
|
||||
find_package(PythonInterp 3)
|
||||
#
|
||||
# Force FindPython3 to prefer the interpreter on PATH (and any activated
|
||||
# virtualenv/conda/pyenv environment) so downstream tooling runs under
|
||||
# the same Python the developer invoked the build with. On Linux these
|
||||
# are already the CMake defaults; the settings exist to normalize
|
||||
# behavior on macOS and Windows:
|
||||
#
|
||||
# - FIND_FRAMEWORK=LAST prevents FindPython3 from preferring a macOS
|
||||
# Python.framework install (e.g. Homebrew's
|
||||
# /opt/homebrew/Frameworks/Python.framework/...) over a pyenv shim
|
||||
# or venv on PATH, which would otherwise pick an interpreter that
|
||||
# lacks PX4's Python deps (kconfiglib, empy, jinja2, etc.).
|
||||
# - FIND_REGISTRY=NEVER skips the Windows registry lookup for the
|
||||
# same reason.
|
||||
# - FIND_STRATEGY and FIND_VIRTUALENV are set explicitly to make the
|
||||
# intent obvious and insulate us from future default changes.
|
||||
set(Python3_FIND_STRATEGY LOCATION)
|
||||
set(Python3_FIND_VIRTUALENV FIRST)
|
||||
set(Python3_FIND_FRAMEWORK LAST)
|
||||
set(Python3_FIND_REGISTRY NEVER)
|
||||
find_package(Python3 COMPONENTS Interpreter)
|
||||
# We have a custom error message to tell users how to install python3.
|
||||
if(NOT PYTHONINTERP_FOUND)
|
||||
if(NOT Python3_Interpreter_FOUND)
|
||||
message(FATAL_ERROR "Python 3 not found. Please install Python 3:\n"
|
||||
" Ubuntu: sudo apt install python3 python3-dev python3-pip\n"
|
||||
" macOS: brew install python")
|
||||
endif()
|
||||
# Alias to the legacy variable so downstream CMakeLists keep working.
|
||||
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
|
||||
|
||||
option(PYTHON_COVERAGE "Python code coverage" OFF)
|
||||
if(PYTHON_COVERAGE)
|
||||
|
||||
@@ -2,45 +2,82 @@
|
||||
|
||||
## 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.
|
||||
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
|
||||
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment include:
|
||||
Examples of behavior that contributes to a positive environment for our community include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
* Demonstrating empathy and kindness toward other people
|
||||
* Being respectful of differing opinions, viewpoints, and experiences
|
||||
* Giving and gracefully accepting constructive feedback
|
||||
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
||||
* Focusing on what is best not just for us as individuals, but for the overall community
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
Examples of unacceptable behavior include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* The use of sexualized language or imagery, and sexual attention or advances of any kind
|
||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic address, without explicit permission
|
||||
* Publishing others' private information, such as a physical or email address, without their explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
## Enforcement Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
||||
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
||||
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
||||
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at lorenz@px4.io. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at coc@dronecode.org. All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
||||
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
||||
|
||||
## Enforcement Guidelines
|
||||
|
||||
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
||||
|
||||
### 1. Correction
|
||||
|
||||
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
||||
|
||||
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
||||
|
||||
### 2. Warning
|
||||
|
||||
**Community Impact**: A violation through a single incident or series of actions.
|
||||
|
||||
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
||||
|
||||
### 3. Temporary Ban
|
||||
|
||||
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
|
||||
|
||||
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
||||
|
||||
### 4. Permanent Ban
|
||||
|
||||
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
||||
|
||||
**Consequence**: A permanent ban from any sort of public interaction within the community.
|
||||
|
||||
## 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 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
||||
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/4/
|
||||
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
||||
|
||||
For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations].
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
||||
[Mozilla CoC]: https://github.com/mozilla/diversity
|
||||
[FAQ]: https://www.contributor-covenant.org/faq
|
||||
[translations]: https://www.contributor-covenant.org/translations
|
||||
|
||||
@@ -220,6 +220,10 @@ menu "examples"
|
||||
source "src/examples/Kconfig"
|
||||
endmenu
|
||||
|
||||
menu "templates"
|
||||
source "src/templates/Kconfig"
|
||||
endmenu
|
||||
|
||||
menu "platforms"
|
||||
depends on PLATFORM_QURT || PLATFORM_POSIX || PLATFORM_NUTTX
|
||||
source "platforms/Kconfig"
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
Maintainers
|
||||
===========
|
||||
|
||||
See [the documentation on Maintainers](https://docs.px4.io/main/en/contribute/maintainers.html) to learn about the role of the maintainers and the process to become one.
|
||||
PX4 is maintained by a group of contributors trusted to steward the project. All maintainers listed below are members of the @PX4/dev-team, have write access, and participate in maintainer decisions. We recognize two types: **Code Owners**, responsible for specific components, and **Reviewers**, who help across the project without a fixed component.
|
||||
|
||||
**Active Maintainers**
|
||||
See [the documentation on Maintainers](https://docs.px4.io/main/en/contribute/maintainers) to learn about the role of the maintainers and the process to become one.
|
||||
|
||||
**Code Owners**
|
||||
|
||||
| Name | Sector | GitHub | Chat | email
|
||||
|-------------------------|--------|--------|------|----------------
|
||||
@@ -23,6 +25,15 @@ See [the documentation on Maintainers](https://docs.px4.io/main/en/contribute/ma
|
||||
| Jacob Dahl | Simulation | [@dakejahl](https://github.com/dakejahl) | dakejahl | <dahl.jakejacob@gmail.com>
|
||||
|
||||
|
||||
**Reviewers**
|
||||
|
||||
Reviewers help maintain PX4 across the project without ownership of a specific component.
|
||||
|
||||
| Name | GitHub | Chat | email
|
||||
|------|--------|------|----------------------
|
||||
| _No reviewers yet._ | | |
|
||||
|
||||
|
||||
**Documentation Maintainers**
|
||||
|
||||
| Name | GitHub | Chat | email
|
||||
|
||||
@@ -9,11 +9,16 @@
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/PX4/PX4-Autopilot/releases"><img src="https://img.shields.io/github/release/PX4/PX4-Autopilot.svg" alt="Releases"></a>
|
||||
<a href="https://www.bestpractices.dev/projects/6520"><img src="https://www.bestpractices.dev/projects/6520/badge" alt="OpenSSF Best Practices"></a>
|
||||
<a href="https://github.com/PX4/PX4-Autopilot/releases"><img src="https://img.shields.io/github/release/PX4/PX4-Autopilot.svg" alt="Release"></a>
|
||||
<a href="https://zenodo.org/badge/latestdoi/22634/PX4/PX4-Autopilot"><img src="https://zenodo.org/badge/22634/PX4/PX4-Autopilot.svg" alt="DOI"></a>
|
||||
<a href="https://github.com/PX4/PX4-Autopilot/actions/workflows/build_all_targets.yml"><img src="https://github.com/PX4/PX4-Autopilot/actions/workflows/build_all_targets.yml/badge.svg?branch=main" alt="Build Targets"></a>
|
||||
<a href="https://discord.gg/dronecode"><img src="https://discordapp.com/api/guilds/1022170275984457759/widget.png?style=shield" alt="Discord"></a>
|
||||
<a href="https://discord.gg/dronecode"><img src="https://img.shields.io/discord/1022170275984457759?label=discord&logo=discord&logoColor=white&color=5865F2" alt="Discord"></a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://www.bestpractices.dev/projects/6520"><img src="https://www.bestpractices.dev/projects/6520/badge" alt="OpenSSF Best Practices"></a>
|
||||
<a href="https://insights.linuxfoundation.org/project/px4"><img src="https://insights.linuxfoundation.org/api/badge/health-score?project=px4" alt="LFX Health Score"></a>
|
||||
<a href="https://insights.linuxfoundation.org/project/px4"><img src="https://insights.linuxfoundation.org/api/badge/contributors?project=px4" alt="LFX Contributors"></a>
|
||||
<a href="https://insights.linuxfoundation.org/project/px4"><img src="https://insights.linuxfoundation.org/api/badge/active-contributors?project=px4" alt="LFX Active Contributors"></a>
|
||||
</p>
|
||||
|
||||
---
|
||||
@@ -99,6 +104,22 @@ make px4_sitl
|
||||
|
||||
We welcome contributions of all kinds — bug reports, documentation, new features, and code reviews. Please read the [Contribution Guide](https://docs.px4.io/main/en/contribute/) to get started.
|
||||
|
||||
## Citation
|
||||
|
||||
If you use PX4 in academic work, please cite it. BibTeX:
|
||||
|
||||
```bibtex
|
||||
@software{px4_autopilot,
|
||||
author = {Meier, Lorenz and {The PX4 Contributors}},
|
||||
title = {{PX4 Autopilot}},
|
||||
publisher = {Zenodo},
|
||||
doi = {10.5281/zenodo.595432},
|
||||
url = {https://px4.io}
|
||||
}
|
||||
```
|
||||
|
||||
The DOI above is a Zenodo concept DOI that always resolves to the latest release. For a version-pinned citation, see the [Zenodo record](https://doi.org/10.5281/zenodo.595432) or our [`CITATION.cff`](CITATION.cff).
|
||||
|
||||
## Governance
|
||||
|
||||
The PX4 Autopilot project is hosted by the [Dronecode Foundation](https://www.dronecode.org/), a [Linux Foundation](https://www.linuxfoundation.org/) Collaborative Project. Dronecode holds all PX4 trademarks and serves as the project's legal guardian, ensuring vendor-neutral stewardship — no single company owns the name or controls the roadmap. The source code is licensed under the [BSD 3-Clause](LICENSE) license, so you are free to use, modify, and distribute it in your own projects.
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
param set UAVCAN_ENABLE 0
|
||||
|
||||
param set-default CA_AIRFRAME 1
|
||||
param set-default CA_ROTOR_COUNT 1
|
||||
param set-default CA_ROTOR0_PX 0.3
|
||||
|
||||
@@ -38,7 +39,6 @@ param set-default SYS_HITL 2
|
||||
# - without real battery
|
||||
param set-default CBRK_SUPPLY_CHK 894281
|
||||
|
||||
param set SIH_T_MAX 6
|
||||
param set SIH_MASS 0.3
|
||||
param set SIH_IXX 0.00402
|
||||
param set SIH_IYY 0.0144
|
||||
@@ -48,3 +48,21 @@ param set SIH_KDV 0.2
|
||||
|
||||
param set SIH_VEHICLE_TYPE 1 # sih as fixed wing
|
||||
param set RWTO_TKOFF 1 # enable takeoff from runway (as opposed to launched)
|
||||
|
||||
# pusher propeller model with advance ratio, model from UIUC APC 8x6"
|
||||
param set SIH_F_T_MAX 6
|
||||
param set SIH_F_Q_MAX 0.03
|
||||
# if SIH_F_CT0 > 0, SIH_F_T_MAX and SIH_F_Q_MAX will be overridden
|
||||
param set SIH_F_CT0 0.131
|
||||
param set SIH_F_CT1 0.004
|
||||
param set SIH_F_CT2 -0.146
|
||||
param set SIH_F_CP0 0.0777
|
||||
param set SIH_F_CP1 0.0498
|
||||
param set SIH_F_CP2 -0.11
|
||||
param set SIH_F_DIA_INCH 8
|
||||
param set SIH_F_RPM_MAX 9000
|
||||
|
||||
param set-default FW_AIRSPD_MIN 7
|
||||
param set-default FW_AIRSPD_TRIM 10
|
||||
param set-default FW_AIRSPD_MAX 12
|
||||
param set-default FW_PSP_OFF 0.5
|
||||
|
||||
@@ -28,6 +28,7 @@ param set-default VT_FW_DIFTHR_EN 1
|
||||
param set-default VT_FW_DIFTHR_S_Y 0.3
|
||||
param set-default MPC_MAN_Y_MAX 60
|
||||
param set-default MC_PITCH_P 5
|
||||
param set-default FW_PSP_OFF 5
|
||||
|
||||
param set-default CA_AIRFRAME 4
|
||||
param set-default CA_ROTOR_COUNT 2
|
||||
@@ -56,7 +57,6 @@ param set-default HIL_ACT_REV 32
|
||||
param set-default MAV_TYPE 19
|
||||
|
||||
|
||||
|
||||
# set SYS_HITL to 2 to start the SIH and avoid sensors startup
|
||||
param set-default SYS_HITL 2
|
||||
|
||||
@@ -66,8 +66,9 @@ param set-default CBRK_SUPPLY_CHK 894281
|
||||
|
||||
param set-default SENS_DPRES_OFF 0.001
|
||||
|
||||
param set SIH_T_MAX 2.0
|
||||
param set SIH_Q_MAX 0.0165
|
||||
# tailsitter is equipped with two forward propellers
|
||||
param set SIH_F_T_MAX 2
|
||||
param set SIH_F_Q_MAX 0.0165
|
||||
param set SIH_MASS 0.2
|
||||
# IXX and IZZ are inverted from the thesis as the body frame is pitched by 90 deg
|
||||
param set SIH_IXX 0.00354
|
||||
@@ -77,6 +78,19 @@ param set SIH_IXZ 0
|
||||
param set SIH_KDV 0.2
|
||||
param set SIH_L_ROLL 0.145
|
||||
|
||||
# propeller diameter, rpm, and coeffs coming from the thesis
|
||||
# Modeling and control of a flying wing tailsitter unmanned aerial vehicle."
|
||||
# Chiappinelli, Romain, supervised by Nahon, Meyer, McGill University, Masters thesis, 2018.
|
||||
# if SIH_F_CT0 > 0, SIH_F_T_MAX and SIH_F_Q_MAX will be overridden
|
||||
param set SIH_F_CT0 0.1342
|
||||
param set SIH_F_CT1 -0.1196
|
||||
param set SIH_F_CT2 -0.1281
|
||||
param set SIH_F_CP0 0.0522
|
||||
param set SIH_F_CP1 -0.0146
|
||||
param set SIH_F_CP2 -0.0602
|
||||
param set SIH_F_DIA_INCH 5
|
||||
param set SIH_F_RPM_MAX 14000
|
||||
|
||||
# sih as tailsitter
|
||||
param set SIH_VEHICLE_TYPE 2
|
||||
|
||||
|
||||
@@ -56,6 +56,7 @@ param set-default CA_SV_CS2_TYPE 4 # rudder
|
||||
param set-default FW_AIRSPD_MIN 7
|
||||
param set-default FW_AIRSPD_TRIM 10
|
||||
param set-default FW_AIRSPD_MAX 12
|
||||
param set-default VT_FWD_THRUST_EN 1
|
||||
|
||||
param set-default HIL_ACT_FUNC1 101
|
||||
param set-default HIL_ACT_FUNC2 102
|
||||
@@ -77,6 +78,7 @@ param set-default CBRK_SUPPLY_CHK 894281
|
||||
|
||||
param set-default SENS_DPRES_OFF 0.001
|
||||
|
||||
# quadrotor propellers
|
||||
param set SIH_T_MAX 2.0
|
||||
param set SIH_Q_MAX 0.0165
|
||||
param set SIH_MASS 0.2
|
||||
@@ -88,5 +90,18 @@ param set SIH_IXZ 0
|
||||
param set SIH_KDV 0.2
|
||||
param set SIH_L_ROLL 0.2
|
||||
|
||||
# pusher propeller model with advance ratio, model from UIUC APC 8x6"
|
||||
param set SIH_F_T_MAX 6
|
||||
param set SIH_F_Q_MAX 0.03
|
||||
# if SIH_F_CT0 > 0, SIH_F_T_MAX and SIH_F_Q_MAX will be overridden
|
||||
param set SIH_F_CT0 0.131
|
||||
param set SIH_F_CT1 0.004
|
||||
param set SIH_F_CT2 -0.146
|
||||
param set SIH_F_CP0 0.0777
|
||||
param set SIH_F_CP1 0.0498
|
||||
param set SIH_F_CP2 -0.11
|
||||
param set SIH_F_DIA_INCH 8
|
||||
param set SIH_F_RPM_MAX 9000
|
||||
|
||||
# sih as standard vtol
|
||||
param set SIH_VEHICLE_TYPE 3
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# @name SIH Hexacopter X
|
||||
#
|
||||
# @type Simulation
|
||||
# @class Copter
|
||||
#
|
||||
# @maintainer Romain Chiappinelli <romain.chiap@gmail.com>
|
||||
#
|
||||
# @board px4_fmu-v2 exclude
|
||||
#
|
||||
|
||||
. ${R}etc/init.d/rc.mc_defaults
|
||||
|
||||
param set UAVCAN_ENABLE 0
|
||||
|
||||
# set SYS_HITL to 2 to start the SIH and avoid sensors startup
|
||||
param set SYS_HITL 2
|
||||
|
||||
# disable some checks to allow to fly:
|
||||
# - without real battery
|
||||
param set-default CBRK_SUPPLY_CHK 894281
|
||||
|
||||
param set SIH_VEHICLE_TYPE 4
|
||||
|
||||
# Symmetric hexacopter X clockwise motor numbering
|
||||
param set-default CA_ROTOR_COUNT 6
|
||||
param set-default CA_ROTOR0_PX 0.866
|
||||
param set-default CA_ROTOR0_PY 0.5
|
||||
param set-default CA_ROTOR1_PX 0
|
||||
param set-default CA_ROTOR1_PY 1
|
||||
param set-default CA_ROTOR1_KM -0.05
|
||||
param set-default CA_ROTOR2_PX -0.866
|
||||
param set-default CA_ROTOR2_PY 0.5
|
||||
param set-default CA_ROTOR3_PX -0.866
|
||||
param set-default CA_ROTOR3_PY -0.5
|
||||
param set-default CA_ROTOR3_KM -0.05
|
||||
param set-default CA_ROTOR4_PX 0
|
||||
param set-default CA_ROTOR4_PY -1
|
||||
param set-default CA_ROTOR5_PX 0.866
|
||||
param set-default CA_ROTOR5_PY -0.5
|
||||
param set-default CA_ROTOR5_KM -0.05
|
||||
|
||||
param set-default HIL_ACT_FUNC1 101
|
||||
param set-default HIL_ACT_FUNC2 102
|
||||
param set-default HIL_ACT_FUNC3 103
|
||||
param set-default HIL_ACT_FUNC4 104
|
||||
param set-default HIL_ACT_FUNC5 105
|
||||
param set-default HIL_ACT_FUNC6 106
|
||||
@@ -49,6 +49,7 @@ if(CONFIG_MODULES_SIMULATION_PWM_OUT_SIM)
|
||||
1101_rc_plane_sih.hil
|
||||
1102_tailsitter_duo_sih.hil
|
||||
1103_standard_vtol_sih.hil
|
||||
1105_rc_hexa_x_sih.hil
|
||||
)
|
||||
if(CONFIG_MODULES_ROVER_ACKERMANN)
|
||||
px4_add_romfs_files(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#! /bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# exit when any command fails
|
||||
set -e
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [[ $# -eq 0 ]] ; then
|
||||
exit 0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
# Flash PX4 to a device running AuterionOS in the local network
|
||||
if [ "$1" == "-h" ] || [ "$1" == "--help" ] || [ $# -lt 2 ]; then
|
||||
echo "Usage: $0 -f <firmware.px4|.elf> [-c <configuration_dir>] -d <IP/Device> [-u <user>] [-p <ssh_port>] [--revert]"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
# This script is meant to be used by the build_all.yml workflow in a github runner
|
||||
# Please only modify if you know what you are doing
|
||||
set -e
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#! /bin/bash
|
||||
#!/usr/bin/env bash
|
||||
# Copy a git diff between two commits if msg versioning is added
|
||||
|
||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
|
||||
@@ -478,6 +478,7 @@ def verify_licenses(source_dir):
|
||||
sub_dir = source_dir / sub_path
|
||||
|
||||
checked_out = sub_dir.is_dir() and any(sub_dir.iterdir())
|
||||
has_explicit_override = sub_path in license_overrides
|
||||
if not checked_out:
|
||||
detected = "(not checked out)"
|
||||
override = license_overrides.get(sub_path, "")
|
||||
@@ -487,9 +488,12 @@ def verify_licenses(source_dir):
|
||||
override = license_overrides.get(sub_path, "")
|
||||
final = override if override else detected
|
||||
|
||||
if final == "NOASSERTION" and checked_out:
|
||||
if final == "NOASSERTION" and has_explicit_override:
|
||||
# Explicitly acknowledged in overrides file — not a failure
|
||||
marker = " (acknowledged)"
|
||||
elif final == "NOASSERTION" and checked_out:
|
||||
has_noassertion = True
|
||||
marker = " <-- NOASSERTION"
|
||||
marker = " <-- UNRESOLVED"
|
||||
elif final == "NOASSERTION" and not checked_out:
|
||||
marker = " (skipped)"
|
||||
else:
|
||||
@@ -521,7 +525,7 @@ def verify_licenses(source_dir):
|
||||
print()
|
||||
|
||||
if has_noassertion:
|
||||
print("FAIL: Some submodules resolved to NOASSERTION. "
|
||||
print("FAIL: Some submodules have unresolved licenses. "
|
||||
"Add an entry to Tools/ci/license-overrides.yaml or check the LICENSE file.")
|
||||
return 1
|
||||
|
||||
|
||||
@@ -9,6 +9,12 @@ overrides:
|
||||
license: "LGPL-3.0-only AND MIT"
|
||||
comment: "Generator is LGPL-3.0; PX4 ships only MIT-licensed generated headers."
|
||||
|
||||
Tools/simulation/gazebo-classic/sitl_gazebo-classic:
|
||||
license: "BSD-3-Clause"
|
||||
comment: >-
|
||||
PX4 org project. No LICENSE file in repo; source files carry
|
||||
BSD-3-Clause headers consistent with the PX4 project license.
|
||||
|
||||
src/lib/cdrstream/cyclonedds:
|
||||
license: "EPL-2.0 OR BSD-3-Clause"
|
||||
comment: >-
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
mkdir artifacts
|
||||
cp **/**/*.px4 artifacts/ 2>/dev/null || true
|
||||
@@ -29,6 +29,9 @@ for build_dir_path in build/*/ ; do
|
||||
# Events
|
||||
mkdir -p artifacts/$build_dir/events/
|
||||
cp $build_dir_path/events/all_events.json.xz artifacts/$build_dir/events/ 2>/dev/null || true
|
||||
# Also copy to top level: firmware advertises the metadata URI without the events/ subdirectory
|
||||
# (see src/lib/component_information/CMakeLists.txt comp_metadata_events_uri_board)
|
||||
cp $build_dir_path/events/all_events.json.xz artifacts/$build_dir/ 2>/dev/null || true
|
||||
# SBOM
|
||||
cp $build_dir_path/*.sbom.spdx.json artifacts/$build_dir/ 2>/dev/null || true
|
||||
ls -la artifacts/$build_dir
|
||||
|
||||
@@ -0,0 +1,147 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Run clang-tidy incrementally on files changed in a PR.
|
||||
|
||||
Usage: run-clang-tidy-pr.py <base-ref>
|
||||
base-ref: e.g. origin/main
|
||||
|
||||
Computes the set of translation units (TUs) affected by the PR diff,
|
||||
then invokes Tools/run-clang-tidy.py on that subset only.
|
||||
Exits 0 silently when no C++ files were changed.
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
EXTENSIONS_CPP = {'.cpp', '.c'}
|
||||
EXTENSIONS_HDR = {'.hpp', '.h'}
|
||||
# Manual exclusions from Makefile:508
|
||||
EXCLUDE_EXTRA = '|'.join([
|
||||
'src/systemcmds/tests',
|
||||
'src/examples',
|
||||
'src/modules/gyro_fft/CMSIS_5',
|
||||
'src/lib/drivers/smbus',
|
||||
'src/drivers/gpio',
|
||||
r'src/modules/commander/failsafe/emscripten',
|
||||
r'failsafe_test\.dir',
|
||||
])
|
||||
|
||||
|
||||
def repo_root():
|
||||
try:
|
||||
return subprocess.check_output(
|
||||
['git', 'rev-parse', '--show-toplevel'], text=True).strip()
|
||||
except subprocess.CalledProcessError:
|
||||
print('error: not inside a git repository', file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def changed_files(base_ref, root):
|
||||
try:
|
||||
out = subprocess.check_output(
|
||||
['git', 'diff', '--name-only', f'{base_ref}...HEAD',
|
||||
'--', '*.cpp', '*.hpp', '*.h', '*.c'],
|
||||
text=True, cwd=root).strip()
|
||||
return out.splitlines() if out else []
|
||||
except subprocess.CalledProcessError:
|
||||
print(f'error: could not diff against "{base_ref}" — '
|
||||
'is the ref valid and fetched?', file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def submodule_paths(root):
|
||||
# Returns [] if .gitmodules is absent or has no paths — both valid
|
||||
try:
|
||||
out = subprocess.check_output(
|
||||
['git', 'config', '--file', '.gitmodules',
|
||||
'--get-regexp', 'path'],
|
||||
text=True, cwd=root).strip()
|
||||
return [line.split()[1] for line in out.splitlines()]
|
||||
except subprocess.CalledProcessError:
|
||||
return []
|
||||
|
||||
|
||||
def build_exclude(root):
|
||||
submodules = '|'.join(submodule_paths(root))
|
||||
return f'{submodules}|{EXCLUDE_EXTRA}' if submodules else EXCLUDE_EXTRA
|
||||
|
||||
|
||||
def load_db(build_dir):
|
||||
db_path = os.path.join(build_dir, 'compile_commands.json')
|
||||
if not os.path.isfile(db_path):
|
||||
print(f'error: {db_path} not found', file=sys.stderr)
|
||||
print('Run "make px4_sitl_default-clang" first to generate '
|
||||
'the compilation database', file=sys.stderr)
|
||||
sys.exit(1)
|
||||
try:
|
||||
with open(db_path) as f:
|
||||
return json.load(f)
|
||||
except json.JSONDecodeError as e:
|
||||
print(f'error: compile_commands.json is malformed: {e}', file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def find_tus(changed, db, root):
|
||||
db_files = {e['file'] for e in db}
|
||||
result = set()
|
||||
for f in changed:
|
||||
abs_path = os.path.join(root, f)
|
||||
ext = os.path.splitext(f)[1]
|
||||
if ext in EXTENSIONS_CPP:
|
||||
if abs_path in db_files:
|
||||
result.add(abs_path)
|
||||
elif ext in EXTENSIONS_HDR:
|
||||
hdr = os.path.basename(f)
|
||||
for e in db:
|
||||
try:
|
||||
if hdr in open(e['file']).read():
|
||||
result.add(e['file'])
|
||||
except OSError:
|
||||
pass # file deleted in PR — skip
|
||||
return sorted(result)
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__,
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter)
|
||||
parser.add_argument('base_ref',
|
||||
help='Git ref to diff against, e.g. origin/main')
|
||||
args = parser.parse_args()
|
||||
|
||||
root = repo_root()
|
||||
build_dir = os.path.join(root, 'build', 'px4_sitl_default-clang')
|
||||
|
||||
run_tidy = os.path.join(root, 'Tools', 'run-clang-tidy.py')
|
||||
if not os.path.isfile(run_tidy):
|
||||
print(f'error: {run_tidy} not found', file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
changed = changed_files(args.base_ref, root)
|
||||
if not changed:
|
||||
print('No C++ files changed — skipping clang-tidy')
|
||||
sys.exit(0)
|
||||
|
||||
db = load_db(build_dir)
|
||||
tus = find_tus(changed, db, root)
|
||||
|
||||
if not tus:
|
||||
print('No matching TUs in compile_commands.json — skipping clang-tidy')
|
||||
sys.exit(0)
|
||||
|
||||
print(f'Running clang-tidy on {len(tus)} translation unit(s)')
|
||||
|
||||
result = subprocess.run(
|
||||
[sys.executable, run_tidy,
|
||||
'-header-filter=.*\\.hpp',
|
||||
'-j0',
|
||||
f'-exclude={build_exclude(root)}',
|
||||
'-p', build_dir] + tus
|
||||
)
|
||||
sys.exit(result.returncode)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
# This script runs the fuzz tests from a given binary for a certain amount of time
|
||||
set -e
|
||||
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
#!/bin/sh
|
||||
# Rewrite the container's apt sources to point at the AWS regional Ubuntu
|
||||
# mirror that is local to the runs-on instance.
|
||||
#
|
||||
# The default archive.ubuntu.com round-robin sometimes serves out-of-sync
|
||||
# index files mid-sync, breaking apt-get update with errors like:
|
||||
# File has unexpected size (25378 != 25381). Mirror sync in progress?
|
||||
# The Canonical-operated EC2 mirrors are region-local and sync aggressively,
|
||||
# eliminating that failure mode.
|
||||
#
|
||||
# This script is a no-op outside runs-on, so it is safe to call from any CI
|
||||
# job (forks, self-hosted runners, local docker runs, etc.) without changing
|
||||
# behavior there.
|
||||
#
|
||||
# Usage (from a workflow step running inside the container):
|
||||
# ./Tools/ci/use_aws_apt_mirror.sh
|
||||
|
||||
set -e
|
||||
|
||||
if [ -z "$RUNS_ON_AWS_REGION" ]; then
|
||||
echo "use_aws_apt_mirror: not running on runs-on (RUNS_ON_AWS_REGION unset), skipping"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
MIRROR="http://${RUNS_ON_AWS_REGION}.ec2.archive.ubuntu.com/ubuntu"
|
||||
echo "use_aws_apt_mirror: rewriting apt sources to ${MIRROR}"
|
||||
|
||||
# Noble (24.04+) uses the deb822 format at /etc/apt/sources.list.d/ubuntu.sources
|
||||
if [ -f /etc/apt/sources.list.d/ubuntu.sources ]; then
|
||||
sed -i \
|
||||
-e "s|http://archive.ubuntu.com/ubuntu|${MIRROR}|g" \
|
||||
-e "s|http://security.ubuntu.com/ubuntu|${MIRROR}|g" \
|
||||
/etc/apt/sources.list.d/ubuntu.sources
|
||||
fi
|
||||
|
||||
# Jammy (22.04) and earlier use the legacy /etc/apt/sources.list
|
||||
if [ -f /etc/apt/sources.list ]; then
|
||||
sed -i \
|
||||
-e "s|http://archive.ubuntu.com/ubuntu|${MIRROR}|g" \
|
||||
-e "s|http://security.ubuntu.com/ubuntu|${MIRROR}|g" \
|
||||
/etc/apt/sources.list
|
||||
fi
|
||||
@@ -1,4 +1,4 @@
|
||||
#! /bin/bash
|
||||
#!/usr/bin/env bash
|
||||
# Copy msgs and the message translation node into a ROS workspace directory
|
||||
|
||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#! /bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [ -z ${PX4_DOCKER_REPO+x} ]; then
|
||||
PX4_DOCKER_REPO="px4io/px4-dev:v1.17.0-beta1"
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
# PX4 SITL Gazebo Harmonic runtime image
|
||||
# Runs PX4 SITL with Gazebo Harmonic. Supports X11 forwarding for GUI.
|
||||
#
|
||||
# Build:
|
||||
# make px4_sitl_default && cd build/px4_sitl_default && cpack -G DEB && cd ../..
|
||||
# docker build -f Tools/packaging/Dockerfile.gazebo -t px4io/px4-sitl-gazebo:v1.17.0 build/px4_sitl_default/
|
||||
#
|
||||
# Run (headless):
|
||||
# docker run --rm -it --network host px4io/px4-sitl-gazebo:v1.17.0
|
||||
#
|
||||
# Run (X11 GUI):
|
||||
# xhost +local:docker
|
||||
# docker run --rm -it --network host \
|
||||
# -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||
# --gpus all px4io/px4-sitl-gazebo:v1.17.0
|
||||
|
||||
FROM ubuntu:24.04 AS extract
|
||||
COPY px4-gazebo_*.deb /tmp/
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends binutils \
|
||||
&& dpkg -x /tmp/px4-gazebo_*.deb /staging \
|
||||
&& strip /staging/opt/px4-gazebo/bin/px4 \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
FROM ubuntu:24.04
|
||||
LABEL maintainer="PX4 Development Team"
|
||||
LABEL description="PX4 SITL with Gazebo Harmonic simulation"
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV RUNS_IN_DOCKER=true
|
||||
|
||||
# Install Gazebo Harmonic with buildkit cache mounts for apt
|
||||
# The --mount=type=cache persists /var/cache/apt and /var/lib/apt across builds
|
||||
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
||||
--mount=type=cache,target=/var/lib/apt,sharing=locked \
|
||||
apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
bc \
|
||||
ca-certificates \
|
||||
gnupg \
|
||||
lsb-release \
|
||||
wget \
|
||||
&& wget -q https://packages.osrfoundation.org/gazebo.gpg \
|
||||
-O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg \
|
||||
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" \
|
||||
> /etc/apt/sources.list.d/gazebo-stable.list \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
gz-harmonic
|
||||
|
||||
# Install PX4 files from .deb
|
||||
COPY --from=extract /staging/opt/px4-gazebo /opt/px4-gazebo
|
||||
RUN ln -sf /opt/px4-gazebo/bin/px4-gazebo /usr/bin/px4-gazebo
|
||||
|
||||
# Create the DART physics engine symlink (avoids needing the -dev package)
|
||||
RUN GZ_PHYSICS_DIR=$(find /usr/lib -maxdepth 3 -type d -name "engine-plugins" -path "*/gz-physics-7/*" 2>/dev/null | head -1) \
|
||||
&& if [ -n "$GZ_PHYSICS_DIR" ] && [ -d "$GZ_PHYSICS_DIR" ]; then \
|
||||
VERSIONED=$(ls "$GZ_PHYSICS_DIR"/libgz-physics*-dartsim-plugin.so.* 2>/dev/null | head -1) \
|
||||
&& [ -n "$VERSIONED" ] \
|
||||
&& ln -sf "$(basename "$VERSIONED")" "$GZ_PHYSICS_DIR/libgz-physics-dartsim-plugin.so"; \
|
||||
fi
|
||||
|
||||
# Gazebo resource paths
|
||||
ENV GZ_SIM_RESOURCE_PATH=/opt/px4-gazebo/share/gz/models:/opt/px4-gazebo/share/gz/worlds
|
||||
ENV GZ_SIM_SYSTEM_PLUGIN_PATH=/opt/px4-gazebo/lib/gz/plugins
|
||||
ENV GZ_SIM_SERVER_CONFIG_PATH=/opt/px4-gazebo/share/gz/server.config
|
||||
ENV PX4_GZ_MODELS=/opt/px4-gazebo/share/gz/models
|
||||
ENV PX4_GZ_WORLDS=/opt/px4-gazebo/share/gz/worlds
|
||||
|
||||
ENV PX4_SIM_MODEL=gz_x500
|
||||
ENV HOME=/root
|
||||
|
||||
# MAVLink, MAVSDK, DDS
|
||||
EXPOSE 14550/udp 14540/udp 8888/udp
|
||||
|
||||
# Platform-adaptive entrypoint: detects Docker Desktop (macOS/Windows) via
|
||||
# host.docker.internal and configures MAVLink + DDS to target the host.
|
||||
COPY px4-entrypoint.sh /opt/px4-gazebo/bin/px4-entrypoint.sh
|
||||
RUN chmod +x /opt/px4-gazebo/bin/px4-entrypoint.sh
|
||||
|
||||
WORKDIR /root
|
||||
|
||||
ENTRYPOINT ["/opt/px4-gazebo/bin/px4-entrypoint.sh"]
|
||||
CMD []
|
||||
@@ -0,0 +1,49 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
# PX4 SITL SIH runtime image
|
||||
# Minimal container that runs PX4 with the SIH physics engine (no Gazebo).
|
||||
#
|
||||
# Build:
|
||||
# make px4_sitl_sih && cd build/px4_sitl_sih && cpack -G DEB && cd ../..
|
||||
# docker build -f Tools/packaging/Dockerfile.sih -t px4io/px4-sitl:v1.17.0 build/px4_sitl_sih/
|
||||
#
|
||||
# Run (Linux):
|
||||
# docker run --rm -it --network host px4io/px4-sitl:v1.17.0
|
||||
#
|
||||
# Run (macOS / Windows):
|
||||
# docker run --rm -it -p 14550:14550/udp -p 14540:14540/udp -p 19410:19410/udp -p 8888:8888/udp px4io/px4-sitl:v1.17.0
|
||||
|
||||
FROM ubuntu:24.04 AS build
|
||||
COPY px4_*.deb /tmp/
|
||||
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
||||
--mount=type=cache,target=/var/lib/apt,sharing=locked \
|
||||
apt-get update \
|
||||
&& apt-get install -y --no-install-recommends binutils \
|
||||
&& dpkg -x /tmp/px4_*.deb /staging \
|
||||
&& strip /staging/opt/px4/bin/px4
|
||||
|
||||
FROM ubuntu:24.04
|
||||
LABEL maintainer="PX4 Development Team"
|
||||
LABEL description="PX4 SITL with SIH physics (no simulator dependencies)"
|
||||
|
||||
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
||||
--mount=type=cache,target=/var/lib/apt,sharing=locked \
|
||||
apt-get update && apt-get install -y --no-install-recommends bc
|
||||
|
||||
COPY --from=build /staging/opt/px4 /opt/px4
|
||||
RUN ln -sf /opt/px4/bin/px4 /usr/bin/px4
|
||||
|
||||
# Platform-adaptive entrypoint: detects Docker Desktop (macOS/Windows) via
|
||||
# host.docker.internal and configures MAVLink + DDS to target the host.
|
||||
COPY px4-entrypoint.sh /opt/px4/bin/px4-entrypoint.sh
|
||||
RUN chmod +x /opt/px4/bin/px4-entrypoint.sh
|
||||
|
||||
ENV PX4_SIM_MODEL=sihsim_quadx
|
||||
ENV HOME=/root
|
||||
|
||||
# MAVLink (QGC, MAVSDK), DDS (ROS 2), jMAVSim/viewer display
|
||||
EXPOSE 14550/udp 14540/udp 19410/udp 8888/udp
|
||||
|
||||
WORKDIR /root
|
||||
|
||||
ENTRYPOINT ["/opt/px4/bin/px4-entrypoint.sh"]
|
||||
CMD []
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
ln -sf /opt/px4-gazebo/bin/px4-gazebo /usr/bin/px4-gazebo
|
||||
exit 0
|
||||
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then
|
||||
rm -f /usr/bin/px4-gazebo
|
||||
fi
|
||||
exit 0
|
||||
@@ -0,0 +1,35 @@
|
||||
#!/bin/sh
|
||||
# Docker entrypoint for PX4 SITL containers.
|
||||
#
|
||||
# On Docker Desktop (macOS/Windows), host.docker.internal resolves to the
|
||||
# host machine. We detect this and configure MAVLink + DDS to send to the
|
||||
# host IP instead of localhost (which stays inside the container VM).
|
||||
#
|
||||
# On Linux with --network host, host.docker.internal does not resolve and
|
||||
# PX4 defaults work without modification.
|
||||
|
||||
set -e
|
||||
|
||||
# Detect install prefix (SIH uses /opt/px4, Gazebo uses /opt/px4-gazebo)
|
||||
if [ -d /opt/px4-gazebo ]; then
|
||||
PX4_PREFIX=/opt/px4-gazebo
|
||||
else
|
||||
PX4_PREFIX=/opt/px4
|
||||
fi
|
||||
|
||||
# Resolve host.docker.internal to an IPv4 address. mavlink and uxrce_dds_client
|
||||
# only parse IPv4, and on Docker Desktop for Windows the default `getent hosts`
|
||||
# lookup can return an IPv6 ULA first, which both modules then reject.
|
||||
DOCKER_HOST_IP=$(getent ahostsv4 host.docker.internal 2>/dev/null | awk '/STREAM/ {print $1; exit}')
|
||||
|
||||
if [ -n "$DOCKER_HOST_IP" ]; then
|
||||
# MAVLink: replace default target (127.0.0.1) with the Docker host IP
|
||||
sed -i "s/mavlink start -x -u/mavlink start -x -t $DOCKER_HOST_IP -u/g" \
|
||||
"$PX4_PREFIX/etc/init.d-posix/px4-rc.mavlink"
|
||||
|
||||
# DDS: point uXRCE-DDS client at the host
|
||||
sed -i "s|uxrce_dds_client start -t udp|uxrce_dds_client start -t udp -h $DOCKER_HOST_IP|" \
|
||||
"$PX4_PREFIX/etc/init.d-posix/rcS"
|
||||
fi
|
||||
|
||||
exec "$PX4_PREFIX/bin/px4" "$@"
|
||||
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
# px4-gazebo: Launch PX4 SITL with Gazebo from the installed .deb package
|
||||
set -e
|
||||
|
||||
PX4_GAZEBO_DIR="$(cd "$(dirname "$(readlink -f "$0")")/.." && pwd)"
|
||||
PX4_BINARY="${PX4_GAZEBO_DIR}/bin/px4"
|
||||
|
||||
# Set Gazebo resource paths so gz-sim finds PX4 models, worlds, and plugins.
|
||||
export PX4_GZ_MODELS="${PX4_GAZEBO_DIR}/share/gz/models"
|
||||
export PX4_GZ_WORLDS="${PX4_GAZEBO_DIR}/share/gz/worlds"
|
||||
export PX4_GZ_PLUGINS="${PX4_GAZEBO_DIR}/lib/gz/plugins"
|
||||
export PX4_GZ_SERVER_CONFIG="${PX4_GAZEBO_DIR}/share/gz/server.config"
|
||||
export GZ_SIM_RESOURCE_PATH="${GZ_SIM_RESOURCE_PATH}:${PX4_GZ_MODELS}:${PX4_GZ_WORLDS}"
|
||||
export GZ_SIM_SYSTEM_PLUGIN_PATH="${GZ_SIM_SYSTEM_PLUGIN_PATH}:${PX4_GZ_PLUGINS}"
|
||||
export GZ_SIM_SERVER_CONFIG_PATH="${PX4_GZ_SERVER_CONFIG}"
|
||||
|
||||
# Gazebo's Physics system searches for "gz-physics-dartsim-plugin" which maps
|
||||
# to the unversioned libgz-physics-dartsim-plugin.so. The runtime package only
|
||||
# ships versioned .so files; the unversioned symlink lives in the -dev package.
|
||||
# Create it if missing so Gazebo finds the DART engine without installing -dev.
|
||||
GZ_PHYSICS_ENGINE_DIR=$(find /usr/lib -maxdepth 3 -type d -name "engine-plugins" -path "*/gz-physics-7/*" 2>/dev/null | head -1)
|
||||
if [ -n "$GZ_PHYSICS_ENGINE_DIR" ] && [ -d "$GZ_PHYSICS_ENGINE_DIR" ]; then
|
||||
UNVERSIONED="$GZ_PHYSICS_ENGINE_DIR/libgz-physics-dartsim-plugin.so"
|
||||
if [ ! -e "$UNVERSIONED" ]; then
|
||||
VERSIONED=$(ls "$GZ_PHYSICS_ENGINE_DIR"/libgz-physics*-dartsim-plugin.so.* 2>/dev/null | head -1)
|
||||
if [ -n "$VERSIONED" ]; then
|
||||
ln -sf "$(basename "$VERSIONED")" "$UNVERSIONED" 2>/dev/null || true
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
exec "${PX4_BINARY}" "$@"
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
ln -sf /opt/px4/bin/px4 /usr/bin/px4
|
||||
exit 0
|
||||
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then
|
||||
rm -f /usr/bin/px4
|
||||
fi
|
||||
exit 0
|
||||
@@ -0,0 +1,144 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
MAVSDK mission test for PX4 SIH SITL in Docker.
|
||||
|
||||
Takes off to 100m, flies a short 4-waypoint box mission, then lands.
|
||||
Validates that the SIH Docker container works end-to-end with MAVSDK.
|
||||
|
||||
Prerequisites:
|
||||
- Docker container running:
|
||||
docker run --rm --network host px4io/px4-sitl:v1.17.0-alpha1
|
||||
- pip install mavsdk
|
||||
- mavsim-viewer running (optional):
|
||||
/path/to/mavsim-viewer -n 1
|
||||
|
||||
Usage:
|
||||
python3 Tools/packaging/test_sih_mission.py
|
||||
python3 Tools/packaging/test_sih_mission.py --speed 10 # faster-than-realtime
|
||||
"""
|
||||
|
||||
import asyncio
|
||||
import argparse
|
||||
import sys
|
||||
import time
|
||||
|
||||
from mavsdk import System
|
||||
from mavsdk.mission import MissionItem, MissionPlan
|
||||
|
||||
|
||||
async def run_mission(speed_factor: int = 1):
|
||||
drone = System()
|
||||
print(f"Connecting to drone on udp://:14540 ...")
|
||||
await drone.connect(system_address="udp://:14540")
|
||||
|
||||
print("Waiting for drone to connect...")
|
||||
async for state in drone.core.connection_state():
|
||||
if state.is_connected:
|
||||
print(f"Connected (UUID: {state.uuid if hasattr(state, 'uuid') else 'N/A'})")
|
||||
break
|
||||
|
||||
print("Waiting for global position estimate...")
|
||||
async for health in drone.telemetry.health():
|
||||
if health.is_global_position_ok and health.is_home_position_ok:
|
||||
print("Global position OK")
|
||||
break
|
||||
|
||||
# Get home position for reference
|
||||
async for pos in drone.telemetry.position():
|
||||
home_lat = pos.latitude_deg
|
||||
home_lon = pos.longitude_deg
|
||||
print(f"Home position: {home_lat:.6f}, {home_lon:.6f}")
|
||||
break
|
||||
|
||||
# Build a small box mission at 100m AGL
|
||||
# ~100m offset in each direction
|
||||
offset = 0.001 # roughly 111m at equator
|
||||
mission_items = [
|
||||
MissionItem(
|
||||
home_lat + offset, home_lon,
|
||||
100, 10, True, float('nan'), float('nan'),
|
||||
MissionItem.CameraAction.NONE,
|
||||
float('nan'), float('nan'), float('nan'),
|
||||
float('nan'), float('nan'),
|
||||
MissionItem.VehicleAction.NONE,
|
||||
),
|
||||
MissionItem(
|
||||
home_lat + offset, home_lon + offset,
|
||||
100, 10, True, float('nan'), float('nan'),
|
||||
MissionItem.CameraAction.NONE,
|
||||
float('nan'), float('nan'), float('nan'),
|
||||
float('nan'), float('nan'),
|
||||
MissionItem.VehicleAction.NONE,
|
||||
),
|
||||
MissionItem(
|
||||
home_lat, home_lon + offset,
|
||||
100, 10, True, float('nan'), float('nan'),
|
||||
MissionItem.CameraAction.NONE,
|
||||
float('nan'), float('nan'), float('nan'),
|
||||
float('nan'), float('nan'),
|
||||
MissionItem.VehicleAction.NONE,
|
||||
),
|
||||
MissionItem(
|
||||
home_lat, home_lon,
|
||||
100, 10, True, float('nan'), float('nan'),
|
||||
MissionItem.CameraAction.NONE,
|
||||
float('nan'), float('nan'), float('nan'),
|
||||
float('nan'), float('nan'),
|
||||
MissionItem.VehicleAction.NONE,
|
||||
),
|
||||
]
|
||||
|
||||
mission_plan = MissionPlan(mission_items)
|
||||
|
||||
print(f"Uploading mission ({len(mission_items)} waypoints, 100m AGL)...")
|
||||
await drone.mission.upload_mission(mission_plan)
|
||||
print("Mission uploaded")
|
||||
|
||||
print("Arming...")
|
||||
await drone.action.arm()
|
||||
print("Armed")
|
||||
|
||||
t0 = time.time()
|
||||
print("Starting mission...")
|
||||
await drone.mission.start_mission()
|
||||
|
||||
# Monitor mission progress
|
||||
async for progress in drone.mission.mission_progress():
|
||||
elapsed = time.time() - t0
|
||||
print(f" [{elapsed:6.1f}s] Waypoint {progress.current}/{progress.total}")
|
||||
if progress.current == progress.total:
|
||||
print(f"Mission complete in {elapsed:.1f}s (speed factor: {speed_factor}x)")
|
||||
break
|
||||
|
||||
print("Returning to launch...")
|
||||
await drone.action.return_to_launch()
|
||||
|
||||
# Wait for landing
|
||||
async for in_air in drone.telemetry.in_air():
|
||||
if not in_air:
|
||||
print("Landed")
|
||||
break
|
||||
|
||||
print("Disarming...")
|
||||
await drone.action.disarm()
|
||||
print("Test PASSED")
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description="PX4 SIH Docker mission test")
|
||||
parser.add_argument("--speed", type=int, default=1,
|
||||
help="PX4_SIM_SPEED_FACTOR (must match container)")
|
||||
args = parser.parse_args()
|
||||
|
||||
try:
|
||||
asyncio.run(run_mission(args.speed))
|
||||
except KeyboardInterrupt:
|
||||
print("\nInterrupted")
|
||||
sys.exit(1)
|
||||
except Exception as e:
|
||||
print(f"Test FAILED: {e}")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Script to run ShellCheck (a static analysis tool for shell scripts) over a
|
||||
# script directory
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
GREEN='\033[0;32m'
|
||||
NO_COLOR='\033[0m' # No Color
|
||||
|
||||
@@ -23,7 +23,7 @@ pyserial
|
||||
pyulog>=0.5.0
|
||||
pyyaml
|
||||
requests
|
||||
setuptools>=39.2.0
|
||||
setuptools>=39.2.0,<=81.0.0
|
||||
six>=1.12.0
|
||||
sympy>=1.10.1
|
||||
toml>=0.9
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Setup environment to make PX4 visible to Gazebo.
|
||||
#
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
# run multiple instances of the 'px4' binary, with the gazebo SITL simulation
|
||||
# It assumes px4 is already built, with 'make px4_sitl_default sitl_gazebo-classic'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
# Run multiple instances of the 'px4' binary, without starting an external simulator.
|
||||
# It assumes px4 is already built with the specified build target.
|
||||
#
|
||||
|
||||
@@ -30,6 +30,7 @@ CONFIG_MODULES_EKF2=y
|
||||
# CONFIG_EKF2_GNSS_YAW is not set
|
||||
# CONFIG_EKF2_MAGNETOMETER is not set
|
||||
# CONFIG_EKF2_RANGE_FINDER is not set
|
||||
# CONFIG_EKF2_OPTICAL_FLOW is not set
|
||||
# CONFIG_EKF2_SIDESLIP is not set
|
||||
CONFIG_MODULES_FLIGHT_MODE_MANAGER=y
|
||||
CONFIG_MODULES_LAND_DETECTOR=y
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
#define INTERFACE_USART_CONFIG "/dev/ttyS0,115200"
|
||||
#define BOOT_DELAY_ADDRESS 0x000001a0
|
||||
#define BOARD_TYPE 1105
|
||||
#define BOARD_FLASH_SECTORS (14)
|
||||
#define BOARD_FLASH_SECTORS (13)
|
||||
#define BOARD_FLASH_SIZE (16 * 128 * 1024)
|
||||
#define APP_RESERVATION_SIZE (2 * 128 * 1024)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Run this from the px4 project top level directory
|
||||
docker run -it --rm --privileged -v `pwd`:/usr/local/workspace px4io/px4-dev-nuttx-focal:2022-08-12
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
# Create px4-* symlinks from px4-alias.sh
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
# Stop voxl-px4 service if running
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
echo "*** Starting unified VOXL2 build (apps + SLPI) ***"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
echo "*** Starting unified VOXL2 build (apps + SLPI) ***"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
echo "*** Starting qurt slpi build ***"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Clean out the build artifacts
|
||||
# source /home/build-env.sh
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Push slpi image to voxl2
|
||||
adb push build/modalai_voxl2_slpi/platforms/qurt/libpx4.so /usr/lib/rfsa/adsp
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Push slpi image to voxl2
|
||||
adb push build/modalai_voxl2_slpi/platforms/qurt/libpx4.so /usr/lib/rfsa/adsp
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
cd Tools/simulation/gazebo-classic/sitl_gazebo-classic/src
|
||||
patch < ../../../../../boards/modalai/voxl2/gazebo-docker/patch/mavlink_interface.patch
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Run this from the px4 project top level directory
|
||||
docker run -it --rm -v `pwd`:/usr/local/workspace rb5-flight-px4-build-docker
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
################################################################################
|
||||
# Copyright 2023 ModalAI Inc.
|
||||
#
|
||||
|
||||
@@ -13,6 +13,7 @@ CONFIG_MODULES_NAVIGATOR=n
|
||||
CONFIG_MODULES_UXRCE_DDS_CLIENT=n
|
||||
CONFIG_SYSTEMCMDS_ACTUATOR_TEST=n
|
||||
CONFIG_SYSTEMCMDS_BSONDUMP=n
|
||||
CONFIG_SYSTEMCMDS_I2CDETECT=y
|
||||
CONFIG_SYSTEMCMDS_PERF=n
|
||||
CONFIG_SYSTEMCMDS_TOPIC_LISTENER=n
|
||||
CONFIG_SYSTEMCMDS_VER=n
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CONFIG_FILE="/etc/modalai/voxl-px4.conf"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Make sure that the SLPI DSP test signature is there otherwise px4 cannot run
|
||||
# on the DSP
|
||||
|
||||
@@ -287,8 +287,8 @@
|
||||
|
||||
/* AUX */
|
||||
|
||||
#define GPIO_LPUART4_RX (GPIO_LPUART4_RX_3 | LPUART_IOMUX) /* GPIO_B1_01 */
|
||||
#define GPIO_LPUART4_TX (GPIO_LPUART4_TX_3 | LPUART_IOMUX) /* GPIO_B1_00 */
|
||||
#define GPIO_LPUART4_RX (GPIO_LPUART4_RX_1 | LPUART_IOMUX) /* GPIO_B1_01 */
|
||||
#define GPIO_LPUART4_TX (GPIO_LPUART4_TX_1 | LPUART_IOMUX) /* GPIO_B1_00 */
|
||||
|
||||
/* GPS 1 */
|
||||
|
||||
|
||||
@@ -33,32 +33,24 @@
|
||||
|
||||
# packaging
|
||||
|
||||
set(CPACK_PACKAGE_NAME ${PROJECT_NAME}-${PX4_CONFIG})
|
||||
|
||||
set(CPACK_PACKAGE_VENDOR "px4")
|
||||
set(CPACK_PACKAGE_CONTACT "daniel@agar.ca")
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${PX4_SOURCE_DIR}/LICENSE")
|
||||
set(CPACK_RESOURCE_FILE_README "${PX4_SOURCE_DIR}/README.md")
|
||||
|
||||
set(CPACK_SOURCE_GENERATOR "ZIP;TBZ2")
|
||||
|
||||
# Debian version: convert git describe to Debian-compliant format
|
||||
# v1.17.0-beta1 -> 1.17.0~beta1, v1.17.0 -> 1.17.0
|
||||
string(REGEX REPLACE "^v" "" DEB_VERSION "${PX4_GIT_TAG}")
|
||||
# Replace first hyphen with tilde for pre-release (Debian sorts ~ before anything)
|
||||
string(REGEX REPLACE "^([0-9]+\\.[0-9]+\\.[0-9]+)-([a-zA-Z])" "\\1~\\2" DEB_VERSION "${DEB_VERSION}")
|
||||
# Strip any trailing commit info (e.g. -42-gabcdef)
|
||||
string(REGEX REPLACE "-[0-9]+-g[0-9a-f]+$" "" DEB_VERSION "${DEB_VERSION}")
|
||||
|
||||
set(CPACK_PACKAGE_VERSION_MAJOR ${PX4_VERSION_MAJOR})
|
||||
set(CPACK_PACKAGE_VERSION_MINOR ${PX4_VERSION_MINOR})
|
||||
set(CPACK_PACKAGE_VERSION_PATCH ${PX4_VERSION_PATCH})
|
||||
#set(CPACK_PACKAGE_VERSION ${PX4_GIT_TAG})
|
||||
|
||||
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PX4_CONFIG}-${PX4_GIT_TAG}")
|
||||
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PX4_CONFIG}-${PX4_GIT_TAG}-src")
|
||||
|
||||
set(CPACK_PACKAGE_CONTACT "daniel@agar.ca")
|
||||
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${PX4_SOURCE_DIR}/LICENSE")
|
||||
set(CPACK_RESOURCE_FILE_README "${PX4_SOURCE_DIR}/README.md")
|
||||
|
||||
set(CPACK_COMPONENTS_GROUPING ALL_COMPONENTS_IN_ONE)#ONE_PER_GROUP)
|
||||
# without this you won't be able to pack only specified component
|
||||
set(CPACK_DEB_COMPONENT_INSTALL YES)
|
||||
|
||||
#set(CPACK_STRIP_FILES YES)
|
||||
|
||||
set(CPACK_SOURCE_GENERATOR "ZIP;TBZ2")
|
||||
set(CPACK_PACKAGING_INSTALL_PREFIX "")
|
||||
set(CPACK_SET_DESTDIR "OFF")
|
||||
|
||||
if("${CMAKE_SYSTEM}" MATCHES "Linux")
|
||||
set(CPACK_GENERATOR "TBZ2")
|
||||
@@ -67,30 +59,61 @@ if("${CMAKE_SYSTEM}" MATCHES "Linux")
|
||||
if(EXISTS ${DPKG_PROGRAM})
|
||||
list(APPEND CPACK_GENERATOR "DEB")
|
||||
|
||||
set(CPACK_SET_DESTDIR true)
|
||||
set(CPACK_PACKAGING_INSTALL_PREFIX "/tmp")
|
||||
execute_process(COMMAND ${DPKG_PROGRAM} --print-architecture
|
||||
OUTPUT_VARIABLE DEB_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
execute_process(COMMAND ${DPKG_PROGRAM} --print-architecture OUTPUT_VARIABLE DEB_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
message("Architecture: " ${DEB_ARCHITECTURE})
|
||||
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}_${DEB_ARCHITECTURE}")
|
||||
# Detect Ubuntu/Debian codename for version suffix
|
||||
find_program(LSB_RELEASE lsb_release)
|
||||
if(EXISTS ${LSB_RELEASE})
|
||||
execute_process(COMMAND ${LSB_RELEASE} -cs
|
||||
OUTPUT_VARIABLE DEB_CODENAME OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
else()
|
||||
set(DEB_CODENAME "unknown")
|
||||
endif()
|
||||
|
||||
set(CPACK_INSTALL_PREFIX @DEB_INSTALL_PREFIX@)
|
||||
message ("==> CPACK_INSTALL_PREFIX = " ${CPACK_INSTALL_PREFIX})
|
||||
# Override CPACK_PACKAGE_VERSION with full Debian version.
|
||||
# CPack DEB ignores CPACK_PACKAGE_VERSION_MAJOR/MINOR/PATCH
|
||||
# when CPACK_PACKAGE_VERSION is set, so we must replace them.
|
||||
unset(CPACK_PACKAGE_VERSION_MAJOR)
|
||||
unset(CPACK_PACKAGE_VERSION_MINOR)
|
||||
unset(CPACK_PACKAGE_VERSION_PATCH)
|
||||
set(CPACK_PACKAGE_VERSION "${DEB_VERSION}-${DEB_CODENAME}")
|
||||
|
||||
################################################################################
|
||||
# Label-aware package metadata
|
||||
if(PX4_BOARD_LABEL STREQUAL "sih")
|
||||
set(CPACK_PACKAGING_INSTALL_PREFIX "/opt/px4")
|
||||
set(CPACK_DEBIAN_PACKAGE_NAME "px4")
|
||||
set(CPACK_DEBIAN_FILE_NAME "px4_${DEB_VERSION}-${DEB_CODENAME}_${DEB_ARCHITECTURE}.deb")
|
||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6, libstdc++6")
|
||||
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "PX4 SITL autopilot with SIH physics (no Gazebo)")
|
||||
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
|
||||
"${PX4_SOURCE_DIR}/Tools/packaging/sih/postinst;${PX4_SOURCE_DIR}/Tools/packaging/sih/postrm")
|
||||
else()
|
||||
set(CPACK_PACKAGING_INSTALL_PREFIX "/opt/px4-gazebo")
|
||||
set(CPACK_DEBIAN_PACKAGE_NAME "px4-gazebo")
|
||||
set(CPACK_DEBIAN_FILE_NAME "px4-gazebo_${DEB_VERSION}-${DEB_CODENAME}_${DEB_ARCHITECTURE}.deb")
|
||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6, libstdc++6, gz-sim8-cli, libgz-sim8-plugins, libgz-physics7-dartsim, gz-tools2")
|
||||
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "PX4 SITL autopilot with Gazebo Harmonic simulation resources")
|
||||
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
|
||||
"${PX4_SOURCE_DIR}/Tools/packaging/postinst;${PX4_SOURCE_DIR}/Tools/packaging/postrm")
|
||||
endif()
|
||||
|
||||
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Daniel Agar <${CPACK_PACKAGE_CONTACT}>")
|
||||
set(CPACK_DEBIAN_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
|
||||
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
|
||||
# Bake the install prefix into the px4 binary so it can locate its ROMFS
|
||||
# (etc/) without a wrapper script or command-line argument.
|
||||
if(TARGET px4)
|
||||
target_compile_definitions(px4 PRIVATE PX4_INSTALL_PREFIX="${CPACK_PACKAGING_INSTALL_PREFIX}")
|
||||
endif()
|
||||
|
||||
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "PX4 autopilot")
|
||||
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
|
||||
set(CPACK_DEBIAN_PACKAGE_SECTION "misc")
|
||||
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
|
||||
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${DEB_ARCHITECTURE})
|
||||
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
|
||||
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Daniel Agar <${CPACK_PACKAGE_CONTACT}>")
|
||||
|
||||
# autogenerate dependency information
|
||||
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
|
||||
set(CPACK_DEBIAN_COMPRESSION_TYPE xz)
|
||||
set(CPACK_DEBIAN_ARCHITECTURE ${DEB_ARCHITECTURE})
|
||||
|
||||
message(STATUS "PX4 SITL .deb version: ${DEB_VERSION}-${DEB_CODENAME} (${DEB_ARCHITECTURE})")
|
||||
|
||||
endif()
|
||||
else()
|
||||
|
||||
|
Before Width: | Height: | Size: 65 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 354 KiB |
|
After Width: | Height: | Size: 76 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 50 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 83 KiB |
|
After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 119 KiB |
|
After Width: | Height: | Size: 203 KiB |
|
After Width: | Height: | Size: 270 KiB |
@@ -171,6 +171,7 @@
|
||||
- [CUAV V5 nano (FMUv5)](flight_controller/cuav_v5_nano.md)
|
||||
- [CUAV V5 nano Wiring Quickstart](assembly/quick_start_cuav_v5_nano.md)
|
||||
- [CUAV X25 EVO](flight_controller/cuav_x25-evo.md)
|
||||
- [CUAV X25 EVO Wiring Quick Start](assembly/quick_start_cuav_x25_evo.md)
|
||||
- [CUAV X25 SUPER](flight_controller/cuav_x25-super.md)
|
||||
- [CubePilot Cube Orange+ (CubePilot)](flight_controller/cubepilot_cube_orangeplus.md)
|
||||
- [CubePilot Cube Orange (CubePilot)](flight_controller/cubepilot_cube_orange.md)
|
||||
@@ -322,6 +323,7 @@
|
||||
- [RFD900 (SiK) Telemetry Radio](telemetry/rfd900_telemetry.md)
|
||||
- [ThunderFly TFSIK01 Telemetry Radio](telemetry/tfsik_telemetry.md)
|
||||
- [HolyBro (SIK) Telemetry Radio](telemetry/holybro_sik_radio.md)
|
||||
- [HolyBro SiK Long Range Telemetry Radio](telemetry/holybro_sik_longrange.md)
|
||||
- [Telemetry Wifi](telemetry/telemetry_wifi.md)
|
||||
- [ESP8266 WiFi Module](telemetry/esp8266_wifi_module.md)
|
||||
- [ESP32 WiFi Module](telemetry/esp32_wifi_module.md)
|
||||
@@ -859,16 +861,20 @@
|
||||
- [Multi-vehicle simulation](simulation/multi-vehicle-simulation.md)
|
||||
- [Platform Testing and CI](test_and_ci/index.md)
|
||||
- [Test Flights](test_and_ci/test_flights.md)
|
||||
- [Test MC_01 - Manual Modes](test_cards/mc_01_manual_modes.md)
|
||||
- [Test MC_02 - Full Autonomous](test_cards/mc_02_full_autonomous.md)
|
||||
- [Test MC_03 - Auto Manual Mix](test_cards/mc_03_auto_manual_mix.md)
|
||||
- [Test MC_04 - Failsafe Testing](test_cards/mc_04_failsafe_testing.md)
|
||||
- [Test MC_05 - Manual Modes (Inside)](test_cards/mc_05_indoor_flight_manual_modes.md)
|
||||
- [Test MC_06 - Optical Flow (Inside)](test_cards/mc_06_optical_flow.md)
|
||||
- [Test MC_07 - Optical Flow Low Mount](test_cards/mc_07_optical_flow_low_mount.md)
|
||||
- [Test MC_08 - DSHOT ESC](test_cards/mc_08_dshot.md)
|
||||
- [Test MC_09 - VIO (Visual-Inertial Odometry)](test_cards/mc_09_vio.md)
|
||||
- [Test MC_10 - Optical Flow / GPS Mixed](test_cards/mc_10_optical_flow_gps_mixed.md)
|
||||
- [Multicopter](test_and_ci/test_flights.md#multicopter)
|
||||
- [Test MC_01 - Manual Modes](test_cards/mc_01_manual_modes.md)
|
||||
- [Test MC_02 - Full Autonomous](test_cards/mc_02_full_autonomous.md)
|
||||
- [Test MC_03 - Auto Manual Mix](test_cards/mc_03_auto_manual_mix.md)
|
||||
- [Test MC_04 - Failsafe Testing](test_cards/mc_04_failsafe_testing.md)
|
||||
- [Test MC_05 - Manual Modes (Inside)](test_cards/mc_05_indoor_flight_manual_modes.md)
|
||||
- [Test MC_06 - Optical Flow (Inside)](test_cards/mc_06_optical_flow.md)
|
||||
- [Test MC_07 - Optical Flow Low Mount](test_cards/mc_07_optical_flow_low_mount.md)
|
||||
- [Test MC_08 - DSHOT ESC](test_cards/mc_08_dshot.md)
|
||||
- [Test MC_09 - VIO (Visual-Inertial Odometry)](test_cards/mc_09_vio.md)
|
||||
- [Test MC_10 - Optical Flow / GPS Mixed](test_cards/mc_10_optical_flow_gps_mixed.md)
|
||||
- [Fixed Wing](test_and_ci/test_flights.md#fixed-wing)
|
||||
- [Test FW_01 - Manual Modes](test_cards/fw_01_manual_modes.md)
|
||||
- [Test FW_02 - Full Autonomous](test_cards/fw_02_full_autonomous.md)
|
||||
- [Unit Tests](test_and_ci/unit_tests.md)
|
||||
- [Fuzz Tests](test_and_ci/fuzz_tests.md)
|
||||
- [Continuous Integration](test_and_ci/continous_integration.md)
|
||||
|
||||
@@ -851,16 +851,20 @@
|
||||
- [Multi-vehicle simulation](/simulation/multi-vehicle-simulation.md)
|
||||
- [Platform Testing and CI](/test_and_ci/index.md)
|
||||
- [Test Flights](/test_and_ci/test_flights.md)
|
||||
- [Test MC_01 - Manual Modes](/test_cards/mc_01_manual_modes.md)
|
||||
- [Test MC_02 - Full Autonomous](/test_cards/mc_02_full_autonomous.md)
|
||||
- [Test MC_03 - Auto Manual Mix](/test_cards/mc_03_auto_manual_mix.md)
|
||||
- [Test MC_04 - Failsafe Testing](/test_cards/mc_04_failsafe_testing.md)
|
||||
- [Test MC_05 - Manual Modes (Inside)](/test_cards/mc_05_indoor_flight_manual_modes.md)
|
||||
- [Test MC_06 - Optical Flow (Inside)](/test_cards/mc_06_optical_flow.md)
|
||||
- [Test MC_07 - Optical Flow Low Mount](/test_cards/mc_07_optical_flow_low_mount.md)
|
||||
- [Test MC_08 - DSHOT ESC](/test_cards/mc_08_dshot.md)
|
||||
- [Test MC_09 - VIO (Visual-Inertial Odometry)](/test_cards/mc_09_vio.md)
|
||||
- [Test MC_10 - Optical Flow / GPS Mixed](/test_cards/mc_10_optical_flow_gps_mixed.md)
|
||||
- [Multicopter](/test_and_ci/test_flights.md#multicopter)
|
||||
- [Test MC_01 - Manual Modes](/test_cards/mc_01_manual_modes.md)
|
||||
- [Test MC_02 - Full Autonomous](/test_cards/mc_02_full_autonomous.md)
|
||||
- [Test MC_03 - Auto Manual Mix](/test_cards/mc_03_auto_manual_mix.md)
|
||||
- [Test MC_04 - Failsafe Testing](/test_cards/mc_04_failsafe_testing.md)
|
||||
- [Test MC_05 - Manual Modes (Inside)](/test_cards/mc_05_indoor_flight_manual_modes.md)
|
||||
- [Test MC_06 - Optical Flow (Inside)](/test_cards/mc_06_optical_flow.md)
|
||||
- [Test MC_07 - Optical Flow Low Mount](/test_cards/mc_07_optical_flow_low_mount.md)
|
||||
- [Test MC_08 - DSHOT ESC](/test_cards/mc_08_dshot.md)
|
||||
- [Test MC_09 - VIO (Visual-Inertial Odometry)](/test_cards/mc_09_vio.md)
|
||||
- [Test MC_10 - Optical Flow / GPS Mixed](/test_cards/mc_10_optical_flow_gps_mixed.md)
|
||||
- [Fixed Wing](/test_and_ci/test_flights.md#fixed-wing)
|
||||
- [Test FW_01 - Manual Modes](/test_cards/fw_01_manual_modes.md)
|
||||
- [Test FW_02 - Full Autonomous](/test_cards/fw_02_full_autonomous.md)
|
||||
- [Unit Tests](/test_and_ci/unit_tests.md)
|
||||
- [Fuzz Tests](/test_and_ci/fuzz_tests.md)
|
||||
- [Continuous Integration](/test_and_ci/continous_integration.md)
|
||||
|
||||
@@ -27,6 +27,8 @@ Supported flight controllers include:
|
||||
|
||||
- [ARK Electronics ARKV6X](../flight_controller/ark_v6x.md)
|
||||
- [CUAV Pixhawk V6X](../flight_controller/cuav_pixhawk_v6x.md)
|
||||
- [CUAV X25 EVO](../flight_controller/cuav_x25-evo.md)
|
||||
- [CUAV X25 SUPER](../flight_controller/cuav_x25-super.md)
|
||||
- [Holybro Pixhawk 5X](../flight_controller/pixhawk5x.md)
|
||||
- [Holybro Pixhawk 6X](../flight_controller/pixhawk6x.md)
|
||||
- [RaccoonLab FMUv6X Autopilot](../flight_controller/raccoonlab_fmu6x.md)
|
||||
|
||||
@@ -127,7 +127,7 @@ Configure the emitter type of the vehicle.
|
||||
|
||||
| Reboot | minValue | maxValue | increment | default | unit |
|
||||
| ------- | -------- | -------- | --------- | ------- | ---- |
|
||||
| ✓ | 0 | 15 | | 14 | |
|
||||
| ✓ | 0 | 19 | | 14 | |
|
||||
|
||||
### ADSB_GPS_OFF_LAT (`INT32`) {#ADSB_GPS_OFF_LAT}
|
||||
|
||||
@@ -17716,9 +17716,9 @@ Negative values are ignored and will cause the measured current to be used.
|
||||
The default value of 0 disables the overwrite, in which case the measured value
|
||||
is always used.
|
||||
|
||||
| Reboot | minValue | maxValue | increment | default | unit |
|
||||
| ------- | -------- | -------- | --------- | ------- | ---- |
|
||||
| ✓ | | | | 0 | |
|
||||
| Reboot | minValue | maxValue | increment | default | unit |
|
||||
| ------ | -------- | -------- | --------- | ------- | ---- |
|
||||
| | | | | 0 | |
|
||||
|
||||
### BAT1_N_CELLS (`INT32`) {#BAT1_N_CELLS}
|
||||
|
||||
@@ -17894,9 +17894,9 @@ Negative values are ignored and will cause the measured current to be used.
|
||||
The default value of 0 disables the overwrite, in which case the measured value
|
||||
is always used.
|
||||
|
||||
| Reboot | minValue | maxValue | increment | default | unit |
|
||||
| ------- | -------- | -------- | --------- | ------- | ---- |
|
||||
| ✓ | | | | 0 | |
|
||||
| Reboot | minValue | maxValue | increment | default | unit |
|
||||
| ------ | -------- | -------- | --------- | ------- | ---- |
|
||||
| | | | | 0 | |
|
||||
|
||||
### BAT2_N_CELLS (`INT32`) {#BAT2_N_CELLS}
|
||||
|
||||
@@ -18036,6 +18036,22 @@ Defines the capacity of battery 3 in mAh.
|
||||
| ------- | -------- | -------- | --------- | ------- | ---- |
|
||||
| ✓ | -1.0 | 100000 | 50 | -1.0 | mAh |
|
||||
|
||||
### BAT3_I_OVERWRITE (`FLOAT`) {#BAT3_I_OVERWRITE}
|
||||
|
||||
Battery 3 idle current overwrite.
|
||||
|
||||
This parameter allows to overwrite the current measured during
|
||||
idle (unarmed) state with a user-defined constant value (expressed in amperes).
|
||||
When the system is armed, the measured current is used. This is useful
|
||||
because on certain ESCs current measurements are inaccurate in case of no load.
|
||||
Negative values are ignored and will cause the measured current to be used.
|
||||
The default value of 0 disables the overwrite, in which case the measured value
|
||||
is always used.
|
||||
|
||||
| Reboot | minValue | maxValue | increment | default | unit |
|
||||
| ------ | -------- | -------- | --------- | ------- | ---- |
|
||||
| | | | | 0 | |
|
||||
|
||||
### BAT3_N_CELLS (`INT32`) {#BAT3_N_CELLS}
|
||||
|
||||
Number of cells for battery 3.
|
||||
@@ -18482,7 +18498,7 @@ parameters.
|
||||
|
||||
| Reboot | minValue | maxValue | increment | default | unit |
|
||||
| ------ | -------- | -------- | --------- | ------- | ---- |
|
||||
| | 0 | 3 | | 0 | |
|
||||
| | 0 | 4 | | 0 | |
|
||||
|
||||
### COM_ARMABLE (`INT32`) {#COM_ARMABLE}
|
||||
|
||||
@@ -21557,6 +21573,49 @@ Maximum vertical drift speed to use GPS.
|
||||
| ------ | -------- | -------- | --------- | ------- | ---- |
|
||||
| | 0.1 | 1.5 | | 0.2 | m/s |
|
||||
|
||||
### EKF2_RNGBC_CTRL (`INT32`) {#EKF2_RNGBC_CTRL}
|
||||
|
||||
Ranging beacon fusion control.
|
||||
|
||||
Enable/disable ranging beacon fusion.
|
||||
|
||||
**Values:**
|
||||
|
||||
- `0`: Disable ranging beacon fusion
|
||||
- `1`: Enable ranging beacon fusion
|
||||
|
||||
| Reboot | minValue | maxValue | increment | default | unit |
|
||||
| ------ | -------- | -------- | --------- | ------- | ---- |
|
||||
| | | | | 0 | |
|
||||
|
||||
### EKF2_RNGBC_DELAY (`FLOAT`) {#EKF2_RNGBC_DELAY}
|
||||
|
||||
Ranging beacon measurement delay relative to IMU measurements.
|
||||
|
||||
| Reboot | minValue | maxValue | increment | default | unit |
|
||||
| ------- | -------- | -------- | --------- | ------- | ---- |
|
||||
| ✓ | 0 | 1000 | | 0 | ms |
|
||||
|
||||
### EKF2_RNGBC_GATE (`FLOAT`) {#EKF2_RNGBC_GATE}
|
||||
|
||||
Gate size for ranging beacon fusion.
|
||||
|
||||
Sets the number of standard deviations used by the innovation consistency test.
|
||||
|
||||
| Reboot | minValue | maxValue | increment | default | unit |
|
||||
| ------ | -------- | -------- | --------- | ------- | ---- |
|
||||
| | 1.0 | | | 5.0 | SD |
|
||||
|
||||
### EKF2_RNGBC_NOISE (`FLOAT`) {#EKF2_RNGBC_NOISE}
|
||||
|
||||
Measurement noise for ranging beacon fusion.
|
||||
|
||||
Used to lower bound or replace the uncertainty included in the message
|
||||
|
||||
| Reboot | minValue | maxValue | increment | default | unit |
|
||||
| ------ | -------- | -------- | --------- | ------- | ---- |
|
||||
| | 0.1 | 500.0 | | 30.0 | m |
|
||||
|
||||
### EKF2_RNG_A_HMAX (`FLOAT`) {#EKF2_RNG_A_HMAX}
|
||||
|
||||
Maximum height above ground allowed for conditional range aid mode.
|
||||
@@ -21747,6 +21806,32 @@ EKF2 selector maximum accumulated velocity threshold for comparing accelerometer
|
||||
| ------ | -------- | -------- | --------- | ------- | ---- |
|
||||
| | | | | 2.0 | m/s |
|
||||
|
||||
### EKF2_SENS_EN (`INT32`) {#EKF2_SENS_EN}
|
||||
|
||||
Sensor fusion enable bitmask.
|
||||
|
||||
Bitmask to control which sensor fusion sources are enabled. Sources whose bit is cleared will be disabled. Only applied while disarmed. For in-flight changes use the MAVLink command VEHICLE_CMD_ESTIMATOR_SENSOR_ENABLE or the individual CTRL params (e.g. EKF2_GPS_CTRL, EKF2_BARO_CTRL).
|
||||
|
||||
**Bitmask:**
|
||||
|
||||
- `0`: GNSS 0
|
||||
- `1`: GNSS 1
|
||||
- `2`: Optical flow
|
||||
- `3`: External vision
|
||||
- `4`: Aux global position 0
|
||||
- `5`: Aux global position 1
|
||||
- `6`: Aux global position 2
|
||||
- `7`: Aux global position 3
|
||||
- `8`: Barometer
|
||||
- `9`: Range finder
|
||||
- `10`: Magnetometer
|
||||
- `11`: Airspeed
|
||||
- `12`: Ranging beacon
|
||||
|
||||
| Reboot | minValue | maxValue | increment | default | unit |
|
||||
| ------ | -------- | -------- | --------- | ------- | ---- |
|
||||
| | 0 | 8191 | | 8191 | |
|
||||
|
||||
### EKF2_SYNT_MAG_Z (`INT32`) {#EKF2_SYNT_MAG_Z}
|
||||
|
||||
Enable synthetic magnetometer Z component measurement.
|
||||
@@ -23061,6 +23146,26 @@ This increment is added to TRIM_YAW when airspeed is FW_AIRSPD_MIN.
|
||||
| ------ | -------- | -------- | --------- | ------- | ---- |
|
||||
| | -0.5 | 0.5 | 0.01 | 0.0 | |
|
||||
|
||||
### FW_FLAPS_MAN (`INT32`) {#FW_FLAPS_MAN}
|
||||
|
||||
Flap input in manual flight.
|
||||
|
||||
Chose source for manual setting of flaps in manual flight modes.
|
||||
|
||||
**Values:**
|
||||
|
||||
- `0`: Disabled
|
||||
- `1`: Aux1
|
||||
- `2`: Aux2
|
||||
- `3`: Aux3
|
||||
- `4`: Aux4
|
||||
- `5`: Aux5
|
||||
- `6`: Flaps channel
|
||||
|
||||
| Reboot | minValue | maxValue | increment | default | unit |
|
||||
| ------ | -------- | -------- | --------- | ------- | ---- |
|
||||
| | | | | 0 | |
|
||||
|
||||
### FW_GC_EN (`INT32`) {#FW_GC_EN}
|
||||
|
||||
Enable rate gain compression.
|
||||
@@ -23221,6 +23326,10 @@ Chose source for manual setting of spoilers in manual flight modes.
|
||||
- `0`: Disabled
|
||||
- `1`: Flaps channel
|
||||
- `2`: Aux1
|
||||
- `3`: Aux2
|
||||
- `4`: Aux3
|
||||
- `5`: Aux4
|
||||
- `6`: Aux5
|
||||
|
||||
| Reboot | minValue | maxValue | increment | default | unit |
|
||||
| ------ | -------- | -------- | --------- | ------- | ---- |
|
||||
@@ -23807,7 +23916,7 @@ Mode 6 is intended for use with a ground control station (not necessarily an RTK
|
||||
|
||||
| Reboot | minValue | maxValue | increment | default | unit |
|
||||
| ------- | -------- | -------- | --------- | ------- | ---- |
|
||||
| ✓ | 0 | 1 | | 0 | |
|
||||
| ✓ | 0 | 6 | | 0 | |
|
||||
|
||||
### GPS_UBX_PPK (`INT32`) {#GPS_UBX_PPK}
|
||||
|
||||
@@ -28462,7 +28571,7 @@ MAVLink airframe type.
|
||||
|
||||
| Reboot | minValue | maxValue | increment | default | unit |
|
||||
| ------ | -------- | -------- | --------- | ------- | ---- |
|
||||
| | 0 | 22 | | 0 | |
|
||||
| | 0 | 23 | | 0 | |
|
||||
|
||||
### MAV_USEHILGPS (`INT32`) {#MAV_USEHILGPS}
|
||||
|
||||
@@ -28719,7 +28828,7 @@ Heading behavior in autonomous modes.
|
||||
|
||||
| Reboot | minValue | maxValue | increment | default | unit |
|
||||
| ------ | -------- | -------- | --------- | ------- | ---- |
|
||||
| | 0 | 4 | | 0 | |
|
||||
| | 0 | 5 | | 0 | |
|
||||
|
||||
### NAV_ACC_RAD (`FLOAT`) {#NAV_ACC_RAD}
|
||||
|
||||
@@ -37673,7 +37782,7 @@ TeraRanger Rangefinder (i2c).
|
||||
|
||||
| Reboot | minValue | maxValue | increment | default | unit |
|
||||
| ------- | -------- | -------- | --------- | ------- | ---- |
|
||||
| ✓ | 0 | 3 | | 0 | |
|
||||
| ✓ | 0 | 5 | | 0 | |
|
||||
|
||||
### SENS_EN_VL53L0X (`INT32`) {#SENS_EN_VL53L0X}
|
||||
|
||||
@@ -39895,6 +40004,104 @@ Absolute value superior to 10000 will disable distance sensor
|
||||
| ------ | -------- | -------- | --------- | ------- | ---- |
|
||||
| | | | | -1.0 | m |
|
||||
|
||||
### SIH_F_CP0 (`FLOAT`) {#SIH_F_CP0}
|
||||
|
||||
Forward thruster static power coefficient.
|
||||
|
||||
| Reboot | minValue | maxValue | increment | default | unit |
|
||||
| ------ | -------- | -------- | --------- | ------- | ---- |
|
||||
| | 0.0 | | | 0.0 | |
|
||||
|
||||
### SIH_F_CP1 (`FLOAT`) {#SIH_F_CP1}
|
||||
|
||||
Forward thruster power coefficient 1.
|
||||
|
||||
CP(J) = CP0 + CP1*J + CP2*J^2
|
||||
|
||||
| Reboot | minValue | maxValue | increment | default | unit |
|
||||
| ------ | -------- | -------- | --------- | ------- | ---- |
|
||||
| | | | | 0.0 | |
|
||||
|
||||
### SIH_F_CP2 (`FLOAT`) {#SIH_F_CP2}
|
||||
|
||||
Forward thruster power coefficient 2.
|
||||
|
||||
CP(J) = CP0 + CP1*J + CP2*J^2
|
||||
|
||||
| Reboot | minValue | maxValue | increment | default | unit |
|
||||
| ------ | -------- | -------- | --------- | ------- | ---- |
|
||||
| | | 0.0 | | 0.0 | |
|
||||
|
||||
### SIH_F_CT0 (`FLOAT`) {#SIH_F_CT0}
|
||||
|
||||
Forward thruster static thrust coefficient.
|
||||
|
||||
| Reboot | minValue | maxValue | increment | default | unit |
|
||||
| ------ | -------- | -------- | --------- | ------- | ---- |
|
||||
| | 0.0 | | | 0.0 | |
|
||||
|
||||
### SIH_F_CT1 (`FLOAT`) {#SIH_F_CT1}
|
||||
|
||||
Forward thruster thrust coefficient 1.
|
||||
|
||||
CT(J) = CT0 + CT1*J + CT2*J^2
|
||||
|
||||
| Reboot | minValue | maxValue | increment | default | unit |
|
||||
| ------ | -------- | -------- | --------- | ------- | ---- |
|
||||
| | | | | 0.0 | |
|
||||
|
||||
### SIH_F_CT2 (`FLOAT`) {#SIH_F_CT2}
|
||||
|
||||
Forward thruster thrust coefficient 2.
|
||||
|
||||
CT(J) = CT0 + CT1*J + CT2*J^2
|
||||
|
||||
| Reboot | minValue | maxValue | increment | default | unit |
|
||||
| ------ | -------- | -------- | --------- | ------- | ---- |
|
||||
| | | 0.0 | | 0.0 | |
|
||||
|
||||
### SIH_F_DIA_INCH (`FLOAT`) {#SIH_F_DIA_INCH}
|
||||
|
||||
Forward thruster propeller diameter in inches.
|
||||
|
||||
| Reboot | minValue | maxValue | increment | default | unit |
|
||||
| ------ | -------- | -------- | --------- | ------- | ---- |
|
||||
| | 0.1 | | | 0.1 | |
|
||||
|
||||
### SIH_F_Q_MAX (`FLOAT`) {#SIH_F_Q_MAX}
|
||||
|
||||
Forward thruster max torque (Nm).
|
||||
|
||||
This is used for the Fixed-Wing, Tailsitter, or pusher of the Standard VTOL
|
||||
if SIH_F_CP0 <= 0.
|
||||
If SIH_F_CP0 > 0, propeller model with advance ratio J is used
|
||||
and this parameter value is overridden at simulation startup.
|
||||
|
||||
| Reboot | minValue | maxValue | increment | default | unit |
|
||||
| ------ | -------- | -------- | --------- | ------- | ---- |
|
||||
| | 0.0 | | | 0.0165 | Nm |
|
||||
|
||||
### SIH_F_RPM_MAX (`FLOAT`) {#SIH_F_RPM_MAX}
|
||||
|
||||
Forward thruster max RPM.
|
||||
|
||||
| Reboot | minValue | maxValue | increment | default | unit |
|
||||
| ------ | -------- | -------- | --------- | ------- | ---- |
|
||||
| | 0.1 | | | 6000.0 | |
|
||||
|
||||
### SIH_F_T_MAX (`FLOAT`) {#SIH_F_T_MAX}
|
||||
|
||||
Forward thruster max thrust (N).
|
||||
|
||||
This is used for the Fixed-Wing, Tailsitter, or pusher of the Standard VTOL
|
||||
if SIH_F_CT0 <= 0.
|
||||
If SIH_F_CT0 > 0, propeller model with advance ratio J is used
|
||||
and this parameter value is overridden at simulation startup.
|
||||
|
||||
| Reboot | minValue | maxValue | increment | default | unit |
|
||||
| ------ | -------- | -------- | --------- | ------- | ---- |
|
||||
| | 0.0 | | | 2.0 | N |
|
||||
|
||||
### SIH_IXX (`FLOAT`) {#SIH_IXX}
|
||||
|
||||
Vehicle inertia about X axis.
|
||||
@@ -40069,26 +40276,40 @@ This value can be measured by weighting the quad on a scale.
|
||||
|
||||
### SIH_Q_MAX (`FLOAT`) {#SIH_Q_MAX}
|
||||
|
||||
Max propeller torque.
|
||||
Max multicopter propeller torque.
|
||||
|
||||
This is the maximum torque delivered by one propeller
|
||||
when the motor is running at full speed.
|
||||
|
||||
This value is usually about few percent of the maximum thrust force.
|
||||
|
||||
Refer to SIH_F_Q_MAX for the propeller torque for FW, Tailsitter, and VTOL pusher.
|
||||
|
||||
| Reboot | minValue | maxValue | increment | default | unit |
|
||||
| ------ | -------- | -------- | --------- | ------- | ---- |
|
||||
| | 0.0 | | 0.05 | 0.1 | Nm |
|
||||
|
||||
### SIH_RNGBC_NOISE (`FLOAT`) {#SIH_RNGBC_NOISE}
|
||||
|
||||
Ranging beacon measurement noise standard deviation.
|
||||
|
||||
Gaussian noise added to simulated ranging beacon measurements. Set to 0 to disable noise.
|
||||
|
||||
| Reboot | minValue | maxValue | increment | default | unit |
|
||||
| ------ | -------- | -------- | --------- | ------- | ---- |
|
||||
| | 0.0 | 100.0 | | 30.0 | m |
|
||||
|
||||
### SIH_T_MAX (`FLOAT`) {#SIH_T_MAX}
|
||||
|
||||
Max propeller thrust force.
|
||||
Max multicopter propeller thrust force.
|
||||
|
||||
This is the maximum force delivered by one propeller
|
||||
when the motor is running at full speed.
|
||||
|
||||
This value is usually about 5 times the mass of the quadrotor.
|
||||
|
||||
Refer to SIH_F_T_MAX for the thrust for FW, Tailsitter, and VTOL pusher.
|
||||
|
||||
| Reboot | minValue | maxValue | increment | default | unit |
|
||||
| ------ | -------- | -------- | --------- | ------- | ---- |
|
||||
| | 0.0 | | 0.5 | 5.0 | N |
|
||||
@@ -43853,7 +44074,7 @@ Selects what type of mode is enabled, if any
|
||||
|
||||
| Reboot | minValue | maxValue | increment | default | unit |
|
||||
| ------- | -------- | -------- | --------- | ------- | ---- |
|
||||
| ✓ | 0 | 2 | | 0 | |
|
||||
| ✓ | 0 | 3 | | 0 | |
|
||||
|
||||
### VOXL_ESC_PUB_BST (`INT32`) {#VOXL_ESC_PUB_BST}
|
||||
|
||||
|
||||
@@ -457,6 +457,10 @@ div.frame_variant td, div.frame_variant th {
|
||||
<td>SIH Quadcopter X</td>
|
||||
<td>Maintainer: Romain Chiappinelli <romain.chiap@gmail.com><p><code>SYS_AUTOSTART</code> = 1100</p></td>
|
||||
</tr>
|
||||
<tr id="copter_simulation_sih_hexacopter_x">
|
||||
<td>SIH Hexacopter X</td>
|
||||
<td>Maintainer: Romain Chiappinelli <romain.chiap@gmail.com><p><code>SYS_AUTOSTART</code> = 1105</p></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||