Questions tagged [devicemotion]

72 questions
1
vote
1 answer

Trying to run a HTML5 accelerometer listener in the background on mobile

I'm currently in the process of creating a webapp that detects whether the user is sitting or standing. I have had great success with detecting the tilt of the device, changing a boolean variable and sending the correct data to a graph. The…
1
vote
1 answer

device motion events not firing in tab opened from cross origin iframe chrome 62

Since Chrome 62 (on Android) I'm having issues with devicemotion events not being accessible inside cross-origin iframes. To cope with this, without resorting to using postMessage to pass the devicemotion events along to the iframe, I open a new tab…
Jesper
  • 91
  • 7
1
vote
1 answer

Apple Watch and Swift crashes while calculating the device motion with CoreMotion

Currently using the Apple Watch to calculate its yaw, pitch, and roll angles. However when trying to use the Core Motion functions, the app crashes. Has anyone experienced this problem? if motionManager.deviceMotionAvailable{ …
Kehlin Swain
  • 481
  • 1
  • 4
  • 13
1
vote
1 answer

devicemotion event on edge browser

I am trying to get rotationrate from the devicemotion event of HTML5 spec I am able to retrieve the value on chrome and iOS. However the value seems to be null on edge browser. Am I doing something wrong - My code is as follows…
Pavan K
  • 4,085
  • 8
  • 41
  • 72
1
vote
0 answers

Using CMDeviceMotion to get total angle rotated

I am trying to create an app that can calculate the number of times a phone is spun on a finger like a basketball. I have been using DeviceMotion to get the attitude, and I manipulated the data so instead of it going from 1 to 179 then back on the…
1
vote
0 answers

where are the actual facts re html5 devicemotion and deviceorientation available?

I've been measuring and graphing deviceorientation and devicemotion on Firefox and Chrome on my Samsung SIII and Safari on an iPhone 6. So far, I see: using accelerationIncludingGravity with eqns 28 and 29 from Freescale Semiconductor's…
1
vote
1 answer

Objective C / iOS Update Interval Issues Using Device Motion Manager

Code is working to get motion and gyro updates, put into arrays respectively and select the max value in the array if a capture event occurs. Everything works if the device motion updates are set to .02 or .03; however, I am getting additional…
dkwill
  • 11
  • 2
1
vote
1 answer

How can I ignore deceleration from event.acceleration in JS?

I'm trying to have an event occur when the phone first starts moving. This triggers just fine. However, I am running into a problem: deceleration is measured similarly to acceleration. When I stop moving the device, I see another spike. Any…
user2643767
  • 53
  • 1
  • 3
0
votes
0 answers

Phone device inclination using Euler angles

I am trying to track the inclination of a phone device during motorcycle rides. As I am using Expo, I use the library expo-sensors and DeviceMotion. From DeviceMotion I get rotation as Euler angles which contains alpha, beta and gamma, as rotation…
michjea
  • 95
  • 6
0
votes
0 answers

Apple Watch IMU Data stops logging on wrist down

We’re developing a watchOS app to log IMU and audio data concurrently. IMU data is logged using a CMMotionManager object, while audio is recorded using an AVAudioSession. Both of these are stored on-device, and transferred to a paired iPhone once…
0
votes
0 answers

How to monitor the movement of the mobile phone ? (React Native or Js)

When the user starts his mobile phone at a certain point as the starting position, how can i get the trajectory of the mobile phone movement? The function I expected to implement is: users can use his mobile phone as a brush. I am using React Native…
0
votes
0 answers

Calculate real world position change of device from deviceorientation and devicemotion

Can anyone help me how to calculate the real world device position change from deviceorientation and devicemotion readings? What I'm actually trying to do is to update a three.js PerspectiveCamera position and rotation, assuming [0, 0, 0] as the…
0
votes
0 answers

Three JS device motion glitch

I'm trying to get into WebXR programming. I'm trying to make a simple wrapper which allows for a VR headset and also a Google Cardboard style for smartphones. I got the VR headset working good so far, but I have two issues when using the…
0
votes
1 answer

window DeviceMotion event using React

I'm not able to trigger the DeviceMotion function in React app when I move my browser. I'm using window object devicemotion event to achieve the functionality. Excerpt from my code export default function App() { const [x, setX] = useState(""); …
coderpc
  • 4,119
  • 6
  • 51
  • 93
0
votes
1 answer

Change background image in mobile when device motion is changed

I am trying to change the background image when mobile device motion is changed (Like you make the device top, left or right, or up-down motion). i am using this code, issue is its start working immediately, even I don't change the motion of device…
DeDevelopers
  • 581
  • 1
  • 7
  • 25