Skip to content

Add missing identifiers for commonly used flight controllers#3884

Closed
gaojulong wants to merge 1 commit intobluerobotics:masterfrom
gaojulong:patch-4
Closed

Add missing identifiers for commonly used flight controllers#3884
gaojulong wants to merge 1 commit intobluerobotics:masterfrom
gaojulong:patch-4

Conversation

@gaojulong
Copy link
Copy Markdown
Contributor

@gaojulong gaojulong commented Apr 18, 2026

This update adds missing board identifiers for commonly used flight controllers that were not previously recognized.

Summary by Sourcery

Add support for additional flight controller board identifiers in the ArduPilot manager detector.

New Features:

  • Recognize CUAVv5 boards as Pixhawk4 platform via serial product identification.
  • Recognize Pixhawk6X boards as Pixhawk6X platform via serial product identification.

This update adds missing board identifiers for commonly used
flight controllers that were not previously recognized.
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Apr 18, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR extends the ArduPilot manager’s serial board identification table by adding product strings for additional common flight controllers so they can be correctly mapped to their corresponding platforms during detection.

Class diagram for extended serial board identification mapping

classDiagram
    class SerialBoardIdentifier {
        +SerialAttr attribute
        +string id_value
        +Platform platform
    }

    class SerialAttr {
        <<enumeration>>
        product
        vendor
        serial_number
    }

    class Platform {
        <<enumeration>>
        Pixhawk1
        Pixhawk4
        Pixhawk6X
        Pixhawk6C
        CubeOrange
    }

    class SerialBoardIdentificationTable {
        +SerialBoardIdentifier FMUv3x_Pixhawk1
        +SerialBoardIdentifier Pixhawk4_Pixhawk4
        +SerialBoardIdentifier FMUv5x_Pixhawk4
        +SerialBoardIdentifier CUAVv5_Pixhawk4
        +SerialBoardIdentifier Pixhawk6X_Pixhawk6X
        +SerialBoardIdentifier FMUv6Xx_Pixhawk6X
        +SerialBoardIdentifier FMUv6Cx_Pixhawk6C
        +SerialBoardIdentifier CubeOrange_CubeOrange
    }

    SerialBoardIdentifier --> SerialAttr : uses
    SerialBoardIdentifier --> Platform : maps_to
    SerialBoardIdentificationTable "1" --> "*" SerialBoardIdentifier : contains
Loading

File-Level Changes

Change Details Files
Extend serial board identification list to recognize additional flight controller product strings.
  • Added a SerialBoardIdentifier entry mapping the 'CUAVv5' USB product string to the Pixhawk4 platform.
  • Added a SerialBoardIdentifier entry mapping the 'Pixhawk6X' USB product string to the Pixhawk6X platform.
  • Kept ordering consistent with existing FMU v5/v6 mappings to minimize behavioral surprises.
core/services/ardupilot_manager/flight_controller_detector/board_identification.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 99d08bc. Configure here.

SerialBoardIdentifier(attribute=SerialAttr.product, id_value="FMU v3.x", platform=Platform.Pixhawk1),
SerialBoardIdentifier(attribute=SerialAttr.product, id_value="Pixhawk4", platform=Platform.Pixhawk4),
SerialBoardIdentifier(attribute=SerialAttr.product, id_value="FMU v5.x", platform=Platform.Pixhawk4),
SerialBoardIdentifier(attribute=SerialAttr.product, id_value="CUAVv5", platform=Platform.Pixhawk4),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

CUAVv5 mapped to wrong firmware platform

High Severity

The CUAVv5 board is mapped to Platform.Pixhawk4, but CUAVv5 has its own distinct firmware in the ArduPilot manifest (platform name "CUAVv5"). Since platform.value is used directly to query the manifest for firmware downloads, this mapping causes the system to download and install Pixhawk4 firmware onto CUAVv5 hardware. These boards have different sensor configurations, pin mappings, and peripheral assignments, so running the wrong firmware on a flight controller is a safety concern. A dedicated Platform enum entry for CUAVv5 is needed.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 99d08bc. Configure here.

@gaojulong gaojulong closed this Apr 19, 2026
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.

1 participant