Insta360Develop / CameraSDK-iOS

iOS SDK to control Insta360 cameras.
33 stars 5 forks source link

How to obtain mask/hotspot's yaw and pitch? #36

Open kapildevgj opened 2 months ago

kapildevgj commented 2 months ago

Is it possible to have the yaw and pitch from mask's orientation-quaternion?

ravilich86 commented 1 week ago

@kapildevgj we retrieve gyroscope data as follows:

for url in urls {
    let parser = INSImageInfoParser(url: url)
    if parser.open() {
        print("\(String(describing: parser.extraInfo?.gyroData))")
    }
}

In response, you will receive JSON in this format:

{
    "version": 0,
    "info": {
        "serialNumber": "Your serial number",
        "offset": "2_2907.900_2968.960_3006.600_0.244_0.268_90.592_2910.120_8928.180_3002.570_0.153_0.265_89.333_11904_5952_2887",
        "creationTime": 0,
        "gyro": {
            "gy": 6.3806638893449187e-314,
            "az": 1.5914968432239542e-314,
            "gx": 4.9406564584124654e-324,
            "ay": -3.3248304543930522e-105,
            "gz": 6.388449684089048e-314,
            "ax": 3.0268251958135292e-314
        }
    },
    "extraData": {
        "rmPurple": false
    }
}