add humanoid and kuka gym environments (experimental)
This commit is contained in:
21
examples/pybullet/gym/kukaGymEnvTest.py
Normal file
21
examples/pybullet/gym/kukaGymEnvTest.py
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
from envs.bullet.kukaGymEnv import KukaGymEnv
|
||||
print ("hello")
|
||||
environment = KukaGymEnv(renders=True)
|
||||
|
||||
|
||||
motorsIds=[]
|
||||
for i in range (len(environment._kuka.motorNames)):
|
||||
motor = environment._kuka.motorNames[i]
|
||||
motorJointIndex = environment._kuka.motorIndices[i]
|
||||
motorsIds.append(environment._p.addUserDebugParameter(motor,-3,3,environment._kuka.jointPositions[i]))
|
||||
|
||||
while (True):
|
||||
|
||||
action=[]
|
||||
for motorId in motorsIds:
|
||||
action.append(environment._p.readUserDebugParameter(motorId))
|
||||
|
||||
state, reward, done, info = environment.step(action)
|
||||
obs = environment.getExtendedObservation()
|
||||
|
||||
Reference in New Issue
Block a user