From 48f0f298128d8eb864b8fb8c9952456fbac45372 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Fri, 27 Oct 2017 18:26:32 -0700 Subject: [PATCH] add integrate.py example --- examples/pybullet/examples/integrate.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 examples/pybullet/examples/integrate.py diff --git a/examples/pybullet/examples/integrate.py b/examples/pybullet/examples/integrate.py new file mode 100644 index 000000000..a4e4deaa2 --- /dev/null +++ b/examples/pybullet/examples/integrate.py @@ -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) +