orientation sensor

84 views
Skip to first unread message

Jakub Podlaha

unread,
May 2, 2013, 2:06:10 AM5/2/13
to recon-de...@googlegroups.com
On one of screens on HUD there is a working compass. How can I access TYPE_ORIENTATION sensor? 

Following code (classic method afaik) returns empty list: 

mySensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
List<Sensor> mySensors = mySensorManager.getSensorList(Sensor.TYPE_ORIENTATION);


Thanks
kub1x

Jakub Podlaha

unread,
May 6, 2013, 12:47:18 AM5/6/13
to recon-de...@googlegroups.com
Ok. I'll try it again. I see 3 axis gyroscope on your list of sensors: 

http://hudsdk.reconinstruments.com/sensors

Is there any way to reach it from app running on goggles? 

Thank you
kub1x

Kyle

unread,
May 7, 2013, 6:16:15 PM5/7/13
to
Hi Jakub,

TYPE_ORIENTATION was deprecated in API level 8. Use SensorManager.getOrientation() instead.

Please be aware that the orientation call gives the orientation with respect to the board and not the display, so the absolute yaw is likely quite off from what you would expect. To account for this somewhat you could offset ~10 degrees of rotation around the y-axis (when the HUD is in the goggles this will be the axis pointing from the ground up). 

We are working an API to correct this offset, but it has not been released yet. Hope this helps in the meantime.

Best,

Kyle
Reply all
Reply to author
Forward
0 new messages