fix pybullet inversekinematics argument order (O/i)

add spinning friction to some tutorial
This commit is contained in:
Erwin Coumans
2017-05-12 11:18:33 -07:00
parent 3bcdd29bf5
commit 3bdc60c050
2 changed files with 16 additions and 1 deletions

View File

@@ -36,6 +36,9 @@ static btScalar gBoxRestitution = 0; // set box restitution to 0
static btScalar gSphereFriction = 1; // set sphere friction to 1 static btScalar gSphereFriction = 1; // set sphere friction to 1
static btScalar gSphereRollingFriction = 1; // set sphere rolling friction to 1 static btScalar gSphereRollingFriction = 1; // set sphere rolling friction to 1
static btScalar gSphereSpinningFriction = 0.3; // set sphere spinning friction to 0.3
static btScalar gSphereRestitution = 0; // set sphere restitution to 0 static btScalar gSphereRestitution = 0; // set sphere restitution to 0
@@ -149,6 +152,16 @@ void InclinedPlaneExample::initPhysics()
m_guiHelper->getParameterInterface()->registerSliderFloatParameter(slider); m_guiHelper->getParameterInterface()->registerSliderFloatParameter(slider);
} }
{ // create slider to change the sphere rolling friction
SliderParams slider("Sphere Spinning",&gSphereSpinningFriction);
slider.m_minVal=0;
slider.m_maxVal=2;
slider.m_clampToNotches = false;
slider.m_callback = onSphereRestitutionChanged;
m_guiHelper->getParameterInterface()->registerSliderFloatParameter(slider);
}
{ // create slider to change the sphere restitution { // create slider to change the sphere restitution
SliderParams slider("Sphere Restitution",&gSphereRestitution); SliderParams slider("Sphere Restitution",&gSphereRestitution);
slider.m_minVal=0; slider.m_minVal=0;
@@ -240,6 +253,8 @@ void InclinedPlaneExample::initPhysics()
gSphere->setFriction(gSphereFriction); gSphere->setFriction(gSphereFriction);
gSphere->setRestitution(gSphereRestitution); gSphere->setRestitution(gSphereRestitution);
gSphere->setRollingFriction(gSphereRollingFriction); gSphere->setRollingFriction(gSphereRollingFriction);
gSphere->setSpinningFriction(gSphereSpinningFriction);
} }
m_guiHelper->autogenerateGraphicsObjects(m_dynamicsWorld); m_guiHelper->autogenerateGraphicsObjects(m_dynamicsWorld);

View File

@@ -5521,7 +5521,7 @@ static PyObject* pybullet_calculateInverseKinematics(PyObject* self,
PyObject* jointDampingObj = 0; PyObject* jointDampingObj = 0;
static char* kwlist[] = {"bodyIndex", "endEffectorLinkIndex", "targetPosition", "targetOrientation", "lowerLimits", "upperLimits", "jointRanges", "restPoses", "jointDamping", "physicsClientId", NULL}; static char* kwlist[] = {"bodyIndex", "endEffectorLinkIndex", "targetPosition", "targetOrientation", "lowerLimits", "upperLimits", "jointRanges", "restPoses", "jointDamping", "physicsClientId", NULL};
if (!PyArg_ParseTupleAndKeywords(args, keywds, "iiO|OOOOOiO", kwlist, &bodyIndex, &endEffectorLinkIndex, &targetPosObj, &targetOrnObj, &lowerLimitsObj, &upperLimitsObj, &jointRangesObj, &restPosesObj, &jointDampingObj, &physicsClientId)) if (!PyArg_ParseTupleAndKeywords(args, keywds, "iiO|OOOOOOi", kwlist, &bodyIndex, &endEffectorLinkIndex, &targetPosObj, &targetOrnObj, &lowerLimitsObj, &upperLimitsObj, &jointRangesObj, &restPosesObj, &jointDampingObj, &physicsClientId))
{ {
return NULL; return NULL;
} }