From ec25f663c22339d07a4b4d6be56d9a19a98147ce Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Mon, 11 Sep 2017 19:46:54 -0700 Subject: [PATCH] fix getAABB.py on mac osx fix humanoid_benchmark.py and explain how to read/interpret that file in Google Chrome --- examples/pybullet/examples/getAABB.py | 3 ++- examples/pybullet/examples/humanoid_benchmark.py | 12 ++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/examples/pybullet/examples/getAABB.py b/examples/pybullet/examples/getAABB.py index ef1d3ee3f..a43c144e1 100644 --- a/examples/pybullet/examples/getAABB.py +++ b/examples/pybullet/examples/getAABB.py @@ -74,4 +74,5 @@ for i in range (p.getNumJoints(r2d2)): while(1): - a=0 \ No newline at end of file + a=0 + p.stepSimulation() diff --git a/examples/pybullet/examples/humanoid_benchmark.py b/examples/pybullet/examples/humanoid_benchmark.py index 30d479443..5c056cdaa 100644 --- a/examples/pybullet/examples/humanoid_benchmark.py +++ b/examples/pybullet/examples/humanoid_benchmark.py @@ -6,10 +6,10 @@ p.setPhysicsEngineParameter(numSolverIterations=5) p.setPhysicsEngineParameter(fixedTimeStep=1./240.) p.setPhysicsEngineParameter(numSubSteps=1) +p.loadURDF("plane.urdf") + objects = p.loadMJCF("mjcf/humanoid_symmetric.xml") ob = objects[0] -p.resetBasePositionAndOrientation(ob,[0.000000,0.000000,0.000000],[0.000000,0.000000,0.000000,1.000000]) -ob = objects[1] p.resetBasePositionAndOrientation(ob,[0.789351,0.962124,0.113124],[0.710965,0.218117,0.519402,-0.420923]) jointPositions=[ -0.200226, 0.123925, 0.000000, -0.224016, 0.000000, -0.022247, 0.099119, -0.041829, 0.000000, -0.344372, 0.000000, 0.000000, 0.090687, -0.578698, 0.044461, 0.000000, -0.185004, 0.000000, 0.000000, 0.039517, -0.131217, 0.000000, 0.083382, 0.000000, -0.165303, -0.140802, 0.000000, -0.007374, 0.000000 ] for jointIndex in range (p.getNumJoints(ob)): @@ -24,9 +24,13 @@ p.setRealTimeSimulation(0) #now do a benchmark print("Starting benchmark") -logId = p.startStateLogging(p.STATE_LOGGING_PROFILE_TIMINGS,"pybullet_humanoid_timings.json") +fileName = "pybullet_humanoid_timings.json" + +logId = p.startStateLogging(p.STATE_LOGGING_PROFILE_TIMINGS,fileName) for i in range(1000): p.stepSimulation() p.stopStateLogging(logId) -print("ended benchmark") \ No newline at end of file +print("ended benchmark") +print("Use Chrome browser, visit about://tracing, and load the %s file" % fileName) +