Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
20 views

How to turn a read only excel file to Read/write using VB within CMM mananger

I'm trying to make a read-only Excel file from the engineering department automatically convert to a read/write after or before I've re-named and saved the new file. "Blankfile" is the read ...
Josh briggs's user avatar
0 votes
0 answers
43 views

How can apps like Autosleep get days of historical motion sensor data?

I want to replicate some of the functionalities of sleeptrakcing apps like AutoSleep. Apparently I can not open the app for a day or two, and when I open it up, it can accurately access the sensor ...
x35cvrr2's user avatar
0 votes
1 answer
68 views

how to plot forward/backward tilt on y axis?

I have a line (UIView with width = screen width and height = 2), I need to move this line up and down the screen with forward tilt and backward tilt. I know I need to use Gyroscope, how can I achieve ...
nitpaxy's user avatar
  • 67
0 votes
1 answer
262 views

How to mock CMMotionManager for Unit test

My codebase is using device motion data for perticular functionality. I want to unit test it. For that I need to mock CMMotionManager so that data can be manipulated and test cases can be executed ...
T.Ratzz's user avatar
  • 81
2 votes
1 answer
206 views

How can I pass Binding<CMMotionManager> in SwiftUI preview?

I passed the motionManager of my app from ContentView to SecondView and it works fine, but i don't know how to pass it in the preview of my SecondView, it wants argument type Binding<...
jooh's user avatar
  • 125
1 vote
0 answers
113 views

CMMotionActivity Battery Consumption

I'm developing an app where I need to detect motion activity changes with accuracy. I'm thinking of two approaches: Keep the CMMotionActivity active all the time; Start/Stop the CMMotionActivity in ...
Daantunes's user avatar
0 votes
0 answers
233 views

Is it possible to detect user's activity/motion on a web app?

I am making a fitness-related web app and want the ability to detect various activities like cycling, running, walking, etc via a browser on a mobile device. I understand there are CMMotionActivity ...
Hussain Murani's user avatar
0 votes
1 answer
146 views

How raw is iOS accelerometry data retrieved through `CMMotionManager`?

Accelerometry data including gravity can be retrieved both on Android and iOS phones: On iOS raw accelerometry data can be retrieved through CMMotionManager. On Android two different types of data ...
Steven Jeuris's user avatar
0 votes
1 answer
127 views

Some questions about using CMMotion in swiftUI

I want to write a code to retrieve Iphone motion data in Swift's MVVM mode, but I get an error in line 15 of my Model file: Escaping closure captures mutating 'self' parameter << import ...
user16853395's user avatar
0 votes
1 answer
161 views

Accelerations to Velocity in iOS - wrong sign

I am currently developing an App which should calculate the speed by the accelerations of the device. To achieve this I am using Sensing Kit. The app records data of the users motion and saves it to ...
CodeRaider's user avatar
2 votes
0 answers
321 views

How to get motion updates from CMMotionManager in the background ios 13 swift

I am trying to get background motion updates but as soon as the application goes in background, the motion stops updating. I tried using background mode with audio enabled but got nothing. Any help ...
CrazySports101's user avatar
0 votes
0 answers
102 views

Pass iOS CMDeviceMotion to THREE.js to Rotate Spherical Panorama

I need to pass iOS app motion data to my WKWebView that loads a spherical panorama using THREE.js. The THREE.js relies on Quaternion calculated from alpha, beta, gamma, but since CMDeviceMotion on iOS ...
Vad's user avatar
  • 3,730
1 vote
0 answers
374 views

How to know device is tilting to left/right/backward or front using CMMotionManager

