def build_world(enable_draw, arg_file): arg_parser = ArgParser() arg_parser.load_file(arg_file) arg_parser.parse_string("motion_file") env = PyBulletDeepMimicEnv(arg_parser=arg_parser, enable_draw=enable_draw) world = RLWorld(env, arg_parser) agent_data = load_agent_data(agent_file) PPOAgent(world=world, id=id, json_data=agent_data) return world
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
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
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
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 while True: