How to use Precision Landing feature with companion computer?

Nice to hear. I’m going to use the feature with DFRobot IR positioning camera and IR source on the landing site. But cannot make to work the precision landing in sitl. Is it possible to check the precision landing in ArduCopter 3.4-dev in simulator?
In what mode should be the copter for the precision landing to work with companion computer? guided or land?
Thanx

@dollop Hi there, for SITL, I tried running it on my Raspberry Pi 3 but it didn’t work so I tried everything directly in real time operation, I’m sorry I can’t provide further information on simulation however the precision landing mode only works in LAND MODE when working with a companion computer.

Going through http://ardupilot.org/copter/docs/precision-landing-with-irlock.html, there isn’t much on how to make this feature work with a companion computer. Is the only requirement that the companion computer keep sending landing_target_encode()'ed messages and the flight controller with automatically pick up these messages when in LAND mode?

@Anthony well, if it helps the precision landing feature has to first enabled in the parameters accessible through Mission Planner parameter list if you’re using Mission Planner on your ground control station, select which feature you’re gonna use, either a companion computer or the precision ir lock feature. In my case I activate the companion computer feature in the parameters list, then I keep sending the visual data the precision landing function needs. I also keep looping the code so that the data is sent continuously. Hope this helps.

By this you mean sending which data/messages exactly? Link to code would make it clear thanks.

Okay, if you’re using the same code above:

def send_land_message(x, y):
msg = vehicle.message_factory.landing_target_encode(
0, # time_boot_ms (not used)
0, # target num
0, # frame
(x-horizontal_resolution/2)*horizontal_fov/horizontal_resolution,
(y-vertical_resolution/2)*vertical_fov/vertical_resolution,
0, # altitude. Not supported.
0,0) # size of target in radians
vehicle.send_mavlink(msg)
vehicle.flush()

The variable which you should keep updating is ‘x’ and ‘y’ which are the co-ordinate information of your landing target in the image or video your python code is processing, in rcmackay9’s video, I’m guessing he is detecting circles, so he identifies the circle and he finds the center co-ordinate of the circle within the image and this is the ‘x’ and ‘y’ co-ordinate, so in the code the ‘x’ and ‘y’ variables keep updating so you have to run the above function again in a continuous loop so the copter knows where it has to go, horizontal_resolution and vertical_resolution are the resolution of your image, horizontal_fov and vertical_fov is how much your camera can see in terms of degrees, for a Pi camera v1.3 its 54 by 41 degrees. The rest of the parameters in the function I have yet to look into it. Try looking in this, you’ll get the idea of how the code should work. Hope this helps.

https://github.com/squilter/target-land/blob/master/target_land.py

1 Like

Hello,
Here is my ‘‘instruction picture’’ showing how to make
squilter’s target_land.py works on SITL with an ODROID


So basically, if its working in SITL, it should work in the FIELD… Real test are comming :slight_smile:

1 Like

Great work, I did this in school as a project. This is a demo video.

2 Likes

PERRRRRRRRRRRFECT !!!
Great Job , keep on !

I have the ZED and TX1 as well but the Zed is on a gimbal. Are you using a different carrier board?

Such cool work! It’s exactly what I wanted. Can it be ported to quadplane? I’m just about to finish a Skywalker quadplane and I’d love to have precision landing capability.

1 Like

Good question, this would be great for quadplane!
You might want to take a look at vision_landing, it’s another method for precision landing:
http://discuss.ardupilot.org/t/maverick-vision-landing/18168

2 Likes

@HjorturG
i need to know something from you because the docs is very confusing.

In the structure of your MavLink message, why the sixth value is put to zero with a hashtag for the altitude … shouldn’t this be the distance between the center of the camera and the center of the detected landing target ?

Hi! Im trying to visualize the m255 landing target but there is no such parameter in qgroundcontrol.

Do you know if this changed?

What program do you use and which MAVLink message are you sending to FC (or SITL) ?

Im using squilter target_land.py

Im connected to qgroundcontrol via radio baud 57600, using a real drone (Pixhawk2.1 arducopter v3.65

I did some prints in the program and I know the camera is seeing the target and getting the values, the problem is I dont know how to monitor them on the Qgroundcontrol. The M255 is not available in the analyzer

def send_land_message(x, y):
msg = vehicle.message_factory.landing_target_encode(
0, # time_boot_ms (not used)
0, # target num
0, # frame
(x-horizontal_resolution/2)*horizontal_fov/horizontal_resolution,
(y-vertical_resolution/2)*vertical_fov/vertical_resolution,
0, # altitude. Not supported.
0,0) # size of target in radians
vehicle.send_mavlink(msg)
vehicle.flush()

Your message looks ok , You had the PLND_ENABLED and PLND_TYPE to 1.0 (Companion Computer) and mavlink message is passing OK from CC to FC ?

Then you should be able to read Landing_target.angle (M255 is relative == search Widget with LANDING)

Yes I have PLND Enabled and Type to 1

I dont know if the message is going through to the FC, when i search “landing” in qgroundcontrol analyzer nothing appears

Unless something changed in the code, that was working ok. Have you tried sending static values of x-y just to make sure?

Yes but still i cant find anything with those parameters :frowning:

X and Y values should range from -1 to 1 right?

Can you share your camera values please? FOV and size

1 Like