Raspberry Pi 2 offboard control of Pixhawk, fly mission and then switch to land on target using Opencv

Hi all. 

I'm doing a little project where I want to use a Raspberry Pi 2 to run a python script that sends MAVLINK commands to the Pixhawk where it takes off, flies between a couple of waypoints and at the last waypoint it switches to using a down-facing camera to find a white square using opencv and maneuver the drone over the square and land on it.

I have the dronekit python API working and set up a SITL simulation with APM:Copter 3.3 where I'm able to run the dronekit example python scripts on the laptop and see the simulated quad flying in Mission Planner.

Running the scripts from the Raspberry Pi on the real drone only needs a little change in the connection string I believe to output over the Raspberry GPIO pins to the Pixhawk rather than the TCP link to the simulator. 

After the last waypoint I need to find a white square landing pad and land the drone on that. How would I go about sending a velocity vector using information from the opencv output that moves the drone over the square landing area? Can I send a land command and keep correcting the position of the drone over the landing pad while it's landing? Anyone have any experience in finding the position of the square in the camera feed and translating to drone movement until it's over the landing pad?

All help would be extremely appreciated!

Views: 449

Reply to This

Groups

Season Two of the Trust Time Trial (T3) Contest 
A list of all T3 contests is here. The current round, the Vertical Horizontal one, is here

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service