New sensor#3887
Merged
Merged
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates 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_decoderclassDiagram
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
}
Class diagram for Navigator board detection without AK09915classDiagram
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
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
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.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
10bb4b7 to
5800689
Compare
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The
NavigatorPi4andNavigatorPi5classes now duplicate therequired_devices/magnetometer_deviceslayout and detect logic; consider factoring the common detection pattern intoNavigator(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.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
patrickelectric
approved these changes
Apr 28, 2026
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.
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:
Enhancements:
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:
Enhancements: