Example #1
0
    def __init__(self, filename, host, port):
        self._elf_parse = ElfParse(filename)
        self._comms = comms.Comms(host, port)

        self._comms.recv_until(">")
        self._comms.sendall("2\n")
        time.sleep(0.1)
Example #2
0
	def __init__(self):

		self.motors = motors.Motors()
		self.IMU = IMU.IMU()
		self.comms = comms.Comms()
		self.name = self.comms.getHostname()
		self.camera = camera.Camera()

		self.nearbyRobots = set()
		self.knownTargets = set()
Example #3
0
    def __init__(self, sys_settings_fname, device_table_fname):
        self.device_table_fname = device_table_fname
        self.sub_list = [b'new_arp_pkt']
        self.comms = comms.Comms(sys_settings_fname)
        self.comms.set_subscriptions(self.sub_list)

        self.device_list = load_device_table(device_table_fname)
        self.device_lut = update_device_lut(self.device_list)
        self.comms.send_msg('new_table', self.device_list)
        self.last_new_table_pub_t = 0
Example #4
0
File: bot.py Project: r-nba/slapbot
    def __init__(self, botName):
        self.botName = botName

        self.r = reddit.Reddit()
        self.db = database.Database()
        self.comms = comms.Comms(self.db, self.r)

        self.botChannel = self.comms.bot.get_channel('410134097235673089')
        self.botServer = self.comms.bot.get_server('229123661624377345')
        self.pingOnStart = 1
        self.isReady = 0
Example #5
0
    def __init__(self, sys_settings_fname, device_table_fname):
        super().__init__(sys_settings_fname)
        self.device_table_fname = device_table_fname
        self.sub_list = [b'new_table']
        self.comms = comms.Comms(sys_settings_fname)
        self.comms.set_subscriptions(self.sub_list)

        self.device_list = devtbl.load_device_table(device_table_fname)
        self.device_lut = devtbl.update_device_lut(self.device_list)

        self.setup_broadcast_and_direct_intervals(sys_settings_fname)

        self.prev_broadcast_t = 0
        self.prev_direct_arp_t = 0
Example #6
0
    def __init__(self, sys_settings_fname, gs_settings_fname):
        self.sub_list = [b'new_arp_pkt', b'new_table']
        self.comms = comms.Comms(sys_settings_fname)
        self.comms.set_subscriptions(self.sub_list)

        self.gs_settings_fname = gs_settings_fname
        self.load_gs_settings(gs_settings_fname)

        self.open_client(gs_settings_fname)
        self.initialize_device_database()
        self.initialize_arp_database()

        self.arp_data_list = []
        self.last_arp_data_dump = 0
Example #7
0
 def __init__(self, sys_settings_fname=None):
     super().__init__(sys_settings_fname)
     self.comms = comms.Comms(sys_settings_fname)
Example #8
0
from multiprocessing import Process, Queue, Lock
import threading, time
import lights;
import motor;
import comms;

lq = Queue()
mq = Queue()
sq = Queue()

lights = lights.Lights()
motor = motor.Motor()
comms = comms.Comms()

if __name__ == '__main__':
  print("Hello")

  comms_process = Process(target=comms.start, args=( sq, ))
  comms_process.start()

  light_process = Process(target=lights.start, args=( lq, ))
  light_process.start()

  motor_process = Process(target=motor.startController, args=( mq, sq ))
  motor_process.start()

  done = False
  while (not done):
    time.sleep(1)
    command = raw_input("Lights or motor?")
    if command == "lights":