Access Siri-Remote gyroscope

Hi all,


I've been experimenting with tvOS for a few day now, and today, I finally got myself the Developer kit.


I would like to use the gyroscope in one of my ideas, but when I try to retrieve the gyroscope data via the following code:


func didUpdateWithMotion(motion:GCMotion) {
       
        print(motion.rotationRate.x)
        print(motion.rotationRate.y)
        print(motion.rotationRate.z)
    }


It doesn't seem to work; it always returns 0.0. This does work with the accelerometer. Any suggestions on this, or will the gyroscope data be released in a later beta version of tvOS.


Of my knowledge, I thought the remote had a gyroscope, and it is documented all over the place in the documents.


Thanks.

Replies

Try using the gravity value of the GCController.

For example,

for (GCController *aController in [GCController controllers]) {

        float leftRightTiltOfController = aController.motion.gravity.y;
}

I second this... Our engine has support for all of the nice motion controls that CoreMotion's MotionManager gave us (gravity, user acceleration, rotation rate, and attitude with an optional reference attitude for calibration). GCMotion appears to supports all of these (except for making calibration easy with a reference), but doesn't actually (yet?). Getting the direction of gravity is _something_ but it isn't the whole picture. With Apple requiring the Siri Remote for games, I'd expect full functionality (and teardowns have seen a gyro in it). Rotation can be critical to some games, which means the attitude and rotation rate are critical.


I'm hoping it's just not hooked up in software yet! Has anyone seen GCMotion with full gyro support in an MFi controller? Do they even support GCMotion? 🙂


Josh

Note that in the tvOS header GCMotion.h is says:

@note Remotes can not determine a stable attitude so the values will be (0,0,0,1) at all times.

@note Remotes can not determine a stable rotation rate so the values will be (0,0,0) at all times.

Is this a tempoary beta problem? Or will the device ship like this... ie with no gyroscope data availabe to app developers?

I've developed a framework that wraps Game Controller in a way that makes it easy to create an iOS-based game controller that appears as a MFi hardware-based controller: https://github.com/robreuss/VirtualGameController The framework supports the use of Device Motion on iOS-based controllers, and the data is flowed through the motion profile for consistency sake.