20 lines
562 B
Python
20 lines
562 B
Python
import numpy as np
|
|
import os
|
|
from datetime import datetime
|
|
import sys
|
|
|
|
import isaacgym
|
|
from legged_gym.envs import *
|
|
from legged_gym.utils import get_args, task_registry
|
|
import torch
|
|
|
|
def train(args):
|
|
env, env_cfg = task_registry.make_env(name=args.task, args=args)
|
|
ppo_runner, train_cfg = task_registry.make_alg_runner(env=env, name=args.task, args=args)
|
|
ppo_runner.learn(num_learning_iterations=train_cfg.runner.max_iterations, init_at_random_ep_len=True)
|
|
|
|
if __name__ == '__main__':
|
|
args = get_args()
|
|
args.headless = False
|
|
train(args)
|