def selectROI(event, x, y, flags, param):
	global frame, roiPts, inputMode, yPts, xPts
	if inputMode and event == cv2.EVENT_LBUTTONDOWN and len(roiPts) < 4:
		roiPts.append((x, y))
		xPts.append(x)
		yPts.append(y)
		cv2.circle(frame, (x, y), 4, (255, 204, 0), 2)
		cv2.imshow("frame", frame)
		print roiPts
		if len(roiPts) == 4:
			cv2.circle(frame, ((sum(xPts) / 4), (sum(yPts) / 4)), 1, (255, 0, 0), 2)
			cv2.imshow("frame", frame)

api=local_connect()
vehicle = api.get_vehicles()[0]
drone = mikeObject()

frame = None
roiPts = []
inputMode = False
xPts = []
yPts = []

camera = cv2.VideoCapture(0)

xPid = pid.PID(5,0,0)
yPid = pid.PID(5,0,0)

cameraW = camera.get(3)
cameraH = camera.get(4)
Esempio n. 2
0
# DO NOT TOUCH THIS SRSLY OMG BUT ACTUALLY

import sys
import os
import time
from droneapi.lib import VehicleMode, Location, Command
from pymavlink import mavutil
from dronekit import connect
sys.path.append("/home/shan/code/trackingdrone/")
from droneControlAPI import mikeObject

api = local_connect()
vehicle = api.get_vehicles()[0]

drone = mikeObject()

#DO NOT TOUCH ANYTHING ABOVE SO HELP ME GOD.....

drone.releaseControlAll(vehicle)

print "Starting Takeoff"
drone.takeoff(vehicle)
print "Takeoff!!!!"
time.sleep(5)

drone.rightP(vehicle)
time.sleep(1)
drone.rightP(vehicle)
time.sleep(1)
drone.rightP(vehicle)
time.sleep(1)
Esempio n. 3
0
import droneControlAPI
import time

drone = droneControlAPI.mikeObject()

time.sleep(5)

drone.armTest()