From 39c9ffa4c358b387868394695f52c48e5850a6f2 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Fri, 1 Jun 2018 23:25:47 -0700 Subject: [PATCH] PyBullet IK: backward compatible changes related to joint damping --- examples/pybullet/pybullet.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/examples/pybullet/pybullet.c b/examples/pybullet/pybullet.c index d6954e0b8..e6c367935 100644 --- a/examples/pybullet/pybullet.c +++ b/examples/pybullet/pybullet.c @@ -8166,14 +8166,16 @@ static PyObject* pybullet_calculateInverseKinematics(PyObject* self, if (szJointDamping > 0) { - if (szJointDamping != dofCount) + if (szJointDamping < dofCount) { - PyErr_SetString(SpamError, - "calculateInverseKinematics the size of input joint damping values is unequal to the number of degrees of freedom."); - return NULL; + printf("calculateInverseKinematics: the size of input joint damping values should be equal to the number of degrees of freedom, not using joint damping."); } else { + if (szJointDamping != dofCount) + { + printf("calculateInverseKinematics: the size of input joint damping values should be equal to the number of degrees of freedom, ignoring the additonal values."); + } int szInBytes = sizeof(double) * szJointDamping; int i; jointDamping = (double*)malloc(szInBytes);