Android的增强现实。坏传感器读数 [英] Android augmented reality. Bad sensors reading

查看:116
本文介绍了Android的增强现实。坏传感器读数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,对不起我的英语水平。我按照拉哈夫苏德的书的步骤编程为Android的增强现实浏览器。它的标题是Pro Android的增强现实。问题是,当我启动第9章的例子(名为Android的临AR 9位于 https://开头github上。 COM / RaghavSood / ProAndroidAugmentedReality )在我的设备,这取决于设备的类型工作正常与否。

First of all, sorry for my english. I'm programming an Augmented Reality Browser for Android following the steps in Raghav Sood's book. Its title is Pro Android Augmented Reality. The thing is that when i launch the example of chapter 9 (named Pro Android AR 9 and located in https://github.com/RaghavSood/ProAndroidAugmentedReality) in my devices, it works fine or not depending on the kind of device.

在我的索尼爱立信Xperia Arc采用Android 4.0.4由拉哈夫实现浏览器的作品真的很好。当我测试的华硕Eee Pad变压器或三星Galaxy Tab,他们都采用Android 4.0.3增强现实浏览器,从传感器读数似乎是错误的。拿在横向模式的平板电脑在我的面前,如果我集中在一个地方(维基百科,Twitter或当地的标志),并交出自己的权利,斑点会下降。如果我向左转,斑点上升。如果我想的斑点移动到左侧,我有倾斜使他们的屏幕看起来到地面的设备。以相同的顺序,如果我打开使得屏幕上的设备查找到空气中,斑点将向右移动。

In my Sony Ericsson Xperia Arc with Android 4.0.4 the browser implemented by Raghav works really fine. When i test the augmented-reality browser in Asus Eee Pad Transformer or in Samsung Galaxy Tab, both of them with Android 4.0.3, the readings from the sensors seem to be wrong. Holding the tablets in landscape mode in front of me, if i focus over one spot (wikipedia, twitter or local markers) and turn over myself to the right, the spots goes down. If i turn to the left, the spots goes up. If i want the spots to move to the left, i have to tilt the devices making their screens look to the ground. In the same order, if i turn the devices making the screens look up to the air, the spots will move to the right.

好像程序是混乱传感器读数。任何人都知道如何解决这个问题?先谢谢了。

Seems like the program is confusing sensor readings. Anyone knows how to solve the problem??? Thanks in advance.

推荐答案

我做到了。我不知道这是否是一个很好的解决方案,但似乎工作在平板电脑上的罚款。

i made it. I don't know if it is a good solution but seems to work fine on tablets.

更改轴:

SensorManager.remapCoordinateSystem(temp, SensorManager.AXIS_X, SensorManager.AXIS_Y, rotation) 

在SensorActivity似乎解决轴线故障。另一个问题是与每个POI asociated文本出现转向使用横向模式片。为了避免这种情况,我用一个有条件的旋转修饰PaintablePosition类的设置方法:

in SensorActivity seems to fix the axis malfunction. Other problem was that the text asociated with each POI appeared turned in tablets using landscape mode. To avoid this, i used a conditional rotation modification in set method of PaintablePosition class:

if(drawObj.toString().toLowerCase().contains("paintableboxedtext")) rotation=rotation+270;

这篇关于Android的增强现实。坏传感器读数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