-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'Rofunc-secret/main'
- Loading branch information
Showing
720 changed files
with
345,378 additions
and
3,553 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+1.86 MB
examples/data/hotu2/20240430/BICEP CURL (BOTH ARM)Take 2024-04-30 05.31.46 PM.fbx
Binary file not shown.
Binary file added
BIN
+3.2 MB
examples/data/hotu2/20240430/Bending Bicep (L)Take 2024-04-30 05.22.14 PM.fbx
Binary file not shown.
Binary file added
BIN
+2 MB
examples/data/hotu2/20240430/Bending Elbow (L)Take 2024-04-30 05.21.14 PM.fbx
Binary file not shown.
Binary file added
BIN
+2.17 MB
examples/data/hotu2/20240430/Bending Wrist (BOTH Hand) Take 2024-04-30 05.23.43 PM.fbx
Binary file not shown.
Binary file added
BIN
+2.65 MB
examples/data/hotu2/20240430/Bicep Curl (L)Take 2024-04-30 05.21.44 PM.fbx
Binary file not shown.
Binary file added
BIN
+2 MB
examples/data/hotu2/20240430/Front Shoulder Raise (Both Arm)Take 2024-04-30 05.30.49 PM.fbx
Binary file not shown.
Binary file added
BIN
+2.52 MB
examples/data/hotu2/20240430/Front Shoulder Raises (L)Take 2024-04-30 05.20.14 PM.fbx
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+2.19 MB
examples/data/hotu2/20240430/Lateral Raises (BOTH ARM)Take 2024-04-30 05.31.17 PM.fbx
Binary file not shown.
Binary file added
BIN
+3.29 MB
examples/data/hotu2/20240430/Lateral Raises (L)Take 2024-04-30 05.20.28 PM.fbx
Binary file not shown.
Binary file added
BIN
+1.87 MB
examples/data/hotu2/20240430/Leg Raises (L)Take 2024-04-30 05.33.41 PM.fbx
Binary file not shown.
Binary file added
BIN
+1.72 MB
examples/data/hotu2/20240430/Leg Raises (R)Take 2024-04-30 05.34.22 PM.fbx
Binary file not shown.
Binary file added
BIN
+1.78 MB
...les/data/hotu2/20240430/Moving Wrist Side way (BOTH HAND) Take 2024-04-30 05.24.14 PM.fbx
Binary file not shown.
Binary file added
BIN
+1.41 MB
examples/data/hotu2/20240430/Neck Flexion Take 2024-04-30 05.34.56 PM.fbx
Binary file not shown.
Binary file added
BIN
+1.9 MB
examples/data/hotu2/20240430/Neck Lateral Flexion Take 2024-04-30 05.35.13 PM.fbx
Binary file not shown.
Binary file added
BIN
+8.55 MB
examples/data/hotu2/20240430/Random Movements (Whole Body) Take 2024-04-30 05.35.43 PM.fbx
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+2.37 MB
examples/data/hotu2/20240430/Twisting Wrist (BOTH HAND)Take 2024-04-30 05.24.37 PM.fbx
Binary file not shown.
Binary file added
BIN
+2.27 MB
examples/data/hotu2/20240509/Boxing_Take 2024-05-09 04.19.43 PM_optitrack.fbx
Binary file not shown.
Binary file added
BIN
+415 KB
examples/data/hotu2/20240509/Boxing_Take 2024-05-09 04.19.43 PM_optitrack2themis.npy
Binary file not shown.
Binary file added
BIN
+74.8 KB
...es/data/hotu2/20240509/Boxing_Take 2024-05-09 04.19.43 PM_optitrack2themis_dof_states.npy
Binary file not shown.
Binary file added
BIN
+2.37 MB
examples/data/hotu2/20240509/Chest pressing_Take 2024-05-09 04.21.46 PM_optitrack.fbx
Binary file not shown.
Binary file added
BIN
+437 KB
examples/data/hotu2/20240509/Chest pressing_Take 2024-05-09 04.21.46 PM_optitrack2themis.npy
Binary file not shown.
Binary file added
BIN
+78.7 KB
...hotu2/20240509/Chest pressing_Take 2024-05-09 04.21.46 PM_optitrack2themis_dof_states.npy
Binary file not shown.
Binary file added
BIN
+7.52 MB
examples/data/hotu2/20240509/Finger movememnt_Take 2024-05-09 04.17.53 PM_optitrack.fbx
Binary file not shown.
Binary file added
BIN
+1.52 MB
...les/data/hotu2/20240509/Finger movememnt_Take 2024-05-09 04.17.53 PM_optitrack2themis.npy
Binary file not shown.
Binary file added
BIN
+281 KB
...tu2/20240509/Finger movememnt_Take 2024-05-09 04.17.53 PM_optitrack2themis_dof_states.npy
Binary file not shown.
Binary file added
BIN
+1.94 MB
examples/data/hotu2/20240509/Handshake_Take 2024-05-09 04.20.17 PM_optitrack.fbx
Binary file not shown.
Binary file added
BIN
+343 KB
examples/data/hotu2/20240509/Handshake_Take 2024-05-09 04.20.17 PM_optitrack2themis.npy
Binary file not shown.
Binary file added
BIN
+61.7 KB
...data/hotu2/20240509/Handshake_Take 2024-05-09 04.20.17 PM_optitrack2themis_dof_states.npy
Binary file not shown.
Binary file added
BIN
+1.41 MB
examples/data/hotu2/20240509/Hook_Take 2024-05-09 04.34.03 PM_optitrack.fbx
Binary file not shown.
Binary file added
BIN
+220 KB
examples/data/hotu2/20240509/Hook_Take 2024-05-09 04.34.03 PM_optitrack2themis.npy
Binary file not shown.
Binary file added
BIN
+39.6 KB
...ples/data/hotu2/20240509/Hook_Take 2024-05-09 04.34.03 PM_optitrack2themis_dof_states.npy
Binary file not shown.
Binary file added
BIN
+1.8 MB
examples/data/hotu2/20240509/Jumping_Take 2024-05-09 04.15.38 PM_optitrack.fbx
Binary file not shown.
Binary file added
BIN
+315 KB
examples/data/hotu2/20240509/Jumping_Take 2024-05-09 04.15.38 PM_optitrack2themis.npy
Binary file not shown.
Binary file added
BIN
+56.8 KB
...s/data/hotu2/20240509/Jumping_Take 2024-05-09 04.15.38 PM_optitrack2themis_dof_states.npy
Binary file not shown.
Binary file added
BIN
+3.19 MB
examples/data/hotu2/20240509/Kung fu_Take 2024-05-09 04.19.23 PM_optitrack.fbx
Binary file not shown.
Binary file added
BIN
+612 KB
examples/data/hotu2/20240509/Kung fu_Take 2024-05-09 04.19.23 PM_optitrack2themis.npy
Binary file not shown.
Binary file added
BIN
+110 KB
...s/data/hotu2/20240509/Kung fu_Take 2024-05-09 04.19.23 PM_optitrack2themis_dof_states.npy
Binary file not shown.
Binary file added
BIN
+3.02 MB
examples/data/hotu2/20240509/Leg stretch_Take 2024-05-09 04.21.17 PM_optitrack.fbx
Binary file not shown.
Binary file added
BIN
+576 KB
examples/data/hotu2/20240509/Leg stretch_Take 2024-05-09 04.21.17 PM_optitrack2themis.npy
Binary file not shown.
Binary file added
BIN
+104 KB
...ta/hotu2/20240509/Leg stretch_Take 2024-05-09 04.21.17 PM_optitrack2themis_dof_states.npy
Binary file not shown.
Binary file added
BIN
+3.67 MB
examples/data/hotu2/20240509/Moving box_Take 2024-05-09 04.33.08 PM_optitrack.fbx
Binary file not shown.
Binary file added
BIN
+691 KB
examples/data/hotu2/20240509/Moving box_Take 2024-05-09 04.33.08 PM_optitrack2themis.npy
Binary file not shown.
Binary file added
BIN
+125 KB
...ata/hotu2/20240509/Moving box_Take 2024-05-09 04.33.08 PM_optitrack2themis_dof_states.npy
Binary file not shown.
Binary file added
BIN
+9.46 MB
examples/data/hotu2/20240509/Ramdom (good)_Take 2024-05-09 04.49.16 PM_optitrack.fbx
Binary file not shown.
Binary file added
BIN
+1.85 MB
examples/data/hotu2/20240509/Ramdom (good)_Take 2024-05-09 04.49.16 PM_optitrack2themis.npy
Binary file not shown.
Binary file added
BIN
+342 KB
.../hotu2/20240509/Ramdom (good)_Take 2024-05-09 04.49.16 PM_optitrack2themis_dof_states.npy
Binary file not shown.
Binary file added
BIN
+1.18 MB
examples/data/hotu2/20240509/Slapping_Take 2024-05-09 04.20.43 PM_optitrack.fbx
Binary file not shown.
Binary file added
BIN
+177 KB
examples/data/hotu2/20240509/Slapping_Take 2024-05-09 04.20.43 PM_optitrack2themis.npy
Binary file not shown.
Binary file added
BIN
+31.7 KB
.../data/hotu2/20240509/Slapping_Take 2024-05-09 04.20.43 PM_optitrack2themis_dof_states.npy
Binary file not shown.
Binary file added
BIN
+2.22 MB
examples/data/hotu2/20240509/Squating_Take 2024-05-09 04.21.34 PM_optitrack.fbx
Binary file not shown.
Binary file added
BIN
+403 KB
examples/data/hotu2/20240509/Squating_Take 2024-05-09 04.21.34 PM_optitrack2themis.npy
Binary file not shown.
Binary file added
BIN
+72.5 KB
.../data/hotu2/20240509/Squating_Take 2024-05-09 04.21.34 PM_optitrack2themis_dof_states.npy
Binary file not shown.
Binary file added
BIN
+1.27 MB
examples/data/hotu2/20240509/Thumbs up_Take 2024-05-09 04.33.36 PM_optitrack.fbx
Binary file not shown.
Binary file added
BIN
+191 KB
examples/data/hotu2/20240509/Thumbs up_Take 2024-05-09 04.33.36 PM_optitrack2themis.npy
Binary file not shown.
Binary file added
BIN
+34.3 KB
...data/hotu2/20240509/Thumbs up_Take 2024-05-09 04.33.36 PM_optitrack2themis_dof_states.npy
Binary file not shown.
Binary file added
BIN
+2.28 MB
examples/data/hotu2/20240509/Walking_Take 2024-05-09 04.15.52 PM_optitrack.fbx
Binary file not shown.
Binary file added
BIN
+422 KB
examples/data/hotu2/20240509/Walking_Take 2024-05-09 04.15.52 PM_optitrack2themis.npy
Binary file not shown.
Binary file added
BIN
+76 KB
...s/data/hotu2/20240509/Walking_Take 2024-05-09 04.15.52 PM_optitrack2themis_dof_states.npy
Binary file not shown.
Binary file added
BIN
+1.56 MB
examples/data/hotu2/20240509/Waving hand_Take 2024-05-09 04.20.29 PM_optitrack.fbx
Binary file not shown.
Binary file added
BIN
+260 KB
examples/data/hotu2/20240509/Waving hand_Take 2024-05-09 04.20.29 PM_optitrack2themis.npy
Binary file not shown.
Binary file added
BIN
+46.8 KB
...ta/hotu2/20240509/Waving hand_Take 2024-05-09 04.20.29 PM_optitrack2themis_dof_states.npy
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
motions: | ||
- file: "Boxing_Take 2024-05-09 04.19.43 PM_optitrack2bruce.npy" | ||
weight: 1 | ||
- file: "Chest pressing_Take 2024-05-09 04.21.46 PM_optitrack2bruce.npy" | ||
weight: 1 | ||
- file: "Finger movememnt_Take 2024-05-09 04.17.53 PM_optitrack2bruce.npy" | ||
weight: 1 | ||
- file: "Handshake_Take 2024-05-09 04.20.17 PM_optitrack2bruce.npy" | ||
weight: 1 | ||
- file: "Hook_Take 2024-05-09 04.34.03 PM_optitrack2bruce.npy" | ||
weight: 1 | ||
- file: "Jumping_Take 2024-05-09 04.15.38 PM_optitrack2bruce.npy" | ||
weight: 1 | ||
- file: "Kung fu_Take 2024-05-09 04.19.23 PM_optitrack2bruce.npy" | ||
weight: 1 | ||
- file: "Leg stretch_Take 2024-05-09 04.21.17 PM_optitrack2bruce.npy" | ||
weight: 1 | ||
- file: "Moving box_Take 2024-05-09 04.33.08 PM_optitrack2bruce.npy" | ||
weight: 1 | ||
- file: "Ramdom (good)_Take 2024-05-09 04.49.16 PM_optitrack2bruce.npy" | ||
weight: 1 | ||
- file: "Slapping_Take 2024-05-09 04.20.43 PM_optitrack2bruce.npy" | ||
weight: 1 | ||
- file: "Squating_Take 2024-05-09 04.21.34 PM_optitrack2bruce.npy" | ||
weight: 1 | ||
- file: "Thumbs up_Take 2024-05-09 04.33.36 PM_optitrack2bruce.npy" | ||
weight: 1 | ||
- file: "Waving hand_Take 2024-05-09 04.20.29 PM_optitrack2bruce.npy" | ||
weight: 1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
motions: | ||
- file: "Boxing_Take 2024-05-09 04.19.43 PM_optitrack2h1.npy" | ||
weight: 1 | ||
- file: "Chest pressing_Take 2024-05-09 04.21.46 PM_optitrack2h1.npy" | ||
weight: 1 | ||
- file: "Finger movememnt_Take 2024-05-09 04.17.53 PM_optitrack2h1.npy" | ||
weight: 1 | ||
- file: "Handshake_Take 2024-05-09 04.20.17 PM_optitrack2h1.npy" | ||
weight: 1 | ||
- file: "Hook_Take 2024-05-09 04.34.03 PM_optitrack2h1.npy" | ||
weight: 1 | ||
- file: "Jumping_Take 2024-05-09 04.15.38 PM_optitrack2h1.npy" | ||
weight: 1 | ||
- file: "Kung fu_Take 2024-05-09 04.19.23 PM_optitrack2h1.npy" | ||
weight: 1 | ||
- file: "Leg stretch_Take 2024-05-09 04.21.17 PM_optitrack2h1.npy" | ||
weight: 1 | ||
- file: "Moving box_Take 2024-05-09 04.33.08 PM_optitrack2h1.npy" | ||
weight: 1 | ||
- file: "Ramdom (good)_Take 2024-05-09 04.49.16 PM_optitrack2h1.npy" | ||
weight: 1 | ||
- file: "Slapping_Take 2024-05-09 04.20.43 PM_optitrack2h1.npy" | ||
weight: 1 | ||
- file: "Squating_Take 2024-05-09 04.21.34 PM_optitrack2h1.npy" | ||
weight: 1 | ||
- file: "Thumbs up_Take 2024-05-09 04.33.36 PM_optitrack2h1.npy" | ||
weight: 1 | ||
- file: "Waving hand_Take 2024-05-09 04.20.29 PM_optitrack2h1.npy" | ||
weight: 1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
motions: | ||
- file: "Boxing_Take 2024-05-09 04.19.43 PM_optitrack2hotu.npy" | ||
weight: 1 | ||
- file: "Chest pressing_Take 2024-05-09 04.21.46 PM_optitrack2hotu.npy" | ||
weight: 1 | ||
- file: "Finger movememnt_Take 2024-05-09 04.17.53 PM_optitrack2hotu.npy" | ||
weight: 1 | ||
- file: "Handshake_Take 2024-05-09 04.20.17 PM_optitrack2hotu.npy" | ||
weight: 1 | ||
- file: "Hook_Take 2024-05-09 04.34.03 PM_optitrack2hotu.npy" | ||
weight: 1 | ||
- file: "Jumping_Take 2024-05-09 04.15.38 PM_optitrack2hotu.npy" | ||
weight: 1 | ||
- file: "Kung fu_Take 2024-05-09 04.19.23 PM_optitrack2hotu.npy" | ||
weight: 1 | ||
- file: "Leg stretch_Take 2024-05-09 04.21.17 PM_optitrack2hotu.npy" | ||
weight: 1 | ||
- file: "Moving box_Take 2024-05-09 04.33.08 PM_optitrack2hotu.npy" | ||
weight: 1 | ||
- file: "Ramdom (good)_Take 2024-05-09 04.49.16 PM_optitrack2hotu.npy" | ||
weight: 1 | ||
- file: "Slapping_Take 2024-05-09 04.20.43 PM_optitrack2hotu.npy" | ||
weight: 1 | ||
- file: "Squating_Take 2024-05-09 04.21.34 PM_optitrack2hotu.npy" | ||
weight: 1 | ||
- file: "Thumbs up_Take 2024-05-09 04.33.36 PM_optitrack2hotu.npy" | ||
weight: 1 | ||
- file: "Waving hand_Take 2024-05-09 04.20.29 PM_optitrack2hotu.npy" | ||
weight: 1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
motions: | ||
- file: "Boxing_Take 2024-05-09 04.19.43 PM_optitrack2walker.npy" | ||
weight: 1 | ||
- file: "Chest pressing_Take 2024-05-09 04.21.46 PM_optitrack2walker.npy" | ||
weight: 1 | ||
- file: "Finger movememnt_Take 2024-05-09 04.17.53 PM_optitrack2walker.npy" | ||
weight: 1 | ||
- file: "Handshake_Take 2024-05-09 04.20.17 PM_optitrack2walker.npy" | ||
weight: 1 | ||
- file: "Hook_Take 2024-05-09 04.34.03 PM_optitrack2walker.npy" | ||
weight: 1 | ||
- file: "Jumping_Take 2024-05-09 04.15.38 PM_optitrack2walker.npy" | ||
weight: 1 | ||
- file: "Kung fu_Take 2024-05-09 04.19.23 PM_optitrack2walker.npy" | ||
weight: 1 | ||
- file: "Leg stretch_Take 2024-05-09 04.21.17 PM_optitrack2walker.npy" | ||
weight: 1 | ||
- file: "Moving box_Take 2024-05-09 04.33.08 PM_optitrack2walker.npy" | ||
weight: 1 | ||
- file: "Ramdom (good)_Take 2024-05-09 04.49.16 PM_optitrack2walker.npy" | ||
weight: 1 | ||
- file: "Slapping_Take 2024-05-09 04.20.43 PM_optitrack2walker.npy" | ||
weight: 1 | ||
- file: "Squating_Take 2024-05-09 04.21.34 PM_optitrack2walker.npy" | ||
weight: 1 | ||
- file: "Thumbs up_Take 2024-05-09 04.33.36 PM_optitrack2walker.npy" | ||
weight: 1 | ||
- file: "Waving hand_Take 2024-05-09 04.20.29 PM_optitrack2walker.npy" | ||
weight: 1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
motions: | ||
- file: "Boxing_Take 2024-05-09 04.19.43 PM_optitrack2zju.npy" | ||
weight: 1 | ||
- file: "Chest pressing_Take 2024-05-09 04.21.46 PM_optitrack2zju.npy" | ||
weight: 1 | ||
# - file: "Finger movememnt_Take 2024-05-09 04.17.53 PM_optitrack2zju.npy" | ||
# weight: 1 | ||
- file: "Handshake_Take 2024-05-09 04.20.17 PM_optitrack2zju.npy" | ||
weight: 1 | ||
- file: "Hook_Take 2024-05-09 04.34.03 PM_optitrack2zju.npy" | ||
weight: 1 | ||
- file: "Jumping_Take 2024-05-09 04.15.38 PM_optitrack2zju.npy" | ||
weight: 1 | ||
- file: "Kung fu_Take 2024-05-09 04.19.23 PM_optitrack2zju.npy" | ||
weight: 1 | ||
- file: "Leg stretch_Take 2024-05-09 04.21.17 PM_optitrack2zju.npy" | ||
weight: 1 | ||
- file: "Moving box_Take 2024-05-09 04.33.08 PM_optitrack2zju.npy" | ||
weight: 1 | ||
- file: "Ramdom (good)_Take 2024-05-09 04.49.16 PM_optitrack2zju.npy" | ||
weight: 1 | ||
- file: "Slapping_Take 2024-05-09 04.20.43 PM_optitrack2zju.npy" | ||
weight: 1 | ||
- file: "Squating_Take 2024-05-09 04.21.34 PM_optitrack2zju.npy" | ||
weight: 1 | ||
- file: "Thumbs up_Take 2024-05-09 04.33.36 PM_optitrack2zju.npy" | ||
weight: 1 | ||
- file: "Waving hand_Take 2024-05-09 04.20.29 PM_optitrack2zju.npy" | ||
weight: 1 | ||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
111 changes: 111 additions & 0 deletions
111
examples/learning_rl/IsaacGym_RofuncRL/example_HumanoidHOTUAMP_RofuncRL.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
""" | ||
HumanoidAMP (RofuncRL) | ||
=========================== | ||
Humanoid backflip/walk/run/dance/hop, trained by RofuncRL | ||
""" | ||
|
||
import isaacgym | ||
import argparse | ||
|
||
from rofunc.config.utils import omegaconf_to_dict, get_config | ||
from rofunc.learning.RofuncRL.tasks import Tasks | ||
from rofunc.learning.RofuncRL.trainers import Trainers | ||
from rofunc.learning.pre_trained_models.download import model_zoo | ||
from rofunc.learning.utils.utils import set_seed | ||
|
||
|
||
def train(custom_args): | ||
# Config task and trainer parameters for Isaac Gym environments | ||
args_overrides = ["task={}".format(custom_args.task), | ||
"train={}{}RofuncRL".format(custom_args.task, custom_args.agent.upper()), | ||
"device_id={}".format(custom_args.sim_device), | ||
"rl_device=cuda:{}".format(custom_args.rl_device), | ||
"headless={}".format(custom_args.headless), | ||
"num_envs={}".format(custom_args.num_envs)] | ||
cfg = get_config('./learning/rl', 'config', args=args_overrides) | ||
cfg.task.env.motion_file = custom_args.motion_file | ||
cfg_dict = omegaconf_to_dict(cfg.task) | ||
|
||
set_seed(cfg.train.Trainer.seed) | ||
|
||
# Instantiate the Isaac Gym environment | ||
env = Tasks().task_map[custom_args.task](cfg=cfg_dict, | ||
rl_device=cfg.rl_device, | ||
sim_device=f'cuda:{cfg.device_id}', | ||
graphics_device_id=cfg.device_id, | ||
headless=cfg.headless, | ||
virtual_screen_capture=cfg.capture_video, # TODO: check | ||
force_render=cfg.force_render) | ||
|
||
# Instantiate the RL trainer | ||
trainer = Trainers().trainer_map[custom_args.agent](cfg=cfg, | ||
env=env, | ||
device=cfg.rl_device, | ||
env_name=custom_args.task) | ||
if custom_args.ckpt_path is not None: | ||
trainer.agent.load_ckpt(custom_args.ckpt_path) | ||
# Start training | ||
trainer.train() | ||
|
||
|
||
def inference(custom_args): | ||
# Config task and trainer parameters for Isaac Gym environments | ||
args_overrides = ["task={}".format(custom_args.task), | ||
"train={}{}RofuncRL".format(custom_args.task, custom_args.agent.upper()), | ||
"device_id={}".format(custom_args.sim_device), | ||
"rl_device=cuda:{}".format(custom_args.rl_device), | ||
"headless={}".format(False), | ||
"num_envs={}".format(16)] | ||
cfg = get_config('./learning/rl', 'config', args=args_overrides) | ||
cfg.task.env.motion_file = custom_args.motion_file | ||
cfg_dict = omegaconf_to_dict(cfg.task) | ||
|
||
set_seed(cfg.train.Trainer.seed) | ||
|
||
# Instantiate the Isaac Gym environment | ||
infer_env = Tasks().task_map[custom_args.task](cfg=cfg_dict, | ||
rl_device=cfg.rl_device, | ||
sim_device=f'cuda:{cfg.device_id}', | ||
graphics_device_id=cfg.device_id, | ||
headless=cfg.headless, | ||
virtual_screen_capture=cfg.capture_video, # TODO: check | ||
force_render=cfg.force_render) | ||
|
||
# Instantiate the RL trainer | ||
trainer = Trainers().trainer_map[custom_args.agent](cfg=cfg, | ||
env=infer_env, | ||
device=cfg.rl_device, | ||
env_name=custom_args.task, | ||
inference=True) | ||
|
||
# load checkpoint | ||
if custom_args.ckpt_path is None: | ||
custom_args.ckpt_path = model_zoo(name=f"{custom_args.task}.pth") | ||
trainer.agent.load_ckpt(custom_args.ckpt_path) | ||
|
||
# Start inference | ||
trainer.inference() | ||
|
||
|
||
if __name__ == '__main__': | ||
gpu_id = 0 | ||
|
||
parser = argparse.ArgumentParser() | ||
# Available tasks: HumanoidAMP_backflip, HumanoidAMP_walk, HumanoidAMP_run, HumanoidAMP_dance, HumanoidAMP_hop | ||
parser.add_argument("--task", type=str, default="HumanoidAMP") | ||
parser.add_argument("--motion_file", type=str, default="/home/ubuntu/Github/HOTU/hotu/data/hotu/011_amp.npy") | ||
parser.add_argument("--agent", type=str, default="amp") # Available agent: amp | ||
parser.add_argument("--num_envs", type=int, default=4096) | ||
parser.add_argument("--sim_device", type=int, default=0) | ||
parser.add_argument("--rl_device", type=int, default=gpu_id) | ||
parser.add_argument("--headless", type=str, default="False") | ||
parser.add_argument("--inference", action="store_true", help="turn to inference mode while adding this argument") | ||
parser.add_argument("--ckpt_path", type=str, | ||
default="/home/ubuntu/Github/SmartEase/Rofunc-secret/examples/learning_rl/IsaacGym_RofuncRL/runs/RofuncRL_AMPTrainer_HumanoidAMP_24-03-26_18-01-15-506194/checkpoints/ckpt_100000.pth") | ||
custom_args = parser.parse_args() | ||
|
||
if not custom_args.inference: | ||
train(custom_args) | ||
else: | ||
inference(custom_args) |
Oops, something went wrong.