Paul Kocialkowski's coding blog - Tag akm8975 http://code.paulk.fr/tag/akm8975 en Free software, programming and stuff Wed, 13 Mar 2013 23:13:00 +0100 PluXml Orientation vector calculation from accelerometer and magnetometer sensors in Android http://code.paulk.fr/article10/orientation-vector-calculation-from-accelerometer-and-magnetometer-sensors-in-android http://code.paulk.fr/article10/orientation-vector-calculation-from-accelerometer-and-magnetometer-sensors-in-android <p>While reversing the <a href="https://gitorious.org/replicant/device_samsung_p5100">Galaxy Tab 2 sensors</a>, I have been looking for a way to calculate the orientation vector from acceleration and magnetic field vectors: I've looked at any sensors implementation I could find and each time, this was being held into some proprietary component, to the point that the Galaxy Tab 2 has an user-space blob dedicated to this task (<span style="font-weight: bold;">orientationd</span>). Since I am not an expert at physics, I soon gave up on writing a free orientationd implementation, which was really a shame given the time I spent making the geomagnetic sensor work properly. I just realized that there was one last implementation I didn't look at, that is the <a href="https://github.com/akm-multisensor/AK8975_FS">free software user-space program for AKM8975</a>. So many thanks to <a href="http://www.asahi-kasei.co.jp/asahi/en/">Asahi Kasei</a>: I was able to reuse that code directly and it worked perfectly at first try. <br />That's pretty amazing!</<p> <p>All the glory details are in the <a href="https://github.com/akm-multisensor/AK8975_FS/blob/master/akmdfs/AKFS_APIs_8975/AKFS_Direction.c">akmdfs/AKFS_APIs_8975/AKFS_Direction.c</a> file. To put it in a nutshell:</p> <p><img src="/data/images/orientation.png" alt="orientation" /></p> <p>In the end, I think this piece of code from that free software implementation made my day!</p> Wed, 13 Mar 2013 23:13:00 +0100 Paul Kocialkowski Fatal error : type : 2 message : Trying to access array offset on value of type null file : /core/lib/class.plx.motor.php line : 746 See https://www.php.net/manual/en/errorfunc.constants.php about type of error ============================================================ Drop this plugin now for running PluXml and report to its author !!