accelerometer

CMDeviceMotion userAcceleration is upside down?

[亡魂溺海] 提交于 2019-12-04 10:47:24
I'm seeing some unexpected readings from the userAcceleration field in CMDeviceMotion. When I look at the raw accelerometer data from CMAccelerometerData, I see that if the iPhone is flat on a table the reading is 1G straight down (1G in -Z axis) and if I drop the iphone (on a soft surface of course) then the acceleromtere reading goes to zero as expected. That's all fine. When I instead use the CMDeviceMotion class, the userAcceleration reading is zero as expected when the iPhone is flat on table. Again this is fine. But when I drop the iPhone and read the CMDeviceManager userAcceleration,

Detecting device orientation

风格不统一 提交于 2019-12-04 07:05:45
I need to detect android device orientation change without playing manually with sensor data, while keeping activity orientation stick to some orientation onConfigurationChange will not work as will stick my activity to not rotate. Playing around with sensor data to detect the orientation change I consider that as an invention of wheel, as android already does have embedded implementation of the algorithm to detect device orientation change. And from another side the detection of orientation change is not a simple checks like this. public void onSensorChanged(SensorEvent event) { if (event

How to send fake Accelerometer values to an app on a real device?

社会主义新天地 提交于 2019-12-04 06:48:54
For example, Location Spoofer gives out a fake location by using the Access Mock Location permission and I can make my device send out a signal that it's present in any place that I desire. In the same way, can I fake the Accelerometer data to mock the various situations that a user can be in? Thanks in advance. Aman Gautam You can use SensorSimulator to simulate acceleration in your android device or emulator ( download link ). Andrei Golubev As i answered in this question: Simulate accelerometer values on a real device You can send the values you want directly from your app, but i am not

How to use accelerometer for paint on a screen in iphone? [closed]

好久不见. 提交于 2019-12-04 06:12:33
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I am new in iPhone development, I am developing an app in which I have to use accelerometer for painting on screen . Please help me out is this can be done-able if so help me. 回答1: You are looking for the gyro

Delay in yaw, pitch and roll values

ε祈祈猫儿з 提交于 2019-12-04 05:41:39
问题 I am developing an application in windows phone 7.1 which I require the current degree rotation of the phone in x and y axis. I tried using the motion API and use the appropriate values from yaw pitch and roll it provides. But the values it provide are delayed in the sense that if I move the phone too fast and rotate it to 90 degrees the corresponding value takes a little time to reach there, which defeats my purpose. I have done the same thing in Android where I am able to use something

GPS V.S. accelerometer to calculate distance

故事扮演 提交于 2019-12-04 03:13:22
I am trying to implement a fitness app that can keep track of the running speed and running distance in Android. It looks like I can either use GPS or Accelerometer to calculate these information. Since a runner may put his phone in hand, on the shoulder or in his pocket, my first intuition is to use GPS to get locations and calculate running speed and running distance. But recently someone telled me that I can also use Accelerometer also does that. My question is: In Android, which approach is better to calculate running speed and running distance, GPS or Accelerometer? I suspect that

Step Counter in Android: always on?

白昼怎懂夜的黑 提交于 2019-12-04 02:54:07
问题 It is a well known issue that many Android phones switch off the accelerometer when the screen goes off. However something seems to have changed with Android Fit (the app). Fit keeps counting steps even when the screen goes off. If Fit is installed, then events are raised for step counting within the Fit environment and I am able to capture them using Fitness.SensorsApi.findDataSources(mClient, new DataSourcesRequest.Builder() .setDataTypes(DataType.TYPE_STEP_COUNT_CUMULATIVE) I have tested

FFT and accelerometer data: why am I getting this output?

给你一囗甜甜゛ 提交于 2019-12-04 02:27:31
问题 I have read various posts here at StackOverflow regarding the execution of FFT on accelerometer data, but none of them helped me understand my problem. I am executing this FFT implementation on my accelerometer data array in the following way: int length = data.size(); double[] re = new double[256]; double[] im = new double[256]; for (int i = 0; i < length; i++) { input[i] = data[i]; } FFT fft = new FFT(256); fft.fft(re, im); float outputData[] = new float[256]; for (int i = 0; i < 128; i++)

Accelerometer API for Laptops

你。 提交于 2019-12-04 01:20:55
Most IBM (and some Dell) laptops have built-in accelerometers to stop any moving parts during a sudden fall, but I was unable to find a standardised Windows API to access this data. I assume that each manufacturer would provide a driver to interface with the sensor. Which popular laptop brands come standard with accelerometers accessible from an API and which libraries should I use to access the data? Does an API* exist to abstract away the differences between different manufacturers? I am aware of the Windows 7 Sensor API, but I would like support for XP and earlier. Most reputable notebook

Calculate Jerk and Jounce from iPhone accelerometer data

僤鯓⒐⒋嵵緔 提交于 2019-12-03 21:43:42
I am trying to calculate Jerk ( http://en.wikipedia.org/wiki/Jerk_(physics) ) and jounce ( http://en.wikipedia.org/wiki/Jounce ) with the acceleration data from the accelerometer. I think I have Jerk figured out, but I am not sure what I am doing for jounce is correct. Can anyone confirm or deny what I am doing is giving me correct values (Do I need to take into consideration time?) #define kFilteringFactor 0.4 float prevAccelerationX; float prevAccelerationY; float prevAccelerationZ; float prevJerkX; float prevJerkY; float prevJerkZ; - (void)viewDidLoad { [super viewDidLoad];