PyBullet IK: backward compatible changes related to joint damping

This commit is contained in:
Erwin Coumans
2018-06-01 23:25:47 -07:00
parent f75e22e37d
commit 39c9ffa4c3

View File

@@ -8166,14 +8166,16 @@ static PyObject* pybullet_calculateInverseKinematics(PyObject* self,
if (szJointDamping > 0) if (szJointDamping > 0)
{ {
if (szJointDamping != dofCount) if (szJointDamping < dofCount)
{ {
PyErr_SetString(SpamError, printf("calculateInverseKinematics: the size of input joint damping values should be equal to the number of degrees of freedom, not using joint damping.");
"calculateInverseKinematics the size of input joint damping values is unequal to the number of degrees of freedom.");
return NULL;
} }
else 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 szInBytes = sizeof(double) * szJointDamping;
int i; int i;
jointDamping = (double*)malloc(szInBytes); jointDamping = (double*)malloc(szInBytes);