Page 1 of 1

saveMagnetometerCorrectionParameters vs setMagnetometerCorrectionParameters

Posted: Tue Nov 14, 2017 9:23 am
by mebrahimi
What is the difference between these two methods: saveMagnetometerCorrectionParameters vs setMagnetometerCorrectionParameters?

also does resetMagnetometerCorrectionParameters restore original factory settings?

Re: saveMagnetometerCorrectionParameters vs setMagnetometerCorrectionParameters

Posted: Tue Nov 14, 2017 9:48 am
by mparadis
setMagnetometerCorrectionParameters allows you to set the parameters for as long as the object remains open. If the object disconnects, the parameters will reset.

saveMagnetometerCorrectionParameters saves the currently set parameters to flash memory on the device, so that these parameters are automatically used when the device is connected. (This is not supported on the older 1056 PhidgetSpatial).

resetMagnetometerCorrectionParameters resets the current and saved parameters to zero (which is the factory setting for the parameters).

Re: saveMagnetometerCorrectionParameters vs setMagnetometerCorrectionParameters

Posted: Tue Nov 14, 2017 9:49 am
by mebrahimi
Thank you. I've been struggling with getting compass to work. Will keep playing with it.

Re: saveMagnetometerCorrectionParameters vs setMagnetometerCorrectionParameters

Posted: Tue Nov 14, 2017 1:12 pm
by Patrick
Unless you are using the 1056, you should not have to call these functions yourself - you should use the provided compass calibration software which will set and save the parameters to flash.

-Patrick

Re: saveMagnetometerCorrectionParameters vs setMagnetometerCorrectionParameters

Posted: Tue Nov 14, 2017 1:17 pm
by mebrahimi
I'm using a 1044 and did use the calibration software. Did not get consistent results - it seemed like it could accurately detect one direction, and 180 degree opposite, but in between, it was not linear (i.e. at 90 degrees, I would see 120). I will play with it some more tonight.

Re: saveMagnetometerCorrectionParameters vs setMagnetometerCorrectionParameters

Posted: Mon Nov 20, 2017 3:17 pm
by Patrick
It takes a surprisingly small amount of metal to interfere with the compass. It's best to run the calibration with the spatial already bolted into it's final place in your application. Sources of metal in the environment will need to be avoided, especially during calibration.

-Patrick