Ejemplo n.º 1
0
                                   config.server_config['zwave_port'])
        elif sensorType == 'ZigBee':
            sensor = ZigBee(config.server_config['udp_listen_port'])
        elif sensorType == 'ZigBeeDirect':
            sensor = ZigBeeDirect(config.server_config['zigbee_usb_port'])
        elif sensorType == 'GEOSystem':
            sensor = GEOSystem(config.server_config['mysql_geo_server'],
                               config.server_config['mysql_geo_user'],
                               config.server_config['mysql_geo_password'],
                               config.server_config['mysql_geo_db'],
                               config.server_config['mysql_geo_query'])

        if sensor != None:
            sensorPollers.append(sensor)
            dataUpdaters.append(
                SensorLog(sensor.channels, sensor.__class__.__name__))

    for sensorPoller in sensorPollers:
        sensorPoller.start()

    for dataUpdater in dataUpdaters:
        dataUpdater.start()

    while True:
        try:
            sys.stdin.read()
        except KeyboardInterrupt:
            break

    for sensorPoller in sensorPollers:
        sensorPoller.stop()
Ejemplo n.º 2
0
            'trayIs': ([
                0,
            ], 'empty')
        }


if __name__ == '__main__':
    """ Run pose and location updates for the currentRobot """
    from robotFactory import Factory
    robot = Factory.getCurrentRobot()

    import locations
    from history import SensorLog
    l = locations.RobotLocationProcessor(robot)
    rp = PoseUpdater(robot)
    sr = SensorLog(rp.channels, rp.robot.name)

    rp.start()
    sr.start()

    l.start()

    while True:
        try:
            sys.stdin.read()
        except KeyboardInterrupt:
            break
    l.stop()

    sr.stop()
    rp.stop()
Ejemplo n.º 3
0
from config import server_config
import sys

if __name__ == '__main__':
    robot = CareOBot()
    z = sensors.ZigBee(server_config['udp_listen_port'])
    g = sensors.GEOSystem(server_config['mysql_geo_server'],
                            server_config['mysql_geo_user'],
                            server_config['mysql_geo_password'],
                            server_config['mysql_geo_db'],
                            server_config['mysql_geo_query'])
    l = locations.RobotLocationProcessor(robot)
    rp = PoseUpdater(robot)

    sz = SensorLog(z.channels, 'ZigBee')
    sg = SensorLog(g.channels, 'GEO')
    sr = SensorLog(rp.channels, rp.robot.name)

    z.start()
    sz.start()

    g.start()
    sg.start()

    rp.start()
    sr.start()
    
    l.start()
    
    while True: