05-10-2011 03:15 PM
I'm testing location services on my PlayBook, and whilst GPS semi seems to function I cannot see any API references to utilising the digital compass or gyroscope which is apparently in the hardware?
Any help is appreciated - I understand that the PlayBook is still a work in progress (as can be seen quite easily)!
Matt
Solved! Go to Solution.
05-10-2011 03:27 PM
You can't find the interfaces because AS3 does not currently support the compass or gyroscope. We'll have to wait until RIM provides the necessary hooks via the native SDK. Or perhaps air sdk 2.6 will have therequired support.
In any event, the ball is in RIM's court and we mere developers will have to be patient. But, I agreee with you that GPS is a very poor substitute for a real magnetic compass. If RIM wants us to generate apps with real WOW facter, then they need to support the remaining sensors on the double.
05-10-2011 03:33 PM
Ah I did suspect that, I know they have a team working around the clock on this device and have been for a long-time now, it's a shame their software teams let them down slightly (or management I should specify).
However a lot of progress has been made over the past month or two, so hopefully that will continue!
Thanks
05-10-2011 03:42 PM
The 3-axis gyroscope and the 3-axis accelerometer are combined to make a 6-axis motion sensor. You can access the motion sensor with flash.sensors.Accelerometer. The PlayBook has a 3-Axis Digital Compass but I can't find out how access it now. Peter 9477 commented "As for the compass, there is no Flash API that will let us access it yet, so until they provide that, or release the native SDK, you're out of luck."
05-10-2011 03:52 PM
However with the Accelerometer class there are no methods to retreive the current alignment from the gyroscope, only the standard acceleration when moving the device, not stationary. Please do correct me If I am wrong!
05-10-2011 04:04 PM
05-10-2011 04:14 PM - edited 05-10-2011 04:40 PM
No but the data from a gyroscope isn't very useful. The data from a gyroscope will drift over time. A gyroscope is used to smooth out the accelerometer errors. By averaging data that comes from the accelerometer and the gyroscope you can obtain a relatively better estimate of the current device inclination.
EDIT: Note flash.sensors.Accelerometer is a little misleading. You're not getting the data from the accelerometer, you're getting the average data from both the accelerometer and the gyroscope.
05-10-2011 04:56 PM
05-10-2011 06:45 PM
PicaxeEffect wrote:
No but the data from a gyroscope isn't very useful. The data from a gyroscope will drift over time. A gyroscope is used to smooth out the accelerometer errors. By averaging data that comes from the accelerometer and the gyroscope you can obtain a relatively better estimate of the current device inclination.
EDIT: Note flash.sensors.Accelerometer is a little misleading. You're not getting the data from the accelerometer, you're getting the average data from both the accelerometer and the gyroscope.
I don't think that's true. I can't see how you can get the rotation around the z-axis (azimuth) with just a accelerometer and a 6-axis sensor needs rotations around the 3 axis too. flash.sensors.Accelerometer doesn't give you rotations. I apologize if you can show me wrong.
05-12-2011 11:07 AM
flash.events.AccelerometerEvent. provides rotation around all three axis's... Rotation around the X axis is pitch (measured by changes in AccelerationX). Rotation around the Y axis is roll (measured by changes in AccelerationY) and rotation around the Z axis is yaw (measured by changes in AccelerationZ). No API's yet for the gyroscope (which would be useful in order to bring the rotations back to a zero point).