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.
you can use a combination of a few tools:
Use flightCtrl APIs such as
positionAndYawControl
documented here to command the drone in the z-axis, slowly reducing the z position desiredMonitor flight status using
broadcast->getStatus()
as documented here, and keep sending lower z-setpoints till the drone's flight status changes toM100FlightStatus::LANDING
Send
disArm()
command to turn the motors off and ensure that the status changes toM100FlightStatus::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.