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:

Hi there,

I’ve put this project on the side and came back to it recently.

I am trying the precision landing algorithm and I am facing an issue because it is “too aggressive”. The correction is too high and the drones ends up oscillating a lot.

I’ve tried to reduce the x and y offset values sent with a correction factor, but it doesn’t seem to help.

Does someone have any advice? Could it be a parameters?
My descending speed is set to 50 cm/s.

Thanks a lot!

How good did you tune your drone?

Probably not good enough :sweat_smile:

I struggle to find a good tuning in my setup with a custom simulated drone (Unreal Engine + AirSim)

I was thinking that modifying PSC_POSXY_P could solve the issue, but it didn’t change much.

When I say “oscillating”, I mean that each position correction applied seems to be too big. If I start the landing sequence nearly above the marker, the drone ends up completely next to the target and doesn’t see it anymore.