Retrieving Alignment Settings from Drone Camera


I am trying to build an app that can collect metadata from the drone, such as its GPS location and orientation. I am having trouble getting the alignment settings of the camera.

I am currently programming using the Kotlin language in Android Studio, just like the Ground SDK sample. Here is a screenshot of my Kotlin code, structured very similarly to the rest of the code in the sample.

So far, I have tried to access these settings by creating a reference to MainCamera, initializing that by getting the MainCamera peripheral from the drone, then calling the pitch() method on the alignment() method, which MainCamera inherits from the Camera interface.

For some reason, I keep getting 0.0 as the return value of the pitch, even when I physically rotate the camera up and down. I tried to double check by using the supportedPitchRange() method, but that just returns [0.0, 0.0]. I have a feeling that this is related to the return values of the CameraAlignment.Setting class methods all being abstract, but I don’t know how to get the actual alignment values from here. Any help would be appreciated.

Update to this issue: found a solution.

It seems like when the drone object is created and connected to, the mAlignmentSettings object is null. There seems to be no other choice than to use the gimbal peripheral, which I was successfully able to implement.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.