Landing_target_estimator module for non IRlock

Hi there,
is there already support for non- IRLock precision landing ? I would like to perform precision landing by providing the target position over mavlink/mavros. At the moment the landing_target_estimator seams to work only with IR lock DD. Or is there a way to override the input coordinates?


If you have the target position externally, you can feed it to PX4 by sending LANDING_TARGET messages. You can see in malvink_receiver.cpp how they are received and published for the precision landing flight mode:

Hi @Nicolas,
thanks for your prompt reply and helpful input.
At the moment I am trying to send those messages over mavros. Somehow is still not working. Did you ever tested this? I was already considering performing the precision landing over off-board mode.

I will post the results once I have managed to get it working(if it works ;-).
Thanks once again.

Which part isn’t working? Are the messages received by PX4? You should see messages on the landing_target_pose topic in your .ulg. If you see messages in irlock_report, then the message you’re sending is not filled in correctly.

Hi Nicolas,
in the ulg or in mavlink inspektor I dont see any landing messages related.

This is what I have done so far:
under my mavros build …/mavros/launch/px4_config.yaml
# landing_target
listen_lt: true # changed here to true

after that I am able to see that there is two topics generated by mavros and the following messages are displayed.
[ INFO] [1599642890.951102369]: Listen to landing_target transform landing_target -> camera_center
[ INFO] [1599642890.951322749]: Plugin landing_target initialized

made sure the plugin from Px4 the landing_target_estimator is started
pxh> landing_target_estimator start
INFO [landing_target_estimator] already running

pxh> listener irlock_report
never published

pxh> listener landing_target_pose
never published

Here is the last log. Nothing regarding landing is published.

So I assume the messages are never reaching px4. I tried to publish messages to both mavros topics but no reaction from the px4 side. Which is the right topic from mavros to publish the landing target coordinates?
Many thanks !

If you set listen_lt to true then you should be publishing to /mavros/landing_target/raw:

Hi @Nicolas,
many thanks for your help. I have debugged the mavros_extras plugin … this one starts publishing to /mavros/landing_target/raw once my tf becomes available … so far so good.
I can see the messages in /mavros/landing_target/raw they are ok and the low-level landing_target() is also called.
Under mavlink inspector I can’t still see any messages related to LANDING.
Under Px4

[ WARN] [1599663330.075529991, 875.932000000]: CMD: Unexpected command 176, result 0
WARN [mc_pos_control] Auto activation failed with error: Activation Failed
WARN [navigator] Resetting landing position to current position
WARN [navigator] Lost landing target while landing (horizontal approach).
INFO [navigator] Climbing to search altitude.
WARN [navigator] Lost landing target while landing (descending).
INFO [navigator] Climbing to search altitude.
WARN [navigator] Lost landing target while landing (descending).
INFO [navigator] Climbing to search altitude.
WARN [navigator] Lost landing target while landing (descending).
WARN [navigator] Falling back to normal land.
INFO [commander] Landing detected

The behavior: The drone returns to the starting position and starts descending and once it loses the apriltag starts going up and down.
So something is working. Just not as it should.

Looks like something is happening indeed. If landing on the tag works as expected until it loses it, it might simply be a question of setting an appropriate final approach altitude for your use case:

Hi Nicolas,
I found the issue. Seems like under lt.frame under mavros/mavros_extras/src/plugins/landing_target.cpp is not being set proper.
even it is set to “LOCAL_NED” = 2 and under px4 mavlink should be MAV_FRAME_LOCAL_NED = 1 in order be published. The landing_target.position_valid is valid.
So i changed some things and now I have uOrb topic outputing
pxh> listener landing_target_pose

TOPIC: landing_target_pose
timestamp: 262124974 (0.175026 seconds ago)
x_rel: 0.0000
y_rel: 0.0000
z_rel: 0.0000
vx_rel: 0.0000
vy_rel: 0.0000
cov_x_rel: 0.0000
cov_y_rel: 0.0000
cov_vx_rel: 0.0000
cov_vy_rel: 0.0000
x_abs: -4.0024
y_abs: 0.1170
z_abs: 11.3822
is_static: False
rel_pos_valid: False
rel_vel_valid: False
abs_pos_valid: True

I will keep digging. But something is not working as it should.
Either way I just also noticed that only pose is being sent. Orientation is missing. Or am I missing something here ?
Did you ever tried this mode with external target position input ?

No I’ve only used it with onboard sensors.

So in order to check how the input from message pose is at all I checked first in the simulation from IR-Lock. This is how it looks like…

TOPIC: landing_target_pose
timestamp: 152856000 (0.008000 seconds ago)
x_rel: -0.1771
y_rel: 0.1379
z_rel: 11.8677
vx_rel: -0.0245
vy_rel: -0.0078
cov_x_rel: 0.0376
cov_y_rel: 0.0376
cov_vx_rel: 0.1436
cov_vy_rel: 0.1436
x_abs: 1.2554
y_abs: 0.7141
z_abs: -0.0250
is_static: True
rel_pos_valid: True
rel_vel_valid: True
abs_pos_valid: True

So this, works with both covariance, relative position and absolute.Looks very good. This is how it should look like for the vision based approach too. I assume at least.
Obviously from my previous message this is being wrongly posted. :roll_eyes: :grimacing: Or?
I assume that this mavros_extras plugin is not working proper…

@TSC21 hey nuno can you perhaps give your input here as well? Obrigado!