Skip to content

New sensor#3887

Merged
patrickelectric merged 2 commits into
bluerobotics:masterfrom
Williangalvani:new_sensor
Apr 28, 2026
Merged

New sensor#3887
patrickelectric merged 2 commits into
bluerobotics:masterfrom
Williangalvani:new_sensor

Conversation

@Williangalvani
Copy link
Copy Markdown
Member

@Williangalvani Williangalvani commented Apr 23, 2026

AK09915 is EOL now, so we are switching over to IIS2MDC, that requires BlueOS to identify these boards as Navigators.

Thoughts?

Summary by Sourcery

Update device identification to support new compass and IMU sensor types and adjust Navigator board detection for the new magnetometer.

New Features:

  • Add new compass type identifiers for QMC5883P, BMM350, IIS2MDC, and LIS2MDL to the device ID decoder.
  • Add new IMU type identifiers for ICM45686, SCHA63T, IIM42653, and LSM6DSV to the device ID decoder.

Enhancements:

  • Adjust NavigatorPi4 and NavigatorPi5 flight controller detection to no longer rely on the AK09915 compass device presence.

Summary by Sourcery

Support new magnetometer and IMU types and update Navigator flight controller detection to recognize boards with either legacy or new sensors.

New Features:

  • Add decoding support for additional compass types including IIS2MDC and other new magnetometers in the frontend device ID decoder.
  • Add decoding support for additional IMU types in the frontend device ID decoder.

Enhancements:

  • Update Navigator Pi4 and Pi5 detection logic to require core I2C devices while accepting either the legacy AK09915 or the new IIS2MDC magnetometer.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Apr 23, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates device identification to support new compass and IMU sensor types, and adjusts Navigator board detection to no longer rely on the EOL AK09915 compass device.

Class diagram for updated sensor type enums in deviceid_decoder

classDiagram
    direction TB

    class COMPASS_TYPE {
        <<enumeration>>
        MAG3110 = 0x00
        HMC5883 = 0x01
        IST8310 = 0x02
        LIS3MDL = 0x03
        RM3100 = 0x04
        IST8308 = 0x05
        IST8306 = 0x06
        QMC5883 = 0x07
        MMC3416 = 0x08
        HMC5983 = 0x09
        IST8310_2 = 0x0A
        IST8307 = 0x0B
        AK8963 = 0x0C
        IST8308_2 = 0x0D
        IST8306_2 = 0x0E
        IST8307_2 = 0x0F
        IST8310_3 = 0x10
        IST8306_3 = 0x11
        IST8310_4 = 0x12
        MMC5883 = 0x13
        AK09918 = 0x14
        AK09915 = 0x15
        QMC5883P = 0x16
        BMM350 = 0x17
        IIS2MDC = 0x18
        LIS2MDL = 0x19
    }

    class IMU_TYPE {
        <<enumeration>>
        ICM20608 = 0x00
        ICM20602 = 0x01
        MPU9250 = 0x02
        ICM20789 = 0x03
        BMI055 = 0x04
        ICM42605 = 0x05
        MPU6050 = 0x06
        MPU6500 = 0x07
        ICM20689 = 0x08
        ICM20690 = 0x09
        ICM20602_2 = 0x0A
        ICM20948 = 0x0B
        ICM20649 = 0x0C
        BMI160 = 0x0D
        ICM20601 = 0x0E
        ICM20648 = 0x0F
        ICM20600 = 0x10
        BMI088 = 0x11
        ICM42688 = 0x12
        ICM42670 = 0x13
        ICM42605_2 = 0x14
        ICM42686 = 0x15
        ICM42686P = 0x16
        ICM42686D = 0x17
        ICM42622 = 0x18
        ICM42631 = 0x19
        INS_ICM20602 = 0x30
        INS_ICM20689 = 0x31
        INS_ICM20690 = 0x32
        INS_ICM20948 = 0x33
        INS_BMI088 = 0x34
        INS_BMI160 = 0x35
        INS_ICM20649 = 0x36
        INS_ICM42605 = 0x37
        INS_BMI270 = 0x38
        INS_BMI085 = 0x39
        INS_ICM42670 = 0x3A
        INS_ICM45686 = 0x3B
        INS_SCHA63T = 0x3C
        INS_IIM42653 = 0x3D
        INS_LSM6DSV = 0x3E
    }
