dji-sdk / Mobile-SDK-Android

DJI Mobile SDK for Android: http://developer.dji.com/mobile-sdk/
Other
994 stars 581 forks source link

How to run a sequence of timed flight commands? #1198

Open Salabda opened 2 years ago

Salabda commented 2 years ago

Hi there.

I'm planning some automation flight.

Let's say I want to move forward and left for 3m. Next, I want to move upwards for 2m. Then, I want to turn 180 degrees CCW.

How would you guys recommend to do this? I have so far been sending commands this way:


                pitch = 1;
                Handler fhandler = new Handler();
                fhandler.postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        setZero(); //Stops the drone
                    }
                },((long)1500));

That would make the drone move forward at 1m/s for 1500miliseconds.

Is there a DJI function which can take care of the velocity and time input? Can that function be set in a chain to produce a sequence?

bbenson09 commented 2 years ago

Did you look into using Virtual Sticks? (See FlightController)

Not sure if it takes time input, but I believe you can set the velocity

Salabda commented 2 years ago

Thanks man. I'm using virtual sticks. But that's maybe the detail that I wanted, How to also specify the time?