From 1feb81463a6345c978c1dedde53e830f5477723f Mon Sep 17 00:00:00 2001 From: Jingyu Chen Date: Thu, 9 Dec 2021 14:21:03 -0500 Subject: [PATCH] change reduced deformable example set up in pybullet --- examples/SharedMemory/PhysicsServerCommandProcessor.cpp | 9 ++++++++- examples/pybullet/examples/reduced_deformable_cube.py | 5 +++-- examples/pybullet/examples/reduced_deformable_torus.py | 5 +++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp index e42a65da0..b830cbcbb 100644 --- a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp +++ b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp @@ -2791,7 +2791,14 @@ void PhysicsServerCommandProcessor::createEmptyDynamicsWorld(int flags) m_data->m_dynamicsWorld->getSolverInfo().m_frictionERP = 0.2; //need to check if there are artifacts with frictionERP m_data->m_dynamicsWorld->getSolverInfo().m_linearSlop = 0.00001; m_data->m_dynamicsWorld->getSolverInfo().m_numIterations = 50; - m_data->m_dynamicsWorld->getSolverInfo().m_minimumSolverBatchSize = 0; + if (flags & RESET_USE_REDUCED_DEFORMABLE_WORLD) + { + m_data->m_dynamicsWorld->getSolverInfo().m_minimumSolverBatchSize = 128; + } + else + { + m_data->m_dynamicsWorld->getSolverInfo().m_minimumSolverBatchSize = 0; + } m_data->m_dynamicsWorld->getSolverInfo().m_warmstartingFactor = 0.1; gDbvtMargin = btScalar(0); m_data->m_dynamicsWorld->getSolverInfo().m_leastSquaresResidualThreshold = 1e-7; diff --git a/examples/pybullet/examples/reduced_deformable_cube.py b/examples/pybullet/examples/reduced_deformable_cube.py index 104cbad76..87b5fd44f 100644 --- a/examples/pybullet/examples/reduced_deformable_cube.py +++ b/examples/pybullet/examples/reduced_deformable_cube.py @@ -14,9 +14,10 @@ p.setGravity(0, 0, -10) tex = p.loadTexture("uvmap.png") planeId = p.loadURDF("plane.urdf", [0,0,-2]) -# p.startStateLogging(p.STATE_LOGGING_VIDEO_MP4, "reduced_cube.mp4") +boxId = p.loadURDF("cube.urdf", [1,1,10],useMaximalCoordinates = True) + +p.startStateLogging(p.STATE_LOGGING_VIDEO_MP4, "reduced_cube.mp4") cube = p.loadURDF("reduced_cube/reduced_cube.urdf", [1,1,1]) -# cube = p.loadURDF("reduced_cube/deform_cube.urdf", [1,1,1]) p.changeVisualShape(cube, -1, rgbaColor=[1,1,1,1], textureUniqueId=tex, flags=0) p.setPhysicsEngineParameter(sparseSdfVoxelSize=0.25) p.setRealTimeSimulation(0) diff --git a/examples/pybullet/examples/reduced_deformable_torus.py b/examples/pybullet/examples/reduced_deformable_torus.py index 4e79469ce..ce145b264 100644 --- a/examples/pybullet/examples/reduced_deformable_torus.py +++ b/examples/pybullet/examples/reduced_deformable_torus.py @@ -6,7 +6,6 @@ physicsClient = p.connect(p.GUI) p.setAdditionalSearchPath(pybullet_data.getDataPath()) -# p.resetSimulation(p.RESET_USE_DEFORMABLE_WORLD) p.resetSimulation(p.RESET_USE_REDUCED_DEFORMABLE_WORLD) p.resetDebugVisualizerCamera(4,-40,-30,[0, 0, 0]) p.setGravity(0, 0, -10) @@ -14,7 +13,9 @@ p.setGravity(0, 0, -10) tex = p.loadTexture("uvmap.png") planeId = p.loadURDF("plane.urdf", [0,0,-2]) -# p.startStateLogging(p.STATE_LOGGING_VIDEO_MP4, "reduced_cube.mp4") +boxId = p.loadURDF("cube.urdf", [1,1,3],useMaximalCoordinates = True) + +# p.startStateLogging(p.STATE_LOGGING_VIDEO_MP4, "reduced_torus.mp4") cube = p.loadURDF("reduced_torus/reduced_torus.urdf", [1,1,1]) p.changeVisualShape(cube, -1, rgbaColor=[1,1,1,1], textureUniqueId=tex, flags=0) p.setPhysicsEngineParameter(sparseSdfVoxelSize=0.25)