Loading

Class diagram for Navigator board detection without AK09915

classDiagram
    direction TB

    class Navigator {
        <<abstract>>
        +List~Serial~ get_serials()
        +bool detect()
    }

    class NavigatorPi4 {
        +dict devices
    }

    class NavigatorPi5 {
        +dict devices
    }

    Navigator <|-- NavigatorPi4
    Navigator <|-- NavigatorPi5

    class ADS1115 {
        <<device>>
        +int i2c_address = 0x48
        +int bus
    }

    class BME280 {
        <<device>>
        +int i2c_address = 0x76
        +int bus
    }

    class PCA9685_Pi4 {
        <<device>>
        +int i2c_address = 0x40
        +int bus = 4
    }

    class PCA9685_Pi5 {
        <<device>>
        +int i2c_address = 0x40
        +int bus = 3
    }

    NavigatorPi4 o-- ADS1115 : uses
    NavigatorPi4 o-- BME280 : uses
    NavigatorPi4 o-- PCA9685_Pi4 : uses

    NavigatorPi5 o-- ADS1115 : uses
    NavigatorPi5 o-- BME280 : uses
    NavigatorPi5 o-- PCA9685_Pi5 : uses
Loading

File-Level Changes

Change Details Files
Extend compass and IMU type enums to include new sensor identifiers.
  • Add new compass type enum entries for QMC5883P, BMM350, IIS2MDC, and LIS2MDL.
  • Add new IMU type enum entries for INS_ICM45686, INS_SCHA63T, INS_IIM42653, and INS_LSM6DSV.
core/frontend/src/utils/deviceid_decoder.ts
Update Navigator board I2C signature to remove dependency on AK09915 compass device.
  • Remove AK09915 from the expected I2C devices list for NavigatorPi5.
  • Remove AK09915 from the expected I2C devices list for NavigatorPi4, so boards without this EOL sensor can still be detected as Navigators.
core/services/ardupilot_manager/flight_controller_detector/linux/navigator.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 left some high level feedback:

  • For NavigatorPi4/5 detection, consider making the magnetometer check tolerant of either AK09915 or IIS2MDC (rather than removing the compass check entirely) if you still want to validate that a Navigator board has a magnetometer present.
  • Now that detection no longer relies on AK09915, it may be worth clarifying the intended lifecycle of the AK09915 enum entry (e.g., deprecating or commenting its status) so future changes don’t assume it’s still actively used in hardware detection.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- For NavigatorPi4/5 detection, consider making the magnetometer check tolerant of either AK09915 or IIS2MDC (rather than removing the compass check entirely) if you still want to validate that a Navigator board has a magnetometer present.
- Now that detection no longer relies on AK09915, it may be worth clarifying the intended lifecycle of the AK09915 enum entry (e.g., deprecating or commenting its status) so future changes don’t assume it’s still actively used in hardware detection.

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.

@Williangalvani Williangalvani marked this pull request as draft April 23, 2026 18:12
@Williangalvani Williangalvani marked this pull request as ready for review April 28, 2026 15:36
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 left some high level feedback:

  • The NavigatorPi4 and NavigatorPi5 classes now duplicate the required_devices/magnetometer_devices layout and detect logic; consider factoring the common detection pattern into Navigator (e.g., helper methods or shared attributes) to reduce duplication and keep future sensor changes in one place.
  • For magnetometer_devices, the key "IIS2MDC_0x1E" is inconsistent with the other entries that don’t encode the address in the name; consider standardizing these keys (either all include the address or none do) to keep the mapping easier to read and maintain.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `NavigatorPi4` and `NavigatorPi5` classes now duplicate the `required_devices`/`magnetometer_devices` layout and detect logic; consider factoring the common detection pattern into `Navigator` (e.g., helper methods or shared attributes) to reduce duplication and keep future sensor changes in one place.
- For `magnetometer_devices`, the key `"IIS2MDC_0x1E"` is inconsistent with the other entries that don’t encode the address in the name; consider standardizing these keys (either all include the address or none do) to keep the mapping easier to read and maintain.

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.

@patrickelectric patrickelectric merged commit 6329954 into bluerobotics:master Apr 28, 2026
7 checks passed
@patrickelectric patrickelectric deleted the new_sensor branch April 28, 2026 16:47
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.

2 participants