Hi,
we are trying to read the data from the Magnetometer but it looks like to saturate very quickly when the device get close to some iron. We found that the source code has the following struct to hold the data extracted from the sensor :
typedef struct {
uint32_t rawSensors[N_RAW_SENS];
double scaledSensors[N_RAW_SENS]; // g's, rad/s, G, deg C, (body frame)
int32_t scaledSensors_q27[N_RAW_SENS]; // g's, rad/s, G, deg C, (body frame)
uint64_t tstamp; // timestamp of last sample
} sensors_data_t;
We noticed that the function
void GetMagData_G(double *data) {
for(int i = 0; i < 3; i++){
data[i] = gSensorsData.scaledSensors[i+XMAG];
}
}
retrieve the scaledSensor, how is it scaled, can it be changed by some parameter ? why does it saturate so quickly ? What's inside rawSensor ? Since the code of the library is not open, can you at least try to shed some light on how it works ?
Thanks Valerio