add simple humanoid_benchmark.py and mjcf file

This commit is contained in:
Erwin Coumans
2017-05-05 17:24:35 -07:00
parent 09caa599ff
commit 385156cbc5
2 changed files with 138 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
import pybullet as p
import time
p.connect(p.GUI)
p.setGravity(0,0,-10)
p.setPhysicsEngineParameter(numSolverIterations=5)
p.loadMJCF("mjcf/humanoid.xml")
#first let the humanoid fall
p.setRealTimeSimulation(1)
time.sleep(3)
p.setRealTimeSimulation(0)
#now do a benchmark
print("Starting benchmark")
logId = p.startStateLogging(p.STATE_LOGGING_PROFILE_TIMINGS,"pybullet_humanoid_timings.json")
for i in range(1000):
p.stepSimulation()
p.stopStateLogging(logId)
print("ended benchmark")