Skip to content

Commit d8c0b5e

Browse files
committed
Collect all scripts into one place
1 parent e33f37b commit d8c0b5e

5 files changed

Lines changed: 20 additions & 192 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ A pretrained policy (`rainbow_v7`) ships in `checkpoints/`, so this step is opti
7474
your own, use the vendored `legged_gym`:
7575

7676
```bash
77-
python src/legged_gym/scripts/train.py --task hopper # runs saved to logs/hopper/
78-
python src/legged_gym/scripts/play.py --task hopper # visualize the latest run
77+
python scripts/train_policy.py --task hopper # runs saved to logs/hopper/
78+
python scripts/play_policy.py --task hopper # visualize the latest run
7979
```
8080

8181
Training runs are written to `logs/hopper/<timestamp>_<run_name>/`. The codesign config loads

scripts/train_policy.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import numpy as np
2+
import os
3+
from datetime import datetime
4+
5+
import isaacgym
6+
from legged_gym.envs import *
7+
from legged_gym.utils import get_args, task_registry, set_seed
8+
import torch
9+
torch.set_float32_matmul_precision('high')
10+
11+
def train(args):
12+
env, env_cfg = task_registry.make_env(name=args.task, args=args)
13+
ppo_runner, train_cfg = task_registry.make_alg_runner(env=env, name=args.task, args=args)
14+
ppo_runner.learn(num_learning_iterations=train_cfg.runner.max_iterations, init_at_random_ep_len=True)
15+
16+
if __name__ == '__main__':
17+
args = get_args()
18+
train(args)

src/legged_gym/scripts/control_and_play.py

Lines changed: 0 additions & 142 deletions
This file was deleted.

src/legged_gym/scripts/train.py

Lines changed: 0 additions & 48 deletions
This file was deleted.

0 commit comments

Comments
 (0)