I need to identify which way iOS device is tilting, left, right, forward, backward. I am trying to identify this with below code but not working. self.motionManager.isDeviceMotionAvailable { ...
Sekhar Bhetalam's user avatar
-1 votes
1 answer
52 views

Swift: Constrain object to and point within a circular NSLayoutConstraint? Circle anchor?

Within a view controller, I have a UIView (backgroundCircle) and a UILabel. The UILabel is moving based on motionManager.startAccelerometerUpdates data. Using this data, I am animating the label....
nicksarno's user avatar
  • 4,165
0 votes
1 answer
96 views

CMMotionActivityManager suddenly not recognizing motion correct anymore

I'm using the CMMotionActivityManager to get updates of motions. This tracking worked fine until later today when the motion sensor started recognizing walking as cycling. I've changed nothing in my ...
Christian's user avatar
  • 22.3k
0 votes
0 answers
181 views

How does CMMotionActivity startDate swift work?

So I'm developing in swift and trying to find out the duration of a device being stationary. I ran into startDate function and trying to print it but it gives the time and date which is 5 hours later. ...
Negar Bean's user avatar
0 votes
1 answer
813 views

iOS 12.2 : CMMotionManager is blocking the main thread

I have an issue with CoreMotion and the following code : let motionManager = CMMotionManager() It blocks my Mainthread for 4-5 seconds and I don't know why. The problem appears when I updated my ...
Jordane H's user avatar
1 vote
0 answers
177 views

Ios magnetometer wrong values

I am writing code to detect magnet. I am doing this through this code: let manager = CMMotionManager() if manager.isMagnetometerAvailable { manager.startMagnetometerUpdates(to: OperationQueue.main) {...
Salman Khalid's user avatar
0 votes
1 answer
197 views

How can I add ParallaxEffect without UIInterpolatingMotionEffect class

how can i do a parallaxeffect without the UIInterpolatingMotionEffect class. Only with the Acceleration in the iPhone? I want the Effect when you tilt your phone up that the image goes up to. Just ...
SwiftiSwift's user avatar
  • 8,386
0 votes
1 answer
154 views

Is it possible to get the hardware details of a given sensor in iOS like android?

Hello All, I am creating an iOS application which uses the accelerometer sensor. I am able to get the sensor data using CMMotionManager. I also want to get the sensor's hardware details like Sensor ...
Vinoth ios's user avatar
0 votes
1 answer
1k views

CMMotionActivity detailing automotive to distinguish between car and train

I'm using CMMotionActivity and trying to distinguish between car, train and bus when the framework return automotive type. This is not possible only using CoreMotion, so I think it's necessary to use ...
Fry's user avatar
  • 6,277
0 votes
1 answer
742 views

Swift CoreMotion background saving battery

I need to get users activity on background using Core Motion. I was able to reach this goal by adding the locations update as background mode and enable the background location fetch. But as I'm not ...
MarcoCarnevali's user avatar
0 votes
0 answers
316 views

startAccelerometerUpdates in Swift [duplicate]

I found on an online tutorial this code: let manager = CMMotionManager() manager.startAccelerometerUpdatesToQueue(NSOperationQueue.mainQueue()) { (data, error) in } The guy in the ...
Niccolò Voltolini's user avatar
1 vote
0 answers
563 views

CMMotionActivityManager queryActivityStarting data is not accurate

I want to list my activity for the last 24 hours but some of data I receive is totally irrelevant. For example when I'm sleeping and phone is completely in stationary state, CMMotionActivityManager ...
Mehmet Kemal Bayer's user avatar
0 votes
0 answers
240 views

Calculating GForce when device is not completely level

Using iOS Core Motion I am reading the GForce applied to a device, however if the device is not completely level then the readings are not as accurate. Say I want the force applied on the Y axis but ...
Darren's user avatar
  • 10.2k
1 vote
1 answer
1k views

CMMotionManager Tilt To Move Node Left & Right Swift 4

I have a separate SKNode class called Balloon which is below. import Foundation import SpriteKit class Balloon: SKNode { init(image: SKSpriteNode) { super.init() let atlas = ...
Dewan's user avatar
  • 469
2 votes
0 answers
513 views

Get CMMotionActivityManager updated when app is terminated

Right now I'm developing an app that needs to know what the user is doing activity-wise (standing still, running, walking, ect.) all the time. I found that using CMMotionActivity might be a good way ...
Ryan Bradford's user avatar
1 vote
1 answer
548 views

How to retrieve a CMAccelerometerData exact timestamp

I've developed an iOS app that collects data from both the phone's accelerometer and gyroscope, and it should process some data and send it over to the cloud. The issue is that the ...
nivsto's user avatar
  • 21
1 vote
0 answers
315 views

How to get iPhones angle from Horizon?

I am currently working on an AR tracker for iOS. I have the horizontal tracking working fine but have run into an issue tracking the object vertically. When I get the devices orientation using ...
Jacob Bashista's user avatar
0 votes
1 answer
277 views

SpriteKit Accelerometer issues

I am making a game using sprite-kit. In my game I am using the accelerometer to move the node side to side by tilting the device. The following code works smoothly but after 8-10 game restarts, it ...
sicvayne's user avatar
  • 620
0 votes
1 answer
164 views

Weird accelerometer behaviour (CoreMotion)

I was trying to move the player in x-axis using the built-in accelerometer but something is wrong. When I simulate the app on my iPhone the node keeps moving in all directions and only after 2-3 times ...
mikro098's user avatar
  • 2,313
1 vote
0 answers
1k views

Swift: startDeviceMotionUpdates is not working

I'm using startDeviceMotionUpdates for my apple watch app, and it is not working. Following is my code: import WatchConnectivity import CoreMotion class ResultInterfaceController: ...
Aawara's user avatar
  • 331
1 vote
1 answer
357 views

Cannot get value from Accelerometer, Gyro and DeviceMotion

I'm making an app to track your sleep by getting any movement of the iPhone. I searched everywhere and there are many ways you can get data from this but non worked. Here's my code. func startManager(...
Booklailert's user avatar
1 vote
1 answer
315 views

Why did CMMotionManager update interval slow down in iOS 10

I am developing an app that requires high speed motion data (approximately 80hz). As of iOS 10 my app is reporting that motion data is coming in only at 67 Hz. In iOS 7 through 9 the same exact code ...
Brian Hayward's user avatar
1 vote
2 answers
403 views

Detect face up position with sensors in iOS

I want to detect face up position with sensor information. If position of the iPhone is face up, the button on the screen named as btnOpen should be seem, otherwise the button should be hidden. I'm ...
BadCode's user avatar
  • 141
4 votes
1 answer
577 views

Find the direction of motion?

I have an image(floor plan) where i pinned my current position. with CMPedometer I am able to find the number of steps moved but couldn't find the direction in which i am moving. if(CMPedometer....
Stephen's user avatar
  • 3,425
1 vote
0 answers
173 views

Live Rotation of SCNNode

I want my node to rotate on the Y axis while the camera is rotating. class ArtScene: SCNScene{ var image = UIImage() var geometry = SCNBox() var motion = MotionKit() var node = ...
John's user avatar
  • 819
0 votes
1 answer
71 views

Why is my player not moving in SpriteKit when tilting?

I am trying to using the option of tilting the screen to move my player. So i followed the instructions of Ray Wenderlich and his space invaders tutorial. I just can't seem to figure out why my player ...
kor123's user avatar
  • 33
2 votes
1 answer
97 views

Why is my player not moving (CMMotionManager) by Tilting the screen (SWIFT 3)?

I am trying to using the option of tilting the screen to move my player. However, i followed the instructions of Ray Wenderlich and his space invaders tutorial. I just can't seem to figure it out.. ...
kor123's user avatar
  • 33
0 votes
2 answers
926 views

How to reset pedometer to 0 in Swift? I am using CMPedometer()

I want to add a button in my app and reset the pedometer to 0 by pressing it. Now I just finish a common pedometer, my code is below: @IBOutlet weak var step: UILabel! var days:[String] = [] ...
cao xiangyu's user avatar
0 votes
1 answer
965 views

Location and accelerometer updates in the background under iOS 10

My app collects location and accelerometer information, and continues to do so in the background if the user requests it. The accelerometer information is collected at about 100 Hz, and it is critical ...
Mike's user avatar
  • 3,084
1 vote
2 answers
550 views

Why does CMMotionManager report incorrect yaw after stopping and restarting?

I'm using CMMotionManager to get device attitude, and running into a peculiar problem where it works perfectly the first time it's started, but after stopping and starting it gives doubled numbers for ...
Robert's user avatar
  • 6,760
1 vote
1 answer
260 views

CMMotionManager data 'Jumps' after iOS 10 update

I'm developing an app that uses CMMotionManager, and prior iOS 10, the data from manager was stable. After iOS 10 update it started 'jumping' (data for the moment t+1 is times bigger than data for ...
Max Adamyan's user avatar
1 vote
2 answers
2k views

Swift 2 to Swift 3.0 motionManager

I am converting an app from swift 2 to swift 3 and I'm trying to use the CMMotionManager, but it gives me this error when I try to call the .startAccelerometerUpdates() function... No clue what's ...
Jacob's user avatar
  • 31
4 votes
0 answers
331 views

How to reset `CMMontionManager`'s `attitude`

I want to reset CMMotionManager's attitude so the rotationMatrix points to the "front" (that is, the device rotation around the gravity axis it's at its default position). This is the behavior when ...
Ricardo Sanchez-Saez's user avatar
-1 votes
1 answer
90 views

Accelerometer not working when setting Player.physicsBody!.dynamic = false in swift

I am new in spritekit and trying to develop a game with Acceleromotion restricting the SKSpritNode going outide the screen.It is working fine when I set the Player.physicsBody!.dynamic = true but same ...
S. Gupta's user avatar
1 vote
2 answers
623 views

Correct CMMotionManager yaw for current UIInterfaceOrientation

I am using the CMMotionManger to get yaw readings with the following code. Regardless of the UIInterfaceOrientation, I am trying to get readings minus 1.5708 rad if yawed 90 degrees right, and ...
Jeshua Lacock's user avatar
5 votes
1 answer
2k views

motion manager not working

I'am trying to get the device motion (pitch,roll,yaw) but my function handleDeviceMotionUpdate isn't launched (I'am trying it on an iphone 5s) , here is the code : import UIKit import CoreMotion ...
Theilya's user avatar
  • 69
0 votes
0 answers
112 views

CMAltitude always returns as nil when run outside loop in swift

Recently I've been writing a game that requires the Pitch of the device in order to move the character. However, to make it so the user doesn't have to play the game with the device fixed in one ...
user3894191's user avatar
0 votes
2 answers
218 views

Declare property only on iOS

I am making a SpriteKit game for iOS, OSX, and tvOS. I am trying to use the accelerometer for my iOS target. I have the check for iOS on import of the CMMotionManager, but I can't seem to get the ...
Siriss's user avatar
  • 3,767