Example #1
0
def build_arg_parser(args):
    arg_parser = ArgParser()
    arg_parser.load_args(args)

    arg_file = arg_parser.parse_string('arg_file', '')
    if (arg_file != ''):
        path = pybullet_data.getDataPath() + "/args/" + arg_file
        succ = arg_parser.load_file(path)
        Logger.print2(arg_file)
        assert succ, Logger.print2('Failed to load args from: ' + arg_file)
    return arg_parser
Example #2
0
def build_arg_parser(args):
  arg_parser = ArgParser()
  arg_parser.load_args(args)

  arg_file = arg_parser.parse_string('arg_file', '')
  if (arg_file != ''):
    path = pybullet_data.getDataPath() + "/args/" + arg_file
    succ = arg_parser.load_file(path)
    Logger.print2(arg_file)
    assert succ, Logger.print2('Failed to load args from: ' + arg_file)
  return arg_parser
Example #3
0
def main():
    # Command line arguments
    args = sys.argv[1:]
    arg_parser = ArgParser()
    arg_parser.load_args(args)

    num_workers = arg_parser.parse_int('num_workers', 1)
    assert (num_workers > 0)

    Logger.print2('Running with {:d} workers'.format(num_workers))
    cmd = 'mpiexec -n {:d} python3 DeepMimic_Optimizer.py '.format(num_workers)
    cmd += ' '.join(args)
    Logger.print2('cmd: ' + cmd)
    subprocess.call(cmd, shell=True)
Example #4
0
def main():
  # Command line arguments
  args = sys.argv[1:]
  arg_parser = ArgParser()
  arg_parser.load_args(args)

  num_workers = arg_parser.parse_int('num_workers', 1)
  assert (num_workers > 0)

  Logger.print2('Running with {:d} workers'.format(num_workers))
  cmd = 'mpiexec -n {:d} python3 DeepMimic_Optimizer.py '.format(num_workers)
  cmd += ' '.join(args)
  Logger.print2('cmd: ' + cmd)
  subprocess.call(cmd, shell=True)
  return
Example #5
0
def build_arg_parser(args):
    arg_parser = ArgParser()
    arg_parser.load_args(args)

    arg_file = arg_parser.parse_string('arg_file', '')
    if arg_file == '':
        arg_file = "run_humanoid3d_backflip_args.txt"
    if (arg_file != ''):
        path = pybullet_data.getDataPath() + "/args/" + arg_file
        if os.path.isfile(path):
            succ = arg_parser.load_file(path)
        else:
            files = [arg_parser.load_file(f) for f in os.listdir(path) if os.path.isfile(os.path.join(path, f))]
            succ = all(files)
        Logger.print2(arg_file)
        assert succ, Logger.print2('Failed to load args from: ' + arg_file)
    return arg_parser
Example #6
0
import sys
import pybullet_data

from learning.rl_world import RLWorld
from pybullet_utils.arg_parser import ArgParser
from env.pybullet_deep_mimic_gym_env import PyBulletDeepMimicEnv

if __name__ == '__main__':

    enable_draw = True
    timestep = 1. / 240.

    args = sys.argv[1:]

    arg_parser = ArgParser()
    arg_parser.load_args(args)
    arg_file = arg_parser.parse_string('arg_file',
                                       "run_humanoid3d_spinkick_args.txt")
    arg_parser.load_file(pybullet_data.getDataPath() + "/args/" + arg_file)

    motion_file = arg_parser.parse_strings('motion_file')
    fall_contact_bodies = arg_parser.parse_ints("fall_contact_bodies")

    env = PyBulletDeepMimicEnv(motion_file, enable_draw, fall_contact_bodies)
    world = RLWorld(env, arg_parser)

    world.reset()

    total_reward = 0
    steps = 0