accelerometer

Movesense - Accelerometer Sampling Rate change fails

风流意气都作罢 提交于 2019-12-24 09:31:31
问题 I am unable to change the Accelerometers sampling rate using the mobile API: I am subscribing using these commands: String strContract = sb.append("{\"Uri\": \"").append(connectedSerial).append(URI_MEAS_ACC_26).append("\"}").toString(); Log.d(LOG_TAG, "subscribeToSensor 1" + strContract); subscribedDeviceSerial = connectedSerial; mdsSubscription = mMds.builder().build(this).subscribe(URI_EVENTLISTENER, strContract, new MdsNotificationListener() { I have tried these strings: static private

Accelerometer Low Pass Filter Smoothing

天大地大妈咪最大 提交于 2019-12-24 06:38:01
问题 I am using the device accelerometer and try to smooth the Accelerometer Data CMAcceleration . I am doing this with help of this code: -(void)proccessAccelerometerData:(CMAcceleration)accelData { currentAccelX = (kUpdateInterval * accelData.x) + ((1.0 - kUpdateInterval) * currentAccelX); currentAccelY = (kUpdateInterval * accelData.y) + ((1.0 - kUpdateInterval) * currentAccelY); } Which currentAccelX and currentAccelY is the last accelerometer x and y data. Now, I have the smooth x and y

Irregular timestamp in CMMotionManager

风格不统一 提交于 2019-12-24 01:59:31
问题 Researched this a lot for the past week but could not find a similar issue. I am collecting accelerometer data on the Apple Watch and looking at the timestamp outputted by the the DeviceMotion class which presents an issue. The timestamps do not always go in chronoligcal order. For example, if I collect a few minutes of motion data at 100Hz, I get the following timestamps from a CSV file I generate in the same app (these are UTC timestamps): 1531099702.768570 1531099702.778460 1531099702

Android: Alternative to onSensorChanged? no ACCELEROMETER data when phone is lying on its back on a table( when no movement)

点点圈 提交于 2019-12-24 01:01:51
问题 So I'm using this code to get the Accelerometer data. When I am in the DDMS mode to check what my print statement is printing, I noticed that nothing is printed when the phone does not move. ie. its on the table. I think the reason is that onSensorChanged is not called when the phone does not move, and then its called when the phone starts moving again. If i want to capture data regardless of whether the phone is moving or not, should I use some other function? Any Alternatives? or Any

Track Accelerometer under lock screen

孤街浪徒 提交于 2019-12-23 13:34:32
问题 Is it possible to track the accelerometer value while under the lock screen? I managed to write a simple application which counts from 1 up to 100 using a timer which fires an event on which I increment a counter. But when I use register a handler for the ReadingChanged event of the accelerometer it will not be fired anymore once the screen has been locked. Even if I unlock the screen again I will have to readd my handler. 回答1: the msdn documentation tells on the one page: http://msdn

How to read accelerometer data in Service with Android

為{幸葍}努か 提交于 2019-12-23 11:52:53
问题 Usually, in Android, we read the accelerometer data in an "Activity", by overriding the OnSensorChanged function. I am curious how we can do it in a "Service". Thanks, Vincent 回答1: Actually OnSensorChanged(SensorEvent event) is method from interface SensorEventListener. So if you want to do it in service; you make your new class that extends Service and implements SensorEventListener . 回答2: You can do exactly the same in a Service as well. public class BGHndlr extends Handler implements

How to interpret the accelerometer readings from iPhone

主宰稳场 提交于 2019-12-23 09:32:35
问题 I am trying to build a Kinect and iPhone based application. I am trying to compute the acceleration of my hands over time on each of the X Y and Z axis based on the trajectory returned by the kinect. Basically I am selecting a standard time interval of 0.5 seconds or 15 frames( dt ) and 3 points, ( x0 , x1 and x2 ) over time which are separeted by 0.5 seconds. First I should mention that the position of the 3 points is mentioned in meters. By using these points I am computing two speeds( v0 =

Count Steps using accelometer in android [duplicate]

北慕城南 提交于 2019-12-23 04:19:07
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How to Count the Number of Steps Using the Accelerometer Are there any well known algorithms to count steps based on the accelerometer? Hi i have developed android application. In one module I have to create a pedometer. Now at this stage I have to count the steps user walked by using accelormeter. I have search on internet and found different methods but none of that working. I have tried this Does anyone have

How to detect that the phone (WP7) has stopped shaking

血红的双手。 提交于 2019-12-23 03:34:11
问题 I can get the phone to react to a shake, but what is the best way to tell that it has stopped shaking? 回答1: This example worked for me. At the very bottom of the page you'll see: if (!_shaking && CheckForShake(_lastReading, reading, ShakeThreshold) && _shakeCount >= 1) { //We are shaking _shaking = true; _shakeCount = 0; OnShakeDetected(); } else if (CheckForShake(_lastReading, reading, ShakeThreshold)) { _shakeCount++; } else if (!CheckForShake(_lastReading, reading, 0.2)) { _shakeCount = 0;

How to convert a 3D acceleration into a rotation?

岁酱吖の 提交于 2019-12-23 03:27:08
问题 I have a program which utilizes an accelerometer in the Windows Phone 7, and I need to detect what the rotation of the device is. I have X, Y, Z accelerations, and need to somehow figure out the orientation of the phone based off of that. How can this be accomplished? (Rotation values should be in Degrees) 回答1: Although I am working on iPhone it should basically the same problem. Your hardware needs a gyroscope sensor to describe rotations, especially those in parallel to gravity (let's call