如何将运动传感器数据从 iPhone 转换为 Android?
我有一些用 iPhone 录制的运动传感器样本。 现在我要计算用户手势与 Iphone 上记录的手势之间的距离。
我的问题是,iPhone 上的传感器数据的表示方式与 Android 传感器数据的表示方式不同。如果我不移动 Iphone,我会得到 -1 到 1 之间的数据;如果我不移动 Android 设备,我会得到 9 左右的值,因为传感器测量重力。
我不知道如何转换 Iphone 传感器读数以将它们与我的 Android 传感器读数进行比较。 Android 运动传感器数据在此处进行了解释。 Iphone 文档包含此 pdf。
I have some motion sensor samples that were recorded with an Iphone.
Now I'm into calculating a distance between a user gesture and the gesture that was recorded on the Iphone.
My problem is that the sensor data on the Iphone is represented in a different way then the android sensor data. If i don't move the Iphone I get data between -1 and 1 if I don't move my Android device I get values around 9 because the sensor measures the force of gravity.
I couldn't figure out how to convert the Iphone sensor reading to compare them to my android sensor readings. The android motion sensor data is explained here. And the Iphone documentation contains this pdf.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在将 iPhone 应用程序移植到 Android 时发现了同样的问题。我找到了一个解决方案。这对我的应用程序有用。
https://discussions.apple.com/thread/1743220?start= 0&tstart=0
http://developer.android.com/reference/android/ hardware/Sensor.html#getMaximumRange()
现在我进行简单的计算,如下所示
从传感器获取最大值
I found same problem while porting iPhone application in Android. I found one solution. It's work for my application.
https://discussions.apple.com/thread/1743220?start=0&tstart=0
http://developer.android.com/reference/android/hardware/Sensor.html#getMaximumRange()
Now I put simple calculation like following
Get Max value from Sensor