Skip to content

Conversation

@theodoreng15
Copy link

Changed magnetometer driver, hoping these are all the changes

Copy link
Contributor

@mpkarpov-ui mpkarpov-ui left a comment

Choose a reason for hiding this comment

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

Overall looks good, some small changes would be nice, but nothing too big.


ErrorCode MagnetometerSensor::init() {
if (!LIS3MDL.begin_SPI(LIS3MDL_CS)) { // Checks if sensor is connected
if (MMC5983.begin(MMC5983_CS) == false) { // Checks if sensor is connected
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason for this change? (Specifically the == false part)

Y = ((double)cy - sf)/sf;
Z = ((double)cz - sf)/sf;

Magnetometer reading{X, Y, Z};
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm going to assume for this review that this is from the datasheet, but it does look like "magic math" to me... Could you add a doc comment?

Comment on lines +169 to +171
double mx;
double my;
double mz;
Copy link
Contributor

Choose a reason for hiding this comment

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

Discussed this, I think its OK. I want a second opinion though @MuhammadAli8209 @tjmcmanamen38

Mag isn't buffered to my knowledge, so worst case this just doubles the mag log size from 12 --> 24, which isnt world ending.

Comment on lines -16 to 18
adafruit/Adafruit LIS3MDL@^1.2.1 ; Magnetometer driver
adafruit/Adafruit LIS3MDL@^1.2.1 ; Old magnetometer driver, Adafruit_BNO08x fails or else
sparkfun/SparkFun MMC5983MA Magnetometer Arduino Library@^1.1.4 ; Magnetometer driver
sparkfun/SparkFun u-blox GNSS v3@^3.1.8 ; GPS
Copy link
Contributor

Choose a reason for hiding this comment

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

OK for now, maybe let's clean it up later.

Context (@MuhammadAli8209 ): Adafruit sensor libraries bring in a bunch of adafruit helper libraries that are needed for the BNO sensor. Since we're removing the BNO, we'll remove this dependency when we merge the LSM changes.

Copy link
Contributor

Choose a reason for hiding this comment

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

lgtm 👍

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