Start a new topic

Magnetometer/compass questions (Android)

Hi! I am using Wikitude 7.1.0 with ODG R-7 smartglasses. I have some difficulties calibrating the compass and therefore, have some questions regarding how the magnetometer is used by Wikitude.


1. What values does Wikitude use from the magnetometer: TYPE_MAGNETIC_FIELD or TYPE_MAGNETIC_FIELD_UNCALIBRATED? 


2. In an older topic it was stated that inserting compass values manually is not possible with Wikitude. Is this still the case?


3. I noticed that in the hardware class, there is a method: sensors.compass.correctionAngle 

 

 

"Defines a correction angle clockwise of the compass in degrees. Values will be applied modulo 360. A value of 361 degrees has the same effect as setting the value to 1 degree." 

How is this method used, exactly? Is this correction value added or substracted from the actual value?

Thanks for your help! :)


Hi, it seems that the problem is not the magnetometer. Based on tests, there is a problem with the rotation vector.


Here is an image of the coordinate system defined by ODG. Is the coordinate system depicted in the image behind the link what Wikitude is expecting?  


In my tests, I noticed that determining orientation using the rotation vector only works when the device is tilted so that the z-axis is pointing upwards (the user is looking down). This would correspond to a phone being held levelly on a table as defined by Android. This is not specific to Wikitude, I tested compass apps for Android. To me, this behavior does not sound like what should be expected. The reason is still unclear and I am talking with ODG support. 


For software done with Wikitude, this problem could be bypassed if it was possible to modify the rotation vector values used by the SDK. Apparently modifying sensor values is not possible for Android operating systems. Is adding functions for inserting modified sensor data something that Wikitude could consider? There could be other incentives for this as well, as described in my suggestion here.

Login or Signup to post a comment