mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 08:04:40 +00:00
* Adjustment: Initial CMake reworking.
This commit is contained in:
parent
516163fd5d
commit
d7cdf54661
5394 changed files with 2615532 additions and 8711 deletions
36
Engine/lib/bullet/examples/pybullet/test.py
Normal file
36
Engine/lib/bullet/examples/pybullet/test.py
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
import pybullet
|
||||
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("r2d2.urdf")
|
||||
|
||||
posX=0
|
||||
posY=3
|
||||
posZ=2
|
||||
obj2 = pybullet.loadURDF("kuka_lwr/kuka.urdf",posX,posY,posZ)
|
||||
|
||||
#query the number of joints of the object
|
||||
numJoints = pybullet.getNumJoints(obj)
|
||||
|
||||
print (numJoints)
|
||||
|
||||
#set the gravity acceleration
|
||||
pybullet.setGravity(0,0,-9.8)
|
||||
|
||||
#step the simulation for 5 seconds
|
||||
t_end = time.time() + 5
|
||||
while time.time() < t_end:
|
||||
pybullet.stepSimulation()
|
||||
posAndOrn = pybullet.getBasePositionAndOrientation(obj)
|
||||
print (posAndOrn)
|
||||
|
||||
print ("finished")
|
||||
#remove all objects
|
||||
pybullet.resetSimulation()
|
||||
|
||||
#disconnect from the physics server
|
||||
pybullet.disconnect()
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue