work-in-progress (need to add missing data files, fix paths etc)
example:
pip install pybullet
pip install gym
python
import gym
import pybullet
import pybullet_envs
env = gym.make("HumanoidBulletEnv-v0")
22 lines
564 B
Python
22 lines
564 B
Python
|
|
from pybullet_envs.bullet.simpleHumanoidGymEnv import SimpleHumanoidGymEnv
|
|
print ("hello")
|
|
environment = SimpleHumanoidGymEnv(renders=True)
|
|
|
|
environment._p.setGravity(0,0,0)
|
|
|
|
motorsIds=[]
|
|
for motor in environment._humanoid.motor_names:
|
|
motorsIds.append(environment._p.addUserDebugParameter(motor,-1,1,0))
|
|
|
|
while (True):
|
|
|
|
action=[]
|
|
for motorId in motorsIds:
|
|
action.append(environment._p.readUserDebugParameter(motorId))
|
|
|
|
state, reward, done, info = environment.step(action)
|
|
obs = environment.getExtendedObservation()
|
|
print("obs")
|
|
print(obs)
|