So I'm trying to make a drone use the precision landing feature to land on a target by using a camera and sending vehicle.message_factory.landing_target_encode() MAVLINK messages using the dronekit API based on where the target is in the camera frame.
I compiled the APM:Copter 3.4 code from the master branch and everything looked ok, I enabled the precision landing feature, with precision landing type set to companion computer.
However, before running the code and make the drone land on the target I did a quick test flight with manual control (no code running on the companion computer) starting in stabilized mode but when I flipped to LAND mode all hell broke loose, the drone jerked wildly, I switched back to stabilized mode but couldn't control it and it smashed into a wall.
Playing back the log in Mission Planner I noticed that as soon as I flipped to LAND mode I got "Error Compass Variance" and "Error Velocity Variance". Now I'm pretty sure that after flipping back to stabilizedmode I couldn't get the drone to level out, I remember trying to get it under control but the drone just being stuck at full tilt and full throttle. However maybe I just panicked and didn't realize the orientation of the drone, it all happened so fast.
I was under the impression that Precision Landing mode just operated as the normal LAND mode unless it got these MAVLINK messages with position adjustments and therefore when I flipped to LAND it would just land normally like we had done many times with the 3.3.3 firmware.
I'm basing this project on this: https://github.com/squilter/target-land/blob/master/target_land.py and my code is structured the same way running on a Raspberry Pi computer mounted on the drone and sending MAVLINK commands to Pixhawk using the dronekit API. We managed to make the raspberry fly the drone with dronekit with a simple takeoff and landing however the raspberry was not running any code when this crash happened.
I would be very happy if someone who knows this a bit better could help me review the log and see what went wrong, and if someone has some good information regarding the Precision Landing feature and how to use it with a companion computer, camera, image analysis and dronekit API (MAVLINK) that would be great.