문제

코어 동작 또는 자이로 스코프의 회전 레이트 속성 만 사용하는 것은 장치가 회전 된 라디안 (또는 당신이 원하는 경우)의 얼마나 많은 라디안 (또는 각도)을 추출 할 수 있습니까?

코어 모션 데이터의 샘플을 샘플링하려고 시도 했으므로 초당 5 회 샘플링하여 각 읽기간에 0.2 초가 걸립니다.그런 다음 하나의 읽기에서 초당 0.5 라디안의 회전 분위기가있는 경우, 이론적으로 나는 이것을 5로 나눌 수 있고, 마지막으로 그 이후로 회전하는 장치의 많은 라디안을 알게 될 수있다.

이것은 논리적 인 것처럼 보이지만 결과는 현실과 아무 관련이 없습니다.장치를 90도 회전하면 장치가 그보다 100 배가 적어 졌음을 알려주는 결과를 생성합니다.

은 회전 레이트를보고 장치가 회전하는 양을 추출 할 수 있습니까?

누락 된

도움이 되었습니까?

해결책

Need more space than a comment ;-) iOS retrieves all data in radians and if your other calculations are correct, I thought it might be the angle measured in radians.

In general your approach seems to be alright: Take every signal's angle velocity, multiply it with time delta and you will have the angle delta for this timeframe. Then sum all your angles and the result should be the covered distance as angle in radians. Angle phi is the integral of angle velocity omega over the elapsed time and doing numerical integration with the trapezoidal rule (i.e. like described) is OK for gyroscope's data (not for accelerometer).

In general I would recommend to use the timestamp delivered by core motion instead of the defined period (1/5) as recommended by Apple, because device motion data is often delivered in a lower frequency than expected (see What is the official iPhone 4 maximum gyroscope data update frequency and or Push method for core motion and frequency of Accelerometer/Gyroscope Data.

Furthermore you should take a higher frequency to avoid errors in your numerical integration.

[Update from comments section:]

If your are interested in integrating via extended Simpson's Rule I recommend this paper (German only, p. 173 ff.) and An Extension to Newton-Cotes Formulae. Some sample code as extracted snippet taken from an existing project can be found here: DevicePosition.m Note that it might not compile, no warranty, as is, ... you know this from other sites ;-)

A free app displaying sensor input as graphs for iPhone: Sensor Monitor

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top