Code to autoland DJI matrice 100

255 views Asked by At

I am working on developing program for autonomous control of DJI matrice drone. I like to have precise landing of DJI drone with tolerance of approx 5cm in X and Y axes. For this I am trying to control the drone until 50cm from ground and then immediately landing() function is called. But after the landing() function is called, I see that the drone moves in X and Y directions as well. Due to this landing within defined tolerance fails. Is there a way, that I may write an own code for autolanding program with different constraints. Thanks.

1

There are 1 answers

0
Rohit Sant On

you can use a combination of a few tools:

  1. Use flightCtrl APIs such as positionAndYawControl documented here to command the drone in the z-axis, slowly reducing the z position desired

  2. Monitor flight status using broadcast->getStatus() as documented here, and keep sending lower z-setpoints till the drone's flight status changes to M100FlightStatus::LANDING

  3. Send disArm() command to turn the motors off and ensure that the status changes to M100FlightStatus::FINISHING_LANDING.

You might have to experiment a little with the z set points and the time duration to keep sending lower setpoints in order to get this to work.