Joe
Joe

Reputation: 447

Max and Min Values of Roll, Pitch and Yaw of the capture motion of iPhone

This proram is to detect values of the gyroscope (Roll, Pitch and Yaw).

Please i want to know what is the max and Min values of Roll, Pitch and Yaw. (Values of Gyroscope)


Initialising :

[[UIAccelerometer sharedAccelerometer] setUpdateInterval:0.2f];

[[UIAccelerometer sharedAccelerometer] setDelegate:self];

motionManager = [[CMMotionManager alloc] init];

motionManager.accelerometerUpdateInterval = 0.01; // 100Hz

motionManager.deviceMotionUpdateInterval = 0.01; // 100Hz

[motionManager startDeviceMotionUpdates];


motionManager.deviceMotion.attitude.roll // Max and Min Value ?

motionManager.deviceMotion.attitude.yaw // Max and Min Value ?

motionManager.deviceMotion.attitude.Pitch // Max and Min Value ?

And how to pass to the Values -> Degree ?

Thanks

Upvotes: 4

Views: 7274

Answers (1)

Joe
Joe

Reputation: 447

This is the solution :

if you put

#define degrees(x) (180 * x / M_PI)

Then the values in Degree :

Vroll = degrees(motionManager.deviceMotion.attitude.roll);
Vyaw  = degrees(motionManager.deviceMotion.attitude.yaw);
Vpitch= degrees(motionManager.deviceMotion.attitude.pitch);

So :

Vroll Min : -180°, Max : 180°

Vyaw Min : -180°, Max : 180°

Vpitch Min : -90°, Max : 90°

Thanks stackoverflow :)

Upvotes: 7

Related Questions