Gyroscope: For the ROS message, I need rad/s. It seems like MultiWii writes the ADC values, so I looked up the details in the MPU-6050 datasheet where it says the range is +/- 2000 deg/s and LSB sensitivity 16.4 deg/s (packed into a 16 bit register), so I should be able to convert to deg/s using the factor gf = 2000. / 32768. I'm not 100% sure this is correct though because the resulting numbers are a bit too small (maybe factor 2), but then it's hard to apply a known angular speed to verify my numbers.
The MultiwiiConfig code divides the number by 8 (instead of 16.384 in my case), does anyone know how the 8 has been computed?
Code: Select all
gx = read16()/8;gy = read16()/8;gz = read16()/8;
The same question for the magnetic field sensor (HMC5883). Although its magnitude is not that important for most applications, I'd like to make sure the units are correct. MultiWiiConf divides by 3, but why?
Code: Select all
magx = read16()/3;magy = read16()/3;magz = read16()/3;
From the MultiWii source and the sensor datasheet I know that it's configured for a range of +/- 1.2 Gauss and with a gain of 1024, so a scaling of 1.2/1024 results in magnitudes of around ~0.5 Ga which seems reasonable.
Thanks,
Robert