-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
73 lines (63 loc) · 2.92 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import gym
import numpy as np
import CustomGymEnvs
from CustomGymEnvs import FetchReachBaseWrapper, MujocoBaseWrapper, FetchReachGraphWrapper, MujocoGraphNormalWrapper, \
FetchReachBrokenWrapper, Walker2dBrokenWrapper, HopperBrokenWrapper, Walker2dBrokenGraphWrapper, \
HopperBrokenGraphWrapper, HalfCheetahBrokenWrapper
from RobotGraphModel import ModelParser
import os
from pathlib import Path
# env = FetchReachBrokenWrapper('shoulder_pan_joint')
# env = FetchReachBrokenWrapper('shoulder_lift_joint')
# env = FetchReachBrokenWrapper('wrist_flex_joint')
# env = FetchReachBrokenWrapper('wrist_roll_joint')
# env = FetchReachBrokenWrapper('elbow_flex_joint')
# env = FetchReachBrokenWrapper('forearm_roll_joint')
# env = FetchReachBrokenWrapper('upperarm_roll_joint')
# env = gym.make("Walker2d-v2")
# env = Walker2dBrokenWrapper('foot_joint')
# env = Walker2dBrokenWrapper('foot_left_joint')
# env = Walker2dBrokenWrapper('leg_joint')
# env = Walker2dBrokenWrapper('leg_left_joint')
# env = Walker2dBrokenWrapper('thigh_joint')
# env = Walker2dBrokenWrapper('thigh_left_joint')
# env = Walker2dBrokenGraphWrapper('foot_joint')
# env = Walker2dBrokenGraphWrapper('foot_left_joint')
# env = Walker2dBrokenGraphWrapper('leg_joint')
# env = Walker2dBrokenGraphWrapper('leg_left_joint')
# env = Walker2dBrokenGraphWrapper('thigh_joint')
# env = Walker2dBrokenGraphWrapper('thigh_left_joint')
# env = MujocoGraphNormalWrapper('Hopper-v2')
# env = HopperBrokenGraphWrapper('thigh_joint')
# env = HopperBrokenGraphWrapper('foot_joint')
# env = HopperBrokenGraphWrapper('leg_joint')
# env = HalfCheetahBrokenWrapper('ffoot')
# env = HalfCheetahBrokenWrapper('fshin')
# env = HalfCheetahBrokenWrapper('fthigh')
# env = HalfCheetahBrokenWrapper('bfoot')
# env = HalfCheetahBrokenWrapper('bshin')
# env = HalfCheetahBrokenWrapper('bthigh')
# env = FetchReachBaseWrapper(gym.make('FetchReach-v2'))
env.reset()
# print(env.joint_list)
while True:
action = env.action_space.sample()
# action = np.array([0, 0, 0, 0, 0, 0, 1])
obs, reward, _, _ = env.step(action)
# print(obs)
# print(env.sim.data.qpos)
# print(env.sim.data.qvel)
env.render()
# env = FetchReachWrapper(gym.make("FetchReachDense-v1"), 'standard')
# env = FetchReachGraphWrapper(gym.make("FetchReachDense-v1"))
# print(env.observation_space)
# env = MujocoWrapper(gym.make("HalfCheetah-v2"), 'torso')
# env2 = MujocoWrapper(gym.make("HalfCheetahEnv-v0"), 'bfoot')
# env2 = MujocoWrapper(gym.make("HalfCheetahEnv-v0"), 'fthigh')
# env = MujocoWrapper(gym.make("Walker2d-v2"), occluded_joint='foot_left_joint')
# env2 = MujocoWrapper(gym.make("Walker2d-v2"), occluded_joint='leg_left_joint')
# env3 = MujocoWrapper(gym.make("Walker2d-v2"), occluded_joint='thigh_left_joint')
# env4 = MujocoWrapper(gym.make("Walker2d-v2"), occluded_joint='standard')
# env = MujocoGraphWrapper(gym.make('Ant-v2'))
# env2 = MujocoWrapper(gym.make("Walker2d-v2"))
# env2 = MujocoWrapper(gym.make("Walker2d-v2"))