about

Project Development

 

else:

pi0.set_servo_pulsewidth(pin_roll, 0) pi0.set_servo_pulsewidth(pin_pitch, 0) pi0.set_servo_pulsewidth(pin_yaw, 0) pi0.write(pinG, 0)

pi0.write(pinR, 1)

        ## show in diferent windows

        if watch == 1:

cv2.rectangle(img, (290, 210), (350,270), (127, 127, 127), 1) cv2.imshow("gods_eye [gray]", img)

video.write(img)

if watch == 2:

cv2.imshow("gods_eye [thresh]", img_thresh)

if watch == 3:

cv2.imshow("gods_eye [keypoints]", img_keypoints)

# clear stream and wait for key to quit

rawCapture.truncate(0)

key = cv2.waitKey(1) & 0xFF

if key == ord("q"):

    break

if key == ord("z"):

    watch = 1

if key == ord("x"):

    watch = 2

if key == ord("c"):

 

if key == ord(" "):

    active =  not active

    pi0.write(pinR, 0)

    pi0.write(pinG, 0)

    if not active:

        pi0.write(pinB, 1)

 

 

 

else:

        pi0.write(pinB, 0)

if key == ord("p"):

xP += 0.1

    ctrl_pitch.setKP(xP)

if key == ord("i"):

xI += 0.1

    ctrl_pitch.setKI(xI)

if key == ord("o"):

xD += 0.1

    ctrl_pitch.setKD(xD)

if key == ord("l"):

xP -= 0.1

ctrl_pitch.setKP(xP)

    if key == ord("j"):

xI -= 0.1

        ctrl_pitch.setKI(xI)

    if key == ord("k"):

        xD -= 0.1

        ctrl_pitch.setKD(xD)

video.release() pi0.set_servo_pulsewidth(pin_roll, 0) pi0.set_servo_pulsewidth(pin_pitch, 0) pi0.set_servo_pulsewidth(pin_yaw, 0) pi0.write(pinR, 0)

pi0.write(pinG, 0)

pi0.write(pinB, 0)

back

final project

god.