I am currently using Android Studio and the Kotlin programming language to code my Anafi drone to periodically take a picture and send that image along with some metadata off elsewhere. I was able to get metadata such as the drone’s GPS location, compass heading, and altitude from takeoff, but I have absolutely no clue on how to take a photo using the drone’s camera.
I was able to use the capture() command from GsdkStreamView to get the bitmap of the live stream, but the quality of the image is much lower than desired. As a result, I tried working with the Main Camera.
My approach right now is to instantiate a reference to the drone’s MainCamera, then create a method to monitor the main camera and configure its settings using it.photo()?.setFileFormat( … ) where “it” is a MainCamera object created by the lambda function used when monitoring the MainCamera.
To take an image, I was thinking of making a takePhoto() method, in which the startPhotoCapture() and stopPhotoCapture() methods are used, but I have absolutely no idea how to use them.
Can someone point me in the right direction or give some further clarification on how to take a picture with the drone?