GithubHelp home page GithubHelp logo

averroes / sentryturret Goto Github PK

View Code? Open in Web Editor NEW

This project forked from matt-desmarais/sentryturret

0.0 3.0 0.0 935 KB

A sentry turret style robot which will detect motion, then track and fire at the object. (RaspberryPi + OpenCV python + driver from AdaFruit.)

Python 100.00%

sentryturret's Introduction

SentryTurret

This project licensed under GNU GENERAL PUBLIC LICENSE https://www.gnu.org/licenses/gpl.txt

Attach the Raspberry pi servo hat to the Raspberry pi, x-axis servo on 0 and y-axis servo on 3

connect the relay board to gnd and vin and gpio 24

Raspberry pi and Relay Side View

A sentry turret style robot which will detect motion, then track and fire at the object. The robot's "turret" is rotated by two servos (X/pan axis and Y/tilt axis). The "eye"(webcam) and "gun" of the robot should be mounted on the turret.

Raspberry pi Display

When activated, the robot will initialize an average image and wait to detect motion above a threshold size. It will target the mean HSV of a moving object and begin blob detection to center the camera's view (using turret servos) on the object. When the object is centered, it will fire by using a relay board.

See main.py for further comments.

To run with display: $python main.py 1

The program starts a thread for the turret which is continually updated with target coordinates by the OpenCV frame processing. A separate thread handles terminal keyboard input:

  • q = quit
  • ' ' = reset
  • 1 = start motion detect
  • 2 = sample center for target
  • f/v = +/- threshhold area
  • a,s,d/z,x,c = +/- H,S,V
  • p = toggle armed
  • l/m = +/- target sensitivity
  • f = fire

To use manual control run go to the driver folder and run sudo python manual.py before you run it make sure to install motion and configure it using motion.conf provided

sudo apt-get install motion

sudo nano /etc/default/motion set start_motion_daemon=yes

then copy the motion.conf file to /etc/motion/motion.conf

motion will run on port 8081

Manual Control for Sentry Turret

' ' = reset

w = move up

a = move left

s = move down

d = move right

f = fire

x = trigger buzzers

b = fire left

n = fire right

p = Spray

Add a joystick or xbox contoller for added enjoyment use JoyToKey http://joytokey.net/en/ image

The working example was built on RaspberryPi2 with Raspian and OpenCV(python) 2.4, using GPIO pins connected to a servo hat from adafruit. https://learn.adafruit.com/adafruit-16-channel-pwm-servo-hat-for-raspberry-pi/overview . The 5v relay board is the fire control system

sentryturret's People

Contributors

matt-desmarais avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.