mirror of
https://github.com/bulletphysics/bullet3.git
synced 2026-10-06 00:45:28 +00:00
16 lines
435 B
Python
16 lines
435 B
Python
import pybullet as p
|
|
import pybullet_data
|
|
|
|
p.connect(p.GUI)
|
|
p.setAdditionalSearchPath(pybullet_data.getDataPath())
|
|
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)
|