Compass App
#15
(09-09-2021, 08:42 PM)newton688 Wrote: Thanks so much for this tool. I was wondering what was happening with the magnetometer and found this thread. Smile

I was tracking down a problem with GeoClue and the heading always pointing North and wanted to figure out the source of the problem. It appears that other sensors such as the Intel Sensor Hub are able to provide directly the angle to magnetic north and provide that as an IIO attribute in_rot_from_north_magnetic_tilt. I suppose that those sensors have some form of internal calibration either in hardware or in their kernel driver.

I'm wondering if there might be a way to push some of the logic for this app into iio-sensor-proxy, which might be applicable to to a wide variety of sensors. The question is what to do about the calibration. Perhaps it can be read from a configuration file that is generated with a helper app or maybe there is some way to auto-calibrate as the phone moves around enough.

Well, after working on this app I've been trying to help with something similar in UT for the Pinephone. In UT there is an intermediate layer carrying the sensor logic called sensorfw (which comes from Sailfish OS), sitting between the kernel driver and the applications. This includes auto-calibration, which turned out to have a bug preventing it from working properly.

Thanks to some very knowledgeable people already working on improving the Pinephone sensors in UT, I was able to make a small contribution including a fix for auto-calibration. Here's the draft for an MR to the sensorfw library, in case anybody is interested:

https://github.com/ubports/sensorfw/pull/4

Now, I was actually thinking on bringing some of this auto-calibration logic to the Compass app, as it seems fairly simple. But of course it makes more sense to have it in a middle layer instead, like in UT. I am not familiar with the sensor stack in distros using Phosh and what the sensorfw equivalent would be. Also I am not an expert by any measure. However, if anybody else knows about this I'd be glad to jump in and try to help them with what I can.
  Reply


Messages In This Thread
Compass App - by lgtrombetta - 06-23-2021, 10:54 AM
RE: Compass App - by awaittrot - 06-23-2021, 09:08 PM
RE: Compass App - by threepwood - 06-24-2021, 02:27 AM
RE: Compass App - by lgtrombetta - 06-24-2021, 09:16 AM
RE: Compass App - by lgtrombetta - 06-24-2021, 02:58 PM
RE: Compass App - by threepwood - 06-25-2021, 06:35 AM
RE: Compass App - by biketool - 06-25-2021, 07:08 AM
RE: Compass App - by lgtrombetta - 06-25-2021, 01:20 PM
RE: Compass App - by lgtrombetta - 06-26-2021, 07:28 AM
RE: Compass App - by lgtrombetta - 07-10-2021, 07:55 AM
RE: Compass App - by biketool - 07-28-2021, 01:07 AM
RE: Compass App - by lgtrombetta - 07-30-2021, 04:17 AM
RE: Compass App - by biketool - 07-30-2021, 08:14 AM
RE: Compass App - by newton688 - 09-09-2021, 08:42 PM
RE: Compass App - by lgtrombetta - 09-13-2021, 11:57 AM
RE: Compass App - by newton688 - 09-16-2021, 08:19 PM
RE: Compass App - by newton688 - 09-25-2021, 02:31 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)