Skip to content

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
pr_apm47_can_ahrsfrom
copilot/use-pixhawk6x-as-external-ahrs
Draft

AP_ExternalAHRS/AP_Periph: fix build errors from missing macro defaults and absent DroneCAN guard#2
huangfuluya with Copilot wants to merge 10 commits into
pr_apm47_can_ahrsfrom
copilot/use-pixhawk6x-as-external-ahrs

Conversation

Copilot AI commented Mar 17, 2026

Copy link
Copy Markdown
  • Add Pixhawk6X-periph to the periph-build block in Tools/scripts/build_ci.sh so it is built as part of the existing ChibiOS periph-build matrix
  • Create .github/workflows/build_pixhawk6x_periph.yml — dedicated workflow that builds Pixhawk6X-periph on every push/PR and uploads the compiled .apj firmware 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.

…(partial)

Co-authored-by: huangfuluya <47851080+huangfuluya@users.noreply.github.com>
Co-authored-by: huangfuluya <47851080+huangfuluya@users.noreply.github.com>
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
huangfuluya marked this pull request as ready for review March 18, 2026 05:50
Copilot AI review requested due to automatic review settings March 18, 2026 05:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_PORT parameter and ahrs_serial.cpp sender thread).
  • Adds a new AP_ExternalAHRS_Pixhawk6X backend 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.

Comment thread libraries/AP_ExternalAHRS/AP_ExternalAHRS_Pixhawk6X.cpp Outdated
Comment thread libraries/AP_ExternalAHRS/AP_ExternalAHRS_Pixhawk6X.cpp
Comment thread libraries/AP_ExternalAHRS/AP_ExternalAHRS_Pixhawk6X.cpp Outdated
Comment thread Tools/AP_Periph/ahrs_serial.cpp Outdated
Comment thread libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py
Comment thread libraries/AP_HAL_ChibiOS/hwdef/Pixhawk6X-periph/defaults.parm Outdated
Comment thread Tools/AP_Periph/ahrs_serial.cpp Outdated
@huangfuluya
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants