accelerometer

How do I control a camera in openGL with a gravity vector from the iPhone's accelerometer

I have a camera structure that holds location, up, and direction vectors. I'd like to update these vectors based on the gravity vector I get from the iPhone's accelerometer. The effect I'm going for is: when the top of the phone is tilted away from you, the camera looks towards the ground. In other words, the scene/geometry follows the o...

How to use Shake API in iPhone SDK 3.0?

Apple annonced Shake API in iPhone SDK 3.0. I can not find any information regarding this new feature. Who knows about how to use it? Any example, link will be good. ...

How to determine absolute orientation

I have a xyz accelerometer and magnetometer. Now I want to determine the orientation of the device using both. The problem I see is that depending on the device orientation, I'd need to use the sensors in different order. Let me give an example. If I have the device facing me then changes in both the roll and pitch can be determined wit...

Basic doubt about sensor usage

Suppose I have a cellphone with accelerometer and magnetometer, and want to determine its absolute (wrt North/East/South/West) 3d position. Imagine the phone is laid vertically, with the screen facing me, the "up" vector pointing to the ceil. Whenever I tilt, the accelerometer allows me to get the "up" vector info change. The problem is...

My Iphone App crashes (Bad access) when turned on it's side (landscape mode).

For some reason, every time I run my Iphone App, the App works fine as long as it is upright. The second the simulator turns to the left or right (like if I manually turn it, or if it's trying to play a video), the code crashes, with either a "Bad Access" or an exception. The crazy thing is that this stuff was JUST working, and I didn't...

Does anyone know a tutorial that teaches you to make a bobblehead?

I'm trying to make a bobble head app, but I don't know how to use the movement technology.. Any thoughts? Thanks ...

How do I calculate mouse movements using a 3 axis accelerometer

I have a 3 axis accelerometer(any mobile phone) but I can't find any good formulas to interpret the data that's coming from it. No matter what I do the movements are jerky/insensitive. I read that I also need Euler angle or Rotation Matrix? I will appreciate any good materials for reading... ...

BlackBerry Storm AccelerometerListener not being notified on first orientation change

This seems to be a well-known issue right now, but the accepted workaround doesn't seem to be working for us. On the BlackBerry Storm (JDE 4.7, standard set of 4.7+ simulators), the following bit of code registers an AccelerometerListener. The listener does not get called on the first change in device orientation, but does get called on...

Wireless protocol for accelerometer data

I'm building an application where a mobile phone with an accelerometer is used to control an app on a computer in a similar way you would use a mouse. So I need to send the movement from the phone to the computer over some wireless protocol. I am thinking about using Bluetooth but I am not sure what transfer delay to expect. Another poss...

How to distinguish movement accelerations from oscillations and noise in iphone

Hi everybody on stackoverflow. SHORT VERSION :) I need to use (x,y,z) acceleration values related only to the movement of the iPhone. Just to be clear, think an environment like a car. The iPhone's accelerometer is very sensitive. If I log acceleration values with a frequency of 100Hz, there are so many values related to noise, car vib...

Combine Gyroscope and Accelerometer Data

I am building a balancing robot using the Lego Mindstorm's NXT system. I am using two sensors from HiTechnic, the first being an Accelerometer and the second being a Gyroscope. I've successfully filtered out noise from both sensors and derived angles for both in a range between -90 and 90 degrees, with 0 degrees being perfectly balanced....

Android: Accelerometer false detection

I have a code snippet to detect accelerometer movements. It works some times by properly detecting slight movements, but sometimes it detects movements when I kept my device idle too. Are there any problems with built-in accelerometer detection on Android? I use an HTC G-1 device. My code snippet is below. How do I resolve it so I can d...

Filtering accelerometer data noise

Hi How do I filter noise of the accelerometer data in Android? I would like to create a high-pass filter for my sample data so that I could eliminate low frequency components and focus on the high frequency components. I have read that Kalman filter might be the best candidate for this, but how do I integrate or use this method in my ap...

Is there a 1-to-1 ratio of motionBegan and motionEnded events?

I'm implementing shake gestures as described in this answer however if I shake my phone for longer than a second, motionEnded doesn't get called. Is there not a 1-to-1 ratio of motionBegan and motionEnded events guaranteed by the OS, or is this a problem with the responder chain and events are getting sent elsewhere? ...

UIAccelerometer doesn't send events to second delegate

I am developing a game that uses a different controller for each level. It needs to detect a shake via the accelerometer, so it registers itself as a delegate like so: UIAccelerometer *accel = [UIAccelerometer sharedAccelerometer]; accel.delegate = self; accel.updateInterval = kUpdateInterval; When the level ends, this controller get...

Accelerometer samplerate

I'm having some problems with the accelerometer. When I first started develop my game the controls felt very snappy and precise, but when adding more graphical elements the accelerometer feels like it's reacting very late and sometimes not as precise as before. I'm having a framerate of around 40fps. This is where I read the values (as ...

[iphone] How to make objects flying around in a view

Hey, How is it possible to let some objects fly around and bumb at the end of the view and collide on each other. The second step would add acceleration of the objects by shaking. I haven't found a tutorial yet or some step to begin at. thanks a lot for your help :) Heres a picter of what i image(only a still) http://picfront.org/d...

What's the easiest way to calibrate the tilt setting for an iPhone app?

I'm giving the user of an iPhone app the ability to use the tilt controls when standing, sitting, lying down etc. The user adjusts for each position by going to a settings screen, holding the phone at the desired angle, and tapping a save button. What's the best way to do this in the code? The only thing I'm familiar with is the accel...

Why is using a static int in my accelerometer callback so much slower than using an instance variable?

I'm playing with the GLGravity example to figure out some of the performance nuances related to dealing with the accelerometer. Here's the problem code: - (void)accelerometer:(UIAccelerometer*)accelerometer didAccelerate:(UIAcceleration*)acceleration { static int accelCallCount; accelCallCount++; if (accelCallCount % 100 ==...

IPhone accelerometer works even in flat surface.

I have an imageView in the view. It moves even if the iphone is still for some time. Why is it so ? Also the image does not respond quickly to the movement of the iphone. Here is my code written for this: I have also set the updateInterval and delegate for the accelerometer. #define kVelocityMultiplier 1000; -(void)accelerometer:(...