Giter Club home page Giter Club logo

engr421's Introduction

ENGR421 Team 4, Spring 2013

Dean Reading -- Electrical

Emily Dunham -- Software

Minna O'Brien -- Mechanical

Team web site

Note:

As of June 2013, this code base is no longer under active development and will not be tested or maintained. You're welcome to use it (see LICENSE for details) but be warned that it might not work with newer versions of its dependencies.

Laptop software

Vision code written and maintained by edunham unless marked otherwise.

All python code requires OpenCV libraries to run. ymmv with the versions in your package manger; my cv2.version is Rev 4557

Arduino software

Arduino code written and maintained by Dean Reading unless marked otherwise.

The .ino files require the Arduino IDE thing to run, which is named arduino and can be installed from one's package manager.

Wiring Notes

Yellow is to 12V, red is to 5V. Do not plug it in backwards or the board will fry .

To Run Program

Calibrate the fixed values in Crossfire_Program.ino such that the shooters point straight ahead when the laptop sends them 90 degrees. Verify that they don't fall off the board at max left and max right. Plug in all the wires to the correct pins, determined by reading the Arduino program's source.

Invoke main.py with l, c, and r for left, right, and center shooters -- give it the letters of the ones you want in this game, separated by spaces. Also indicate whether to use new or old strategy. If Arduino is not plugged in, pass 'fake'. Thus:

$ python main.py l c r new

will run it. On the still image, click top left, bottom left, top right, and bottom right intersections between robot line and edge of board. Any keystroke while the program is running will cause it to abort.

If auto-threshholding is enabled (the cam.adj_thresh() line in main.py isn't commented out), the program will seek the best threshhold for detecting 2 pucks under the current lighting conditions. If lighting is uneven, try lowering the second argument to adj_thresh. If lighting is consistent across the field, a higher stability value will be required.

engr421's People

Contributors

deanisme avatar

Watchers

 avatar

engr421's Issues

error

Traceback (most recent call last):
File "main.py", line 42, in
tactical_shoot(shooterlist, targets)
File "main.py", line 22, in tactical_shoot
s.shoot(target)
File "/home/miea/school/engr421/engr421/shooters.py", line 59, in shoot
self.aim(target)
File "/home/miea/school/engr421/engr421/shooters.py", line 52, in aim
self.aimval = self.target2angle(target)
File "/home/miea/school/engr421/engr421/shooters.py", line 26, in target2angle
opp = target[0] - self.xpospx
IndexError: list index out of range

magic numbers for shooters

  • hardcode correct offset (minna should know this by now)
  • guess at positions based on measured field size in image??
    • or figure out whether image-skewing magic takes care of this

todo saturday

  • fake camera that reads image from file during get_frame and uses preset tmat and gutted calibrate
  • modify threshholds if >2 pucks allegedly detected, until exactly 2 are in sight? slower but more reliable... perhaps only if selection strategy is indecisive?
  • proper inheritance for fakearduino, or a clever thing that aliases all functions to a thing that just prints its arguments
  • sleep

barrel pos

click barrel ends during startup to set their actual positions -- if box smaller than field, x pos may vary

Strategy

[ ] each shooter handles pucks in its third
[ ] shoot if puck too close, if almost scoring goal, to keep it from crossing center, or if it's furthest and we have extra shots

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.