[SITL, mavros] Precision Landing, Failsafe Measures Errors

Hi!
First time posting so apologies if this is in the wrong place/missing something obvious/title is bad

I am attempting to get April-tag (vision) precision landing running on my SITL + Gazebo iris drone. I have followed setup according to here, adjusting the PLND* parameters for Gazebo and SITL. I have also added a SITL rangefinder.

I am attempting to publish LandingTarget messages with mavros in the interest of performing precision landing onto a target. I have a ROS node which publishes LandingTarget messages on the /mavros/landing_target/raw topic, which the simulated drone is subscribing to.

First and foremost, my simulated FCU does not seem to receive the LandingTarget messages, throwing “FCU: Precland: Failsafe measures” which, after digging around in the source code, suggests that the targets were “never seen”. When switching to LAND mode via mavproxy I see this Info/warning message and the drone lands vertically rather than my target nearby (~3m away in both x and y in the sim)

Upon looking at mavros topics,mavros/landing_target/raw appears. I presume this topic is the one that allows my FCU to “see” the targets, but I can’t say for sure.

A secondary problem is that I cannot see LANDING_TARGET messages appear in Mission Planner’s Mavlink Inspector even after sending “raw” mavlink messages through dronekit's python package.

I should mention that all vision-side stuff (target detection, camera transforms) are working, the only thing missing for me is a conversion from the target relative pose to a landing target message that Ardupilot’s LAND mode can use for precision landing. My SITL firmware is Copter 4.3.0-dev (I just cloned the default ArduPilot branch)

My question is a bit two-fold, but has the goal of achieving precision landing given a target position in the frame of the drone camera using mavros.

  • Is there something I am missing for the FCU to not be receiving LandingTarget messages? Sent through both Mavros and Dronekit.
  • How can I fix my issues and have the drone accept my LandingTarget messages + land properly?

Please let me know if you need more info – I’ll try my best to provide missing info

Thanks in advance for any help that can be provided!

hi,Has your problem been solved? Currently I am also doing this work, I am in gazebo, other normal is not able to precland

@Spoonie @leelaser Hi guys, I found this topic!
I do not know if you solved but I had recently the same issue and I solved putting a different FRAME on the landing protocol message. Try with these params and see if it works:

import pymavlink.mavutil as mavutil

ArduCopter needs:
#mavutil.mavlink.MAV_FRAME_BODY_OFFSET_NED
px4 needs:
#mavutil.mavlink.MAV_FRAME_LOCAL_NED

your_drone_connection.mav.landing_target_send(
0, #time_usec, for example 0 ms
self.connection.target_system, #target_num
mavutil.mavlink.MAV_FRAME_LOCAL_NED, #frame for PX4 or ArduCopter
angle_x, # X axis angular offset in rad
angle_y, # Y axis angular offset in rad
0, # Distance to the target from the vehicle - not used = 0
0, # Size of target along x-axis - not used = 0
0 # Size of target along y-axis - not used = 0
)

where “your_drone_connection” is the function to connect to your drone.
for example:

device = “udpin:127.0.0.1:14550”
your_drone_conncection = mavutil.mavlink_connection(device)

But I think you should already know how to connect your drone.

I know that the documentation says to use another FRAME, but I tried to use the same used by Dronekit and it worked.

Try and let me know! :cowboy_hat_face: