سؤال

باستخدام خاصية RotationRate للحركة الأساسية أو الجيروسكوب هل من الممكن استخراج مقدار الرضيات (أو الدرجات إذا كنت تحب) الجهاز استدارة؟

حاولت القيام بأخذ عينات من بيانات الحركة الأساسية، على سبيل المثال، أخذ عينات منه 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