示例#1
0
def main():
    conf = parser.parse_args()

    in_path = conf.file_name
    out_path = os.path.join(os.path.dirname(in_path), conf.output)

    with open(in_path, 'r') as yamlfile:
        yaml_bot = yamlfile.read()

    body_spec = get_body_spec(conf)
    brain_spec = get_extended_brain_spec(conf)

    print "converting to protobuf..."
    pb_bot = yaml_to_robot(body_spec, brain_spec, yaml_bot)

    cpg_factory = CPG_Factory(body_spec=body_spec, brain_spec=brain_spec)

    loopback = conf.loopback
    print "Loopback: {0}".format(loopback)

    coupling = conf.coupling
    print "Coupling: {0}".format(coupling)

    cpg_factory.add_CPGs(pb_bot, loopback, coupling)

    print "converting to yaml..."
    yaml_bot = robot_to_yaml(body_spec, brain_spec, pb_bot)

    with open(out_path, 'w') as out_file:
        out_file.write(yaml_bot)

    print "done"
示例#2
0
def main():
    conf = parser.parse_args()

    in_path = conf.file_name
    out_path = os.path.join(os.path.dirname(in_path), conf.output)

    with open(in_path, 'r') as yamlfile:
        yaml_bot = yamlfile.read()

    body_spec = get_body_spec(conf)
    brain_spec = get_brain_spec(conf)

    print "converting to protobuf..."
    pb_bot = yaml_to_robot(body_spec, brain_spec, yaml_bot)

    cpg_factory = CPG_Factory(body_spec=body_spec, brain_spec=brain_spec)
    cpg_factory.add_CPGs(pb_bot, conf.type)

    print "converting to yaml..."
    yaml_bot = robot_to_yaml(body_spec, brain_spec, pb_bot)

    with open(out_path, 'w') as out_file:
        out_file.write(yaml_bot)

    print "done"
示例#3
0
def rty(protobuf):
    return robot_to_yaml(body_spec, brain_spec, protobuf)
示例#4
0
def rty(protobuf):
    return robot_to_yaml(body_spec, brain_spec, protobuf)