Вы находитесь на странице: 1из 29

X/Y /Z/PITCH /ROLL /YAW

Getting you started with CoreMotion

AGENDA
Intro Concept APIs Experiments

INTRODUCTION

CORE MOTION WILL

Provide Provide Provide

raw Accelerometer & Gyroscope data relatively High-Level ltering separated Acceleration, Gravity, Rotation Rate, Attitude

CORE MOTION WONT

Give Give

you GPS Data you Compass Data easy management of high-level Motion Events

Allow

CONCEPTS

ACCELERO METER
Measures 3-Axis-Gravity Available since iPhone 1 Relatively noisy

STMicro STM33DH 3-axis accelerometer

GYROSCOPE
Measures 3-Axis-Rotation New in iPhone 4 Relatively precise

STMicro AGD1 3-Axis-Gyroscope

Up to 2500 /s 0.03 /s

yaw

Z pitch X

roll Y

Accelerometer

Gyroscope

X/ Y/Z

Pitch/Roll/Yaw

Device Motion
Acceleration / Gravity Rotation Rate / Attitude

CREATIVE USES
Steering Water Photo

wheel Real Racing

level iHandy Level, etc. stabilisation camera+, etc. dynamics GarageBand

Instrument Can

you think of something new?

API

CMMotionManager
- start, stop

CMLogItem
- timestamp

CMDeviceMotion
- accel, gravity, rotationRate

CMGyroData
- pitch, roll, yaw

CMAccelerometerData - x, y, z

CMAttitude
- pitch, roll, yaw

CMMotionManager
- is<Accelerometer|DeviceMotion|Gyro>Available - is<>Active - set<>UpdateInterval - start<>UpdatesToQueue:WithHandler: - stop<>Updates

CMMotionManager II

Needs Make

to be allocated & initialized only once

it a (nonatomic, retain)-property frame for attitude is xed at initialization time!

Reference

CMLogItem

Abstract Only

superclass

contains -timestamp property

CMAccelerometer Data
Z X
typedef struct { double x; double y; double z; } CMAcceleration;

Measured in G

CMGyroData
yaw pitch

roll

You arent going to need it


Measured in radian

CMDeviceMotion

CMAttitude

attitude rotationRate gravity userAcceleration

CMRotationRate CMAcceleration CMAcceleration

CMAttitude

Yaw, Pitch, Roll Also

as Rotation Matrix!

CANT TEST ON SIMULATOR


You

will need an actual iPhone 4 could read the Macs Accelerometer and send it to the iPhone via network for usability tests youd still need an iPhone!

One

But

EXPERIMENT

DEMO

THANK YOU!

SOURCES
Core Get

Motion Framework Reference Apple Inc. Moving with Core Motion Jonathan Blocksom Gyroscope X-Ray / SEM pictures Chipworks Inc. 4 Teardown pictures CC BY-NC-SA: Andrew Bookholt 4 Gyroscope Datasheet ST Mikro Inc.

/SYSTEM/LIBRARY/FRAMEWORKS/COREMOTION.FRAMEWORK

HTTP://WWW.SLIDESHARE.NET/JBLOCKSOM/CORE-MOTION-PRESENTATION

MEMS iPhone iPhone

HTTP://WWW.CHIPWORKS.COM/

HTTP://WWW.IFIXIT.COM/TEARDOWN/IPHONE-4-GYROSCOPE-TEARDOWN/3156/1

HTTP://WWW.ST.COM/STONLINE/PRODUCTS/LITERATURE/DS/17116.PDF

FURTHER READING

Core Event

Motion Framework Reference Handling Guide for iOS 10 Sample Code

IOS DEVELOPER LIBRARY FRAMEWORKS CORE SERVICES LAYER COREMOTION

MOTION EVENTS SECTION CORE MOTION

WWDC

COREMOTIONTEAPOT

les.ludwigschubert.de/cm.pdf

Вам также может понравиться