Android的设备转换坐标系"用户QUOT;坐标系 [英] Android Convert device coordinate system to "user" coordinate system

查看:285
本文介绍了Android的设备转换坐标系"用户QUOT;坐标系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是类似<一个href=\"http://stackoverflow.com/questions/10762133/changing-sensor-coordinate-system-in-android\">Changing传感器坐标系中的Andr​​oid

我希望能够不管设备方向的相互比较用户的动作。这样,当用户持有出电话在纵向和弯曲他的手臂,加速度读数是相同的时,他保持了他在横向电话作为然后弯曲他的在相同的方向臂

I want to be able to compare a user's movements with each other regardless of device orientation. So that when the users holds out the phone in portrait orientation and bends his arm, acceleration readings are the same as when he holds out his phone in landscape and then bends his arm in the same direction.

这就是我所说的用户坐标系。这是来自世界不同的坐标系,因为它不应该的问题,用户面临着什么风向。它是从设备坐标不同,因为它不应该不管用户如何保持自己的设备。

This is what I call the "user" coordinate system. It is different from the world coordinate system since it should not matter what wind direction the user is facing. It is different from device coordinates since it should not matter how the user holds his device.

这是我的应用程序做的每一个动作之前校准步骤,因此基本/休息取向矩阵可确定可以接受的。难道或许只是第一乐章的矩阵与第二的倒数乘以的问题(用新的值,然后?)

It is acceptable in my application to do a calibration step before each movement so the base/resting orientation matrices can be determined. Is it perhaps just a matter of multiplying the matrix of the first movement with the inverse of the second (and then with the new values?)

中提到的问题的答案似乎正确的,但我需要一个更具体的说明,实际code样品将是理想的。

The answer in the question mentioned seems about right, but I need a more concrete explanation, actual code samples would be ideal.

请注意remapCoordinateSystem是不够的,它只接受直角。我需要能够具有较小偏差的工作,因为该设备绑在手腕,这可能并不总是在与手臂成直角。

Note remapCoordinateSystem won't suffice, it only accepts right angles. I need to be able to work with small deviations since the device is strapped to a wrist, which might not always be at right angles with the arm.

推荐答案

我目前正在对这个问题,我想这可能帮助:
<一href=\"http://stackoverflow.com/questions/11578636/acceleration-from-devices-coordinate-system-into-absolute-coordinate-system\">convert设备坐标体系,以国际corrdinate系统

I'm currently working on this issue, and I think this might help: convert device coordinate system to world corrdinate system

我们可以假定为大部分的时候,人们使用手机站立或行走或坐在,这意味着该用户坐标系统共享相同的z轴(重力),而在程度y轴之间的固定差(用户坐标,用户的脸的前方)和Y轴(世界坐标,北方向)。度的差异可以通过获得 TYPE_MAGNETIC_FIELD传感器。因此,我们可以从世界坐标变换为用户坐标。

We can assume that for the most of the time, people use the phone standing or walking or sitting, which means the user coordinate system share the same z-axis(gravity), and a fixed difference in degree between y-axis (user coordinate, front of user's face) and y-axis(world coordinate, north direction). The difference of degree can be obtained via TYPE_MAGNETIC_FIELD sensor. Thus we can transform from world coordinate to user coordinate.

什么是关于使用手机躺在病床上的用户?我认为对于那种情况下,一个$ P $对 - 校准是通过定义用户y轴坐标,像一个运动需要告知电话哪个方向是用户的脸的前方。

What's about the user using the phone lying on the bed? I think for that kind of case, a pre-calibration is need by define y-axis of user coordinate, like a movement to tell the phone which direction is the front of user's face.

这篇关于Android的设备转换坐标系&QUOT;用户QUOT;坐标系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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