Precision Landing in AirSim with Aruco marker

Hi there,

I’m trying to test a precision landing algorithm using Aruco marker in UE4 with AirSim and Ardupilot. I am running Ubuntu 20.04.

I am using the code provided here: https://github.com/rishabsingh3003/Precision_Landing_ArduPilot/blob/master/AirSim/air_sim_to_mavlink.py

These are the different steps I am taking:

  1. Press"Play" in my UE4 project,
  2. Launch sim_vehicle.py -v ArduCopter -f airsim-copter --console
  3. In the MAVProxy Command Prompt:
    mode guided
    arm throttle
    takeoff 4
  4. Launch the python script to detect the Aruco marker

I can see that the Aruco marker is detected correctly and that the landing coordinates are calculated. However, when I enter “mode land” in the MAVProxy Command Prompt, the drone lands vertically.

My suspicion is that the mav.landing_target_send is not taken into account for some reason.

Following this topic (SITL Ubuntu - Precision Landing with Companion Computer), I have tried to modify the different parameters but nothing seems to work.

Am I missing something?

Thanks a lot

Activate precision loiter and set mode to landing afterwards

Thanks for the advice!

I have indeed “PLND_ENABLED=1” before switching to mode LAND

Any other idea by any chance?

Can you upload a log of this flight so I can check if everything is setup correctly. I also haven’t had a look at my AirSim script for a while, so I might need to check if that is outputting what it should

Sure, thanks for your time! And thanks for the script, I saw the demo on YouTube and it seems to work very well.

The file is too big to be uploaded, you should be able to see it there.

https://drive.google.com/drive/folders/1HIBDn-XX89Aljws_fL0mZ6BKrG4aOZ7j?usp=drive_link

First problem is that PLND_TYPE = 0. It should be set to 1 if using mavlink

I changed that value, but the drone still lands vertically

https://github.com/rishabsingh3003/Precision_Landing_ArduPilot/blob/master/AirSim/air_sim_to_mavlink.py#L186 change this to 0. This didn’t matter when I wrote the script, but now it does matter.
After that send me a log again

Cheers, it works now! Thanks, I struggled several days before asking.

Can I ask what this parameters does?

Prior to Copter 4.2, you could only send LANDING_TARGET mavlink message as angles so this flag was unused. Since then, we can now instead send a 3D body FRD vector. The “position_valid” flag is used to switch between the two.

Got it! Thanks for your help! :slightly_smiling_face: