示例#1
0
def setup(robot_config):
    global module
    global ser
       
    module = mod_utils.import_module('hardware', 'serial_board')
    ser = module.setup(robot_config)

    if robot_config.getboolean('tts', 'ext_chat'): #ext_chat enabled, add motor commands
        extended_command.add_command('.set', set_eeprom)
def setup(robot_config):
    global speaker_num
    global module

    speaker_num = robot_config.getint('tts', 'speaker_num')
    # Your custom setup code goes here

    # Load the appropriate tts module and call the default tts setup routine
    module = mod_utils.import_module('tts', robot_config.get('tts', 'type'))
    module.setup(robot_config)
示例#3
0
def setup(robot_config):
    global module
    # Your custom setup code goes here

    # Call the setup handler for max7219 LEDs
    hardware.max7219.setup(robot_config)

    # This code calls the default setup function for your hardware.
    # global module

    #    module = __import__("hardware."+robot_config.get('robot', 'type'), fromlist=[robot_config.get('robot', 'type')])
    module = mod_utils.import_module('hardware',
                                     robot_config.get('robot', 'type'))
    module.setup(robot_config)
示例#4
0
def setup(robot_config):
    global client
    global polly
    global robot_voice
    global users
    global hw_num
    global random_voice
    global fallback_tts
    global messenger

    owner = robot_config.get('robot', 'owner')
    owner_voice = robot_config.get('polly', 'owner_voice')
    robot_voice = robot_config.get('polly', 'robot_voice')
    random_voice = robot_config.getboolean('polly', 'random_voices')

    if robot_config.has_option('tts', 'speaker_num'):
        hw_num = robot_config.get('tts', 'speaker_num')
    else:
        hw_num = robot_config.get('tts', 'hw_num')

    access_key = robot_config.get('polly', 'access_key')
    secrets_key = robot_config.get('polly', 'secrets_key')
    region_name = robot_config.get('polly', 'region_name')
    messenger = robot_config.getboolean('messenger', 'enable')

    client = boto3.Session(aws_access_key_id=access_key,
                           aws_secret_access_key=secrets_key,
                           region_name=region_name)

    polly = boto3.client('polly',
                         aws_access_key_id=access_key,
                         aws_secret_access_key=secrets_key,
                         region_name=region_name)

    users[owner] = owner_voice
    users['jill'] = 'Amy'

    if random_voice:  # random voices enabled
        if robot_config.getboolean(
                'tts', 'ext_chat'):  #ext_chat enabled, add voice command
            import extended_command
            extended_command.add_command('.new_voice', new_voice)

    # Setup the fallback tts
    fallback_tts = mod_utils.import_module('tts', 'espeak')
    fallback_tts.setup(robot_config)