How to use Precision Landing feature with companion computer?

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

Looking at my lab picture it was 0,6 to -0,6 and the camera was a Logitech C920
After I worked with JeVois so the GoV did not applied the same way.

Here is the link from my github : https://github.com/patrickpoirier51/JeVois--Python-Tracking
Thats about all there is to it

2 Likes

Awesome thanks!! The Jevois calculates the height? Or how are you getting the Z value?

1 Like

Yes you can measure distance with Aruco tag but in this case, Z is used to pass the tag ID so you can filter/match the tag with a specific command

Can you please Share your PID values? I got the pY and pX to the FC but its not doing the corrections as it should.

I dont have them as this project is quite old and the initial platform has been rebuild
I i remember well , I slightly over-damped the vehicle.

1 Like

Do you by any chance have the PIDs you used for this project?

1 Like

I’m having issues implementing precision landing with my setup. I have a RPi that is receiving serial with tag from a JeVois Smart Camera. Sending mavlink messages using the scripts in @ppoirier’s github. Using mavlink inspector I can see that the FC (Pixhawk Cube Black) is receiving the messages as angle_x and angle_y. From the flight logs I can see that PL.px and PL.py is aquired and is evidenced by a flight controller that reacts viciously (drone makes huge corrections, pitching and rolling hard in a tight space) and eventually drifts away from the target site (while pitching and rolling).

@ppoirier’s code sends 17 as the distance in the mavlink message when it is seeing ArUco tag 17 consistently and 8 as the distance when it is seeing ArUco tag 8 consistently. In order to calm the reactions of the drone down, I changed the code to send 5 as the distance consistently… but now can’t seem to get any reaction from drone when it picks up the ArUco tag. I’ve tried the Kalman filter with values from 0.5 to 5, but I don’t get consistent results to verify improvement. Usually I am using the RawFilter Data parameter for the interpretation of the mavlink messages.

I then attempting sending updated distance values to the flight controller by using the JeVois setting:
setpar dopose true
setpar markerlen 317 (mm)

and making the nessesary code changes to send the true z-value in place of the ID. However, I am seeing little to no reaction from the drone. I made sure to scale the z values by dividing by 100 so that the flight controller is reading the results in decimeters. I forgot to try dividing by 1000 in this last flight test, so I may try to do that and see if I get better results. However, seeing that I had no response with the FC reading decimeters, I am skeptical that changing the code to send z-values placed into meters will make much of a difference.

I’ll try sending the 17 and 8 values again, but am not sure how to calm down the extreme ‘bucking’. If that has no responce with the drone, I’ll try using the calculated z-values from the JeVois and dividing by 1000 in order to place into meters.

Am I mistaken in thinking the the mavlink message should only be sending angle_x, angle_y, and distance? I see that there are areas in the mavlink message for x, y, z, but these are unpopulated.

Any advice / thoughts are well appreciated! Also, thanks to @ppoirier for getting me this far.

I’ll upload a helpful flight log tomorrow.

1 Like

Hello
Aruco 17 and 8 correspond to the tags of the Landing Target. Looking at the video you will see the target pad is made of a large and small tags, so while Landing the JeVOIS will automatically switch from bigger to smaller while it gets closer.

As for the “psycho wasp” behaviour, you can reduce the gain of Landing Target message (I tuned it with SITL) and dampen the vehicle PID so it is less reactive and do not use the Kalman filter as it is adding lag to control loop

1 Like

Hello,

Thanks for the response @ppoirier. I didn’t realize there was a setting for the gain of the Landing_Target message. Am I able to change it through QGroundControl and if so where?

Okay, I’ll stay away from using the Kalman filter. I wasn’t getting very good results with it anyways.

Right now I am in process of setting up SITL and will try changing the gain of Landing_Target message in there.

Did you add in a sensor lag as well?

Thanks!

1 Like

@ppoirier - or anyone who used this… how do I put dronekit and pymavlink on JeVois ?

Unlike OpenMV, there is no implementation on JeVOIS but it can be done if you are eager to install the dev. toolkit … at the time it was kreepy :smiley:

Otherwise you run a python script on a pi Zero using pymavlink like I did