core-motion

CMMotionManager is a global resource? What does this means?

你。 提交于 2019-12-11 09:45:23
问题 I am trying to initialize the CMMotionManager so start updates and create a reference attitude matrix, and then when i click a button trough the storyboard, i display a different screen (which is in a viewcontroller) and i want to use the reference attitude matrix and other readings from the motion manager but if I do a simple check to see if its ready it says it isnt (even thought it was ready on the previous screen). So I was researching a little bit and i came across some standford notes

Calculate Acceleration (Driving a Car)

≯℡__Kan透↙ 提交于 2019-12-11 01:27:49
问题 I am trying to replicate the acceleration calculation like the application "Dynolicious" but I'm not sure where to head to calculate this. Do I use Core Motion or do I do calculations using other numbers? I have tried using Core Motion 's userAcceleraion value, but it is not coming out at all like what I'm looking for. coreMotion = [[CMMotionManager alloc]init]; [coreMotion startDeviceMotionUpdates]; //then every second it updates my label... NSString *accel = [NSString stringWithFormat:@"%f"

Which iOS devices support CMStepCounter?

女生的网名这么多〃 提交于 2019-12-11 01:08:29
问题 Apple added step count support with the M7 in the new iPhone 5s. This is the documentation on isStepCountingAvailable isStepCountingAvailable Returns a Boolean indicating whether step-counting support is available on the current device. (BOOL)isStepCountingAvailable Return Value YES if step-counting support is available or NO if it is not. Discussion Step-counting support is not available on all iOS devices. Use this method to determine if support is available on the current device.

watchOS2 - CMSensorRecorder

血红的双手。 提交于 2019-12-10 10:08:27
问题 I want to use the historical accelerometer data from the Apple Watch and my accDataList is always nil. I instantiated CMSensorRecorder in the init function of the class. Does someone had this problem before? func startMovementDetection(){ self.cmSensorRecorder?.recordAccelerometerFor(self.recorderDuration) self.startDate = NSDate() } func extractHistoricalAccelerometerData(){ var accDataList = self.cmSensorRecorder!.accelerometerDataFrom(self.startDate, to: NSDate()) NSLog("AccDataList : \

Swift 3.0 how to use startDeviceMotionUpdates(to: withHandler)?

本小妞迷上赌 提交于 2019-12-10 09:27:28
问题 Swift 3.0 was released alongside Xcode 8.0 and apparently a lot has changed. I'm very unfamiliar with the new syntax in swift. Can someone help me out? I'm trying to figure out what goes in motionManager.startDeviceMotionUpdates( to: OperationQueue.current()!, withHandler: ) after the "withHandler:" I am trying to get my SceneKit program be able to utilize the accelerometer to determine the orientation of an SCNNode platform. I am also fairly new to swift (about 5 days into programming in

Calculating Lean Angle with Core Motion

ε祈祈猫儿з 提交于 2019-12-09 12:50:31
问题 I have a record session for my application. When user started a record session I start collecting data from device's CMMotionManager object and store them on CoreData to process and present later. The data I'm collecting includes gps data, accelerometer data and gyro data. The frequency of data is 10Hz. Currently I'm struggling to calculate the lean angle of device with motion data. It is possible to calculate which side of device is land by using gravity data but I want to calculate right or

CMMotionActivityManager ignores cycling

感情迁移 提交于 2019-12-09 05:47:58
问题 I've been researching the new M7 chip's CMMotionActivityManager , for determining whether the user of the device is walking, running, in a car, etc (see Apple Documentation). This seemed like a great step forward over trying to determine this previous from using LocationManager and accelerometer data only. I notice however that CMMotionActivityManager does not have a cycling activity, which is disappointing, and almost a deal-breaker for complete usage as a new activity manager. Has anyone

CoreMotion Bump vs. Shake on iPhone

你离开我真会死。 提交于 2019-12-08 19:47:38
问题 I am trying to detect when a user bumps their iPhone on another object versus when they just shake their phone. I can't seem to get it to work perfectly as I want it, because it either registers too many bumps, no bumps, or thinks a shake is a bump. Can someone look at my code below and offer suggestions? I need to be sure one or the other happens. // SHAKING - (void) motionEnded: (UIEventSubtype) motion withEvent:(UIEvent *)event { if (motion == UIEventSubtypeMotionShake) { [self

iDevice attitude: stabilising quaternion

大憨熊 提交于 2019-12-08 12:54:55
问题 I'm trying to use iDevice's attitude self.motionManager.deviceMotion.attitude.quaternion the device is resting on the table, but the values are not the same. how to stabilise these values without causing bad rotation? I'm using the device attitude to rotate the camera node. (x = -0.0055437298906573507, y = -0.0078092851375721247, z = -0.041180405121897398, w = 0.999105828407855) (x = -0.0061666945840810842, y = -0.0067849414785486747, z = -0.041464744435584115, w = 0.99909789881469635) (x =

CMMotionActivityManager isActivityAvailable devices

混江龙づ霸主 提交于 2019-12-08 11:10:41
问题 I want to use CMMotionActivityManager , I would like to know what devices motion data is available on? Many of the places that i have read suggest that it is currently only on devices that have the M7 chip. https://developer.apple.com/library/ios/documentation/CoreMotion/Reference/CMMotionActivityManager_class/Reference/Reference.html#//apple_ref/occ/cl/CMMotionActivityManager 回答1: isActivityAvailable will return true on the M7 equipped devices: iPhone5S iPad mini with retina iPad Air Apple