AP_ExternalAHRS/AP_Periph: fix build errors from missing macro defaults and absent DroneCAN guard - #2
Draft
huangfuluya with Copilot wants to merge 10 commits into
Draft
AP_ExternalAHRS/AP_Periph: fix build errors from missing macro defaults and absent DroneCAN guard#2huangfuluya with Copilot wants to merge 10 commits into
huangfuluya with Copilot wants to merge 10 commits into
Conversation
Copilot stopped work on behalf of
huangfuluya due to an error
March 17, 2026 11:47
Copilot stopped work on behalf of
huangfuluya due to an error
March 17, 2026 13:18
…(partial) Co-authored-by: huangfuluya <47851080+huangfuluya@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add support for using Pixhawk6X as external AHRS via DroneCAN
AP_ExternalAHRS/Pixhawk6X-periph: add Pixhawk6X as External AHRS source
Mar 17, 2026
Copilot stopped work on behalf of
huangfuluya due to an error
March 17, 2026 16:20
Co-authored-by: huangfuluya <47851080+huangfuluya@users.noreply.github.com>
Copilot stopped work on behalf of
huangfuluya due to an error
March 18, 2026 01:57
Copilot
AI
changed the title
AP_ExternalAHRS/Pixhawk6X-periph: add Pixhawk6X as External AHRS source
AP_ExternalAHRS: Add Pixhawk6X as serial External AHRS source (APAS protocol)
Mar 18, 2026
Copilot
AI
changed the title
AP_ExternalAHRS: Add Pixhawk6X as serial External AHRS source (APAS protocol)
AP_ExternalAHRS: Add Pixhawk6X as External AHRS source via APAS serial protocol
Mar 18, 2026
huangfuluya
marked this pull request as ready for review
March 18, 2026 05:50
There was a problem hiding this comment.
Pull request overview
Adds support for using a Pixhawk6X running AP_Periph as an “External AHRS” source via a new APAS (ArduPilot AHRS Serial) protocol, plus a dedicated Pixhawk6X-periph hwdef/bootloader configuration.
Changes:
- Introduces APAS serial output in AP_Periph (new
AHRS_SERIAL_PORTparameter andahrs_serial.cppsender thread). - Adds a new
AP_ExternalAHRS_Pixhawk6Xbackend to ingest APAS frames and feed GPS/IMU/BARO/MAG into the existing external-sensor plumbing. - Adds new ChibiOS hwdef target
Pixhawk6X-periph(hwdef, defaults, bootloader artifacts) and improves defaults-parm selection handling.
Reviewed changes
Copilot reviewed 14 out of 16 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| Tools/bootloaders/Pixhawk6X-periph_bl.bin | Adds a prebuilt peripheral bootloader binary for the new target. |
| Tools/AP_Periph/Parameters.h | Adds k_param_ahrs_serial_port and backing storage for AHRS serial port selection. |
| Tools/AP_Periph/Parameters.cpp | Registers AHRS_SERIAL_PORT parameter metadata/default. |
| Tools/AP_Periph/AP_Periph.h | Declares the AHRS serial update method under AP_PERIPH_AHRS_SERIAL_ENABLED. |
| Tools/AP_Periph/AP_Periph.cpp | Starts an AHRS serial output thread when AHRS_SERIAL_PORT >= 0. |
| Tools/AP_Periph/ahrs_serial.cpp | Implements APAS frame emission for attitude/IMU/GPS/baro/mag over UART. |
| libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py | Fixes behavior when --default-parameters is not provided (but has a path-resolution bug). |
| libraries/AP_HAL_ChibiOS/hwdef/Pixhawk6X-periph/hwdef.dat | New Pixhawk6X peripheral hwdef enabling sensors + AHRS serial output. |
| libraries/AP_HAL_ChibiOS/hwdef/Pixhawk6X-periph/hwdef-bl.dat | New Pixhawk6X peripheral bootloader hwdef. |
| libraries/AP_HAL_ChibiOS/hwdef/Pixhawk6X-periph/defaults.parm | New defaults for Pixhawk6X-periph (includes a parameter currently disabled by hwdef). |
| libraries/AP_ExternalAHRS/AP_ExternalAHRS.h | Adds DevType::Pixhawk6X = 11 (conditional). |
| libraries/AP_ExternalAHRS/AP_ExternalAHRS.cpp | Wires in the new Pixhawk6X backend and updates parameter docs. |
| libraries/AP_ExternalAHRS/AP_ExternalAHRS_Pixhawk6X.h | New backend header for APAS parsing and health/status reporting. |
| libraries/AP_ExternalAHRS/AP_ExternalAHRS_Pixhawk6X.cpp | New backend implementation to parse APAS frames and forward sensor data. |
| libraries/AP_ExternalAHRS/AP_ExternalAHRS_config.h | Adds AP_EXTERNAL_AHRS_PIXHAWK6X_ENABLED config gate. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
huangfuluya
marked this pull request as draft
March 18, 2026 06:04
…n over CAN bus Co-authored-by: huangfuluya <47851080+huangfuluya@users.noreply.github.com>
Copilot
AI
changed the title
AP_ExternalAHRS: Add Pixhawk6X as External AHRS source via APAS serial protocol
AP_Periph/ExternalAHRS: convert Pixhawk6X AHRS from custom serial (APAS) to standard DroneCAN over CAN bus
Mar 18, 2026
…DroneCAN Co-authored-by: huangfuluya <47851080+huangfuluya@users.noreply.github.com>
Copilot
AI
changed the title
AP_Periph/ExternalAHRS: convert Pixhawk6X AHRS from custom serial (APAS) to standard DroneCAN over CAN bus
AP_Periph/ExternalAHRS: convert Pixhawk6X AHRS transport from custom serial (APAS) to DroneCAN
Mar 18, 2026
…RawIMU; remove serial support Co-authored-by: huangfuluya <47851080+huangfuluya@users.noreply.github.com>
Copilot
AI
changed the title
AP_Periph/ExternalAHRS: convert Pixhawk6X AHRS transport from custom serial (APAS) to DroneCAN
AP_Periph/ExternalAHRS: replace Pixhawk6X serial APAS transport with DroneCAN
Mar 18, 2026
…avigationSolution handler Co-authored-by: huangfuluya <47851080+huangfuluya@users.noreply.github.com>
…t rotation API Co-authored-by: huangfuluya <47851080+huangfuluya@users.noreply.github.com>
Copilot
AI
changed the title
AP_Periph/ExternalAHRS: replace Pixhawk6X serial APAS transport with DroneCAN
AP_ExternalAHRS/AP_Periph: fix velocity frame conversion; complete DroneCAN AHRS migration
Mar 18, 2026
…ECAN_ENABLED default and DroneCAN guard Co-authored-by: huangfuluya <47851080+huangfuluya@users.noreply.github.com>
Copilot
AI
changed the title
AP_ExternalAHRS/AP_Periph: fix velocity frame conversion; complete DroneCAN AHRS migration
AP_ExternalAHRS/AP_Periph: fix build errors from missing macro defaults and absent DroneCAN guard
Mar 18, 2026
…build CI entry Co-authored-by: huangfuluya <47851080+huangfuluya@users.noreply.github.com> Agent-Logs-Url: https://github.com/huangfuluya/ardupilot/sessions/ab4efa55-3780-4c9c-9d19-2600efb896fa
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pixhawk6X-periphto theperiph-buildblock inTools/scripts/build_ci.shso it is built as part of the existing ChibiOSperiph-buildmatrix.github/workflows/build_pixhawk6x_periph.yml— dedicated workflow that buildsPixhawk6X-periphon every push/PR and uploads the compiled.apjfirmware as a downloadable GitHub Actions artifact (retained for 30 days)📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.