07-25-2020, 11:05 AM
(This post was last modified: 07-25-2020, 03:15 PM by devrtz.
Edit Reason: Food for thought
)
Thanks for the reply and the measurements.
The links also do look very interesting!
To answer your last question: I believe the readings are consistent within a device (just checked with the BH).
Although I have to say that in general the values are kinda jumpy (which is why I made the script using running averages) and overall the sensor appears to be pretty sensitive. I get changes of a few 100 if I move the mouse closer to the phone (?).
EDIT:
When I thought about how to make the measurements I made it more complicated than it needs to be (separate rotations and using a "reference orientation").
Just "waving" the phone randomly makes a lot of sense actually and the "soft iron" corrected plot is a lot what you would expect to measure (basically a sphere).
As for the calibration: Currently, I think we would need to calibrate each device independently and save the calibration data (the weighted/scaled offsets) somewhere.
It's a bit hacky but I would've read the sensor values directly from /sys.
From what I understood iio-sensor-proxy does currently not work, because only magnetometers which have a "in_rot_from_north_magnetic_tilt_comp" entry in sysfs are supported.
If I understand correctly there would be 2 possible ways to fix this. Either fix the driver to include the entry (including "online" calibration - otherwise we can't possible know what to put in "in_rot_from_north_magnetic_tilt_comp") or do the calibration in iio-sensor-proxy and support polling/non calibrated magnetometers.
The links also do look very interesting!
To answer your last question: I believe the readings are consistent within a device (just checked with the BH).
Although I have to say that in general the values are kinda jumpy (which is why I made the script using running averages) and overall the sensor appears to be pretty sensitive. I get changes of a few 100 if I move the mouse closer to the phone (?).
EDIT:
When I thought about how to make the measurements I made it more complicated than it needs to be (separate rotations and using a "reference orientation").
Just "waving" the phone randomly makes a lot of sense actually and the "soft iron" corrected plot is a lot what you would expect to measure (basically a sphere).
As for the calibration: Currently, I think we would need to calibrate each device independently and save the calibration data (the weighted/scaled offsets) somewhere.
It's a bit hacky but I would've read the sensor values directly from /sys.
From what I understood iio-sensor-proxy does currently not work, because only magnetometers which have a "in_rot_from_north_magnetic_tilt_comp" entry in sysfs are supported.
If I understand correctly there would be 2 possible ways to fix this. Either fix the driver to include the entry (including "online" calibration - otherwise we can't possible know what to put in "in_rot_from_north_magnetic_tilt_comp") or do the calibration in iio-sensor-proxy and support polling/non calibrated magnetometers.