示例#1
0
def main():
    try:
        client = RemoteClient()

        try:
            client.connect()
        except errors.PortNameRequired, e:
            ports = client.facade.get_ports()
            if not ports:
                logging.critical('No tty to connect to')
            tty = common.pick_one(ports, "Select a port to connect:")

            logging.info('Using serial port %s' % tty)

            client.connect(tty=tty)

        bot = client.bot
示例#2
0
def LocalBot():
    facade = RoombaFacade(None)
    ports = facade.get_ports()

    log.debug('Found serial ports: %s' % unicode(ports))
    #client = common.RoombaClient()

    if not ports:
        raise AssertionError("No serial port found")
    tty = pick_one(ports, "Select a port to connect:")

    logging.info('Using serial port %s' % tty)

    bot = pyrobot.Roomba(tty=tty, baud=115200)

    bot.Control()

    return bot