Esempio n. 1
0
def main():
    signal.signal(signal.SIGINT, signalHandler)

    cfg = JsonConfig()

    logger = logging.getLogger("")
    logger.setLevel(cfg.general.logLevel)

    grid = cv2.imread(cfg.mapData.map, cv2.CV_LOAD_IMAGE_GRAYSCALE)
    lookupTable = np.load(cfg.mapData.dmap)
    gridsize = cfg.map.gridsize
    start = cfg.robosim.start
    delay = cfg.robosim.delay

    serverPort = cfg.robosim.port

    client = Client("", cfg.server.port, BetelbotClientConnection)
    conn = client.connect()

    driver = BetelbotSimDriver(start, grid, gridsize, lookupTable, delay)

    server = RobotServer(connection=RobotConnection, driver=driver, masterConn=conn)
    server.listen(serverPort)

    IOLoop.instance().start()
Esempio n. 2
0
def main():
    signal.signal(signal.SIGINT, signalHandler)

    cfg = JsonConfig()

    logger = logging.getLogger('')
    logger.setLevel(cfg.general.logLevel)

    map = cv2.imread(cfg.mapData.map, cv2.CV_LOAD_IMAGE_GRAYSCALE)
    lookupTable = np.load(cfg.mapData.dmap)

    length = cfg.robot.length

    forwardNoise = cfg.particle.forwardNoise
    turnNoise = cfg.particle.turnNoise
    senseNoise = cfg.particle.senseNoise

    particleTopic = ParticleTopic()

    particleFilter = ParticleFilter(length, map, lookupTable,
        forwardNoise, turnNoise, senseNoise)

    serverPort = cfg.particle.port

    client = Client('', cfg.server.port, BetelbotClientConnection)
    conn = client.connect()

    server = ParticleFilterServer(connection=ParticleFilterConnection,
        masterConn=conn, particleFilter=particleFilter, particleTopic=particleTopic)
    server.listen(serverPort)

    IOLoop.instance().start()
Esempio n. 3
0
def main():
    signal.signal(signal.SIGINT, signalHandler)

    cfg = JsonConfig()

    logger = logging.getLogger("")
    logger.setLevel(cfg.general.logLevel)

    client = Client("", cfg.server.port, BetelbotClientConnection)
    conn = client.connect()

    driverServer = BetelbotDriverServer()
    driverServer.listen(cfg.robot.driverPort)
    driver = BetelbotDriver(cfg.robot.start, cfg.robot.dist, driverServer)

    server = RobotServer(connection=RobotConnection, driver=driver, masterConn=conn)
    server.listen(cfg.robot.port)

    IOLoop.instance().start()
Esempio n. 4
0
def main():
    # Starts up a client connection to publish commands to Betelbot server.

    cfg = JsonConfig()
    topics = getTopicFactory()

    client = Client('', cfg.server.port, BetelbotClientConnection)
    conn = client.connect()

    thread = threading.Thread(target=threadedLoop)
    thread.daemon = True
    thread.start()

    teleop = Teleop(conn, topics, cfg.teleop.location, cfg.teleop.waypoint)
    teleop.printInstructions()
    teleop.run()

    term = NonBlockingTerm()
    term.run(teleop.onInput)
Esempio n. 5
0
def main():
    signal.signal(signal.SIGINT, signalHandler)

    cfg = JsonConfig()

    logger = logging.getLogger('')
    logger.setLevel(cfg.general.logLevel)

    client = Client('', cfg.server.port, BetelbotClientConnection)
    conn = client.connect()
    conn.batchLocate(onBatchLocateResponse,
            [RobotMethod.POWER, RobotMethod.MODE, RobotMethod.STATUS])

    application = web.Application([
        (cfg.websocketServer.socketUri, VisualizerWebSocket, dict(conn=conn)),
    ])

    application.listen(cfg.websocketServer.port)
    IOLoop.instance().start()
Esempio n. 6
0
def main():
    # Start up a Betelbot client and subscribe to all topics. When data is
    # received, print to console.
    #
    # The main purpose of this script is for logging messages.

    signal.signal(signal.SIGINT, signalHandler)

    cfg = JsonConfig()

    logger = logging.getLogger('')
    logger.setLevel(cfg.general.logLevel)

    client = Client('', cfg.server.port, BetelbotClientConnection)
    conn = client.connect()

    topics = getTopics()
    for topic in topics:
        conn.subscribe(topic, onTopicPublished)

    IOLoop.instance().start()
Esempio n. 7
0
def main():

    signal.signal(signal.SIGINT, signalHandler)

    cfg = JsonConfig()

    openByte = cfg.map.open
    grid = cv2.imread(cfg.mapData.grid, cv2.CV_LOAD_IMAGE_GRAYSCALE)

    logger = logging.getLogger('')
    logger.setLevel(cfg.general.logLevel)

    pathfinder = Pathfinder(grid, openByte, euclideanDistance)

    serverPort = cfg.pathfinder.port

    client = Client('', cfg.server.port, BetelbotClientConnection)
    conn = client.connect()

    server = PathfinderServer(connection=PathfinderConnection,
        masterConn=conn, pathfinder=pathfinder)
    server.listen(serverPort)

    IOLoop.instance().start()