add simple humanoid_benchmark.py and mjcf file
This commit is contained in:
20
examples/pybullet/examples/humanoid_benchmark.py
Normal file
20
examples/pybullet/examples/humanoid_benchmark.py
Normal 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")
|
||||
Reference in New Issue
Block a user