From 95a74883106ac7fb7c00a32a359e71c12fc64bf8 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Fri, 13 Sep 2019 07:38:00 -0700 Subject: [PATCH 1/2] PyBullet: fix createMultiBodyBatch.py example --- examples/pybullet/examples/createMultiBodyBatch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/pybullet/examples/createMultiBodyBatch.py b/examples/pybullet/examples/createMultiBodyBatch.py index 3d9597387..dd53d99b0 100644 --- a/examples/pybullet/examples/createMultiBodyBatch.py +++ b/examples/pybullet/examples/createMultiBodyBatch.py @@ -117,14 +117,14 @@ for x in range(32): batchPositions.append( [x * meshScale[0] * 5.5, y * meshScale[1] * 5.5, (0.5 + z) * meshScale[2] * 2.5]) -bodyUid = p.createMultiBody(baseMass=0, +bodyUids = p.createMultiBody(baseMass=0, baseInertialFramePosition=[0, 0, 0], baseCollisionShapeIndex=collisionShapeId, baseVisualShapeIndex=visualShapeId, basePosition=[0, 0, 2], batchPositions=batchPositions, useMaximalCoordinates=True) -p.changeVisualShape(bodyUid, -1, textureUniqueId=texUid) +p.changeVisualShape(bodyUids[0], -1, textureUniqueId=texUid) p.syncBodyInfo() print("numBodies=", p.getNumBodies()) From 275a2aecb0848761634194ce8f9f615b7fbf05f0 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Fri, 13 Sep 2019 09:37:23 -0700 Subject: [PATCH 2/2] fix compile issues --- examples/SharedMemory/PhysicsServerCommandProcessor.cpp | 2 +- src/BulletSoftBody/btDeformableCorotatedForce.h | 2 +- src/BulletSoftBody/btDeformableNeoHookeanForce.h | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp index 03fd8d09d..501b33c63 100644 --- a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp +++ b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp @@ -4005,7 +4005,7 @@ bool PhysicsServerCommandProcessor::processSaveWorldCommand(const struct SharedM FILE* f = fopen(clientCmd.m_sdfArguments.m_sdfFileName, "w"); if (f) { - char line[1024]; + char line[2048]; { sprintf(line, "import pybullet as p\n"); int len = strlen(line); diff --git a/src/BulletSoftBody/btDeformableCorotatedForce.h b/src/BulletSoftBody/btDeformableCorotatedForce.h index d7f18a1dc..13f64ccfa 100644 --- a/src/BulletSoftBody/btDeformableCorotatedForce.h +++ b/src/BulletSoftBody/btDeformableCorotatedForce.h @@ -56,7 +56,7 @@ public: virtual void addScaledElasticForce(btScalar scale, TVStack& force) { int numNodes = getNumNodes(); - btAssert(numNodes <= force.size()) + btAssert(numNodes <= force.size()); btVector3 grad_N_hat_1st_col = btVector3(-1,-1,-1); for (int i = 0; i < m_softBodies.size(); ++i) { diff --git a/src/BulletSoftBody/btDeformableNeoHookeanForce.h b/src/BulletSoftBody/btDeformableNeoHookeanForce.h index 88763e8a1..fe80b372d 100644 --- a/src/BulletSoftBody/btDeformableNeoHookeanForce.h +++ b/src/BulletSoftBody/btDeformableNeoHookeanForce.h @@ -51,7 +51,7 @@ public: virtual void addScaledDampingForce(btScalar scale, TVStack& force) { int numNodes = getNumNodes(); - btAssert(numNodes <= force.size()) + btAssert(numNodes <= force.size()); btVector3 grad_N_hat_1st_col = btVector3(-1,-1,-1); for (int i = 0; i < m_softBodies.size(); ++i) { @@ -114,7 +114,7 @@ public: virtual void addScaledElasticForce(btScalar scale, TVStack& force) { int numNodes = getNumNodes(); - btAssert(numNodes <= force.size()) + btAssert(numNodes <= force.size()); btVector3 grad_N_hat_1st_col = btVector3(-1,-1,-1); for (int i = 0; i < m_softBodies.size(); ++i) { @@ -149,7 +149,7 @@ public: virtual void addScaledDampingForceDifferential(btScalar scale, const TVStack& dv, TVStack& df) { int numNodes = getNumNodes(); - btAssert(numNodes <= df.size()) + btAssert(numNodes <= df.size()); btVector3 grad_N_hat_1st_col = btVector3(-1,-1,-1); for (int i = 0; i < m_softBodies.size(); ++i) { @@ -184,7 +184,7 @@ public: virtual void addScaledElasticForceDifferential(btScalar scale, const TVStack& dx, TVStack& df) { int numNodes = getNumNodes(); - btAssert(numNodes <= df.size()) + btAssert(numNodes <= df.size()); btVector3 grad_N_hat_1st_col = btVector3(-1,-1,-1); for (int i = 0; i < m_softBodies.size(); ++i) {