add integrate.py example
This commit is contained in:
13
examples/pybullet/examples/integrate.py
Normal file
13
examples/pybullet/examples/integrate.py
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import pybullet as p
|
||||||
|
p.connect(p.GUI)
|
||||||
|
cube = p.loadURDF("cube.urdf")
|
||||||
|
frequency = 240
|
||||||
|
timeStep = 1./frequency
|
||||||
|
p.setGravity(0,0,-9.8)
|
||||||
|
p.changeDynamics(cube,-1,linearDamping=0,angularDamping=0)
|
||||||
|
p.setPhysicsEngineParameter(fixedTimeStep = timeStep)
|
||||||
|
for i in range (frequency):
|
||||||
|
p.stepSimulation()
|
||||||
|
pos,orn = p.getBasePositionAndOrientation(cube)
|
||||||
|
print(pos)
|
||||||
|
|
||||||
Reference in New Issue
Block a user