Gyroscope data is available but failes to compile

I'm trying to get accelerometer data and gyroscope data like so:

var options = {:period => 1, :accelerometer => {:enabled => true, :sampleRate => maxSampleRate}, :gyroscope => {:enabled => true, :sampleRate => maxSampleRate}};
Sensor.registerSensorDataListener(method(:accelCallback), options);

 public function accelCallback(sensorData as SensorData) as Void {
        var accelData = sensorData.accelerometerData;
        var gyroData = sensorData.gyroscopeData;
}
This doesn't want to compile, generating this error:
Garmin\ConnectIQ\Sdks\connectiq-sdk-win-4.1.7-2022-11-21-562b8a195\samples\PitchCounter\source\PitchCounterProcess.mc:76,8: Undefined symbol ':gyroscopeData' detected.
If I than just comment the line out that generates the error, it compiles and runtime I can see in the debugger that the gyroscopeData is available as can be seen below. 

So how is it possible that using sensorData.gyroscopeData fails to compile with sdk 4.1.7 but is runtime available? Any ideas on how to get this compiled or somehow bypass these compiler checks?
Also the documentation is quite confusing:
https://developer.garmin.com/connect-iq/core-topics/sensors/ <- here it clearly indicates that gyroscopeData is available per 3.3.0
  • But it links to 404 :( Besides even if that was the case you would need to change the argument to be GyroscopeData instead of SensorData

  • Yeah. Tried it and get this error. So Indeed the compiler doesn't know anything yet about GyroscopeData. I guess its safe to say that Garmin still does not allow apps to use the gyro. I'm an experience android/apple wearables developer and there you can access those sensors on 100+ hz for years already. Quite unimaginable that garmin is so far behind with just the accelerometer available at 25 hz. 

    AppData\Roaming\Garmin\ConnectIQ\Sdks\connectiq-sdk-win-4.1.7-2022-11-21-562b8a195\samples\PitchCounter\source\PitchCounterProcess.mc:74: Cannot resolve type 'GyroscopeData'.

  • Looks like is might have been pulled and they missed removing the mention of it in core topics.  When I look at the source for the pitchcounter sample in the 4.1.7 SDK, the line you are getting an error on doesn't exist.

  • Hi Jim, I added that line myself to see if I can read gyrodata, which according to some documentation should be possible

  • You see any reference to it any place other than core topics?  It's not in the API doc or any samples.  Sounds to me like they forgot to remove the reference to it in core topics.

  • No, I only found a reference in core topics. I did a full file search through the docs and examples and it's not used any where. Still interesting that it works somewhat runtime as can be seen in my screenshot. So close but yet so far away :S since for actually usage it needs to compile as well.

    Anyhow, for my app I do need gyro values, so I guess its not time for garmin yet. Real bummer. 

  • Hi,

    I recently got a used Vivoactive 4 for fun and of course I am experimenting with all its features and the programming of IQ apps. I can confirm that it is possible to see the data of the gyroscope in the debugger (SDK 4.2.4). The sensorData-object has the data and the debugger can retrieve it. However, it is not possible to access the data in code. Perhaps it is just private in SensorData?

    This confuses me due to the many mentions of gyroscope data on the Garmin IQ Homepage (see initial post). Yes, there are no mentions in the API docs. Is there an official answer from Garmin? Is it just "in progress" and the data access just needs to be activated in the next SDK update? Or is and will the gyroscope data be non-accessible? Then it would be kind to remove the many mentions of gyroscope data to prevent confusion.

  • Hey everyone!

    I think this issue was fixed in the last SDK. I just downloaded the newest one released on June 27th, 2023 (Connect IQ 6.2.1), and the error went away. 

    HOWEVER, I do not see the gyroscope data in the fit file -- I guess the overall problem is still not fixed