Custom Movement and Photos on ANAFI

Hi - I’m trying to make a simple app for ANAFI, just to take off, fly a few feet, take some video, and then land. I have been working with the HelloDrone and Camera sample apps as a starting point, but running into two issues:

  1. When I try to take a photo in a timed routine (scheduleAtFixedRate), which would be nice, it crashes the app.
  2. I can’t figure out how to get the drone to move. It will take off and land, but when I try setRoll or setPitch, it doesn’t do anything.
    I’m new to Kotlin and to the SDK, so I am sure I am missing a lot. Any help would be very much appreciated.

Partly solved! I found this topic that helped.
I just passed the remote control value to my class, and then added the following to my startMonitoring function:

        rc?.getPeripheral(Copilot::class.java) { copilot: Copilot? ->
            copilot?.let {
                copilot.source().value = Copilot.Source.APPLICATION
            }
        }

Now setRoll, setPitch, and setYawRotationSpeed all work great!

Still need to figure out how to take photos during a timed sequence.

2 Likes