Allow to compile pybullet on Windows, using CMake
(got it to run, rename pybullet.dll into pybullet.pyd and copy in c:\python34\dlls) Update test.py Allow to compile pybullet using Python 3.x and 2.7
This commit is contained in:
@@ -1,7 +1,30 @@
|
||||
import pybullet
|
||||
pybullet.loadURDF('r2d2.urdf')
|
||||
pybullet.loadURDF('kuka_lwr/kuka.urdf',3,0,0)
|
||||
import time
|
||||
|
||||
#choose connection method: GUI, DIRECT, SHARED_MEMORY
|
||||
pybullet.connect(pybullet.GUI)
|
||||
|
||||
#load URDF, given a relative or absolute file+path
|
||||
obj = pybullet.loadURDF("C:/develop/bullet3/data/r2d2.urdf")
|
||||
|
||||
#query the number of joints of the object
|
||||
numJoints = pybullet.getNumJoints(obj)
|
||||
|
||||
print (numJoints)
|
||||
|
||||
#set the gravity acceleration
|
||||
pybullet.setGravity(0,0,-0.01)
|
||||
|
||||
#step the simulation for 5 seconds
|
||||
t_end = time.time() + 5
|
||||
while time.time() < t_end:
|
||||
pybullet.stepSimulation()
|
||||
|
||||
print ("finished")
|
||||
#remove all objects
|
||||
pybullet.resetSimulation()
|
||||
|
||||
#disconnect from the physics server
|
||||
pybullet.disconnect()
|
||||
|
||||
for x in range(0, 1000000):
|
||||
pybullet.step()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user