Ejemplo n.º 1
0
import time
from scrap.util import read_config, wait_till_done, ScrapException, UserInput, read_commands, create_commands
from comm.serialcomm import SerialComm
from scrap.scrapinterface import ScrapInterface
from scrap.ui import UI
from scrap.vision import Vision
import cv2

conf_dict = read_config("conf.txt")
conf_dict["DEBUG"] = int(conf_dict["DEBUG"])

# open video camera
camera_obj = cv2.VideoCapture(int(conf_dict["CAMERA_INDEX"]))
camera_obj.set(3, int(conf_dict["CAMERA_X"]))
camera_obj.set(4, int(conf_dict["CAMERA_Y"]))
# start vision
vision = Vision(conf_dict, camera_obj)
vision.start()
# create ScrapInterface
scrap = ScrapInterface(conf_dict)
# create UI
ui = UI(conf_dict)

# start user input thread
userInput = UserInput()
userInput.start()

keepGoing = True

while keepGoing:
    # wait a little
Ejemplo n.º 2
0
import time
from scrap.util import read_config, wait_till_done, ScrapException, UserInput
from comm.serialcomm import SerialComm
from scrap.scrapinterface import ScrapInterface
from twitch.irc import IRC

conf_dict = read_config("conf.txt")
twitch_dict = read_config("conf-twitch.txt")

# create ScrapInterface

scrap = ScrapInterface(conf_dict)
armIRC = IRC(twitch_dict)

# attempt connection
if not armIRC.connect():
    raise ValueError("could not connect to stream")

# for now, enter x and y coordinate to go to

# start user input thread
userInput = UserInput()
userInput.start()

while True:
    # wait a little
    time.sleep(0.2)
    parse_inputs = []
    twitch_inputs = armIRC.receiveMessages()
    #print twitch_inputs
    if isinstance(twitch_inputs, list):