make setJointPosMultiDof and setJointVelMultiDof argument const.

add PyBullet.resetJointStateMultiDof / getJointStateMultiDof, for preliminary support for spherical and planar joints
This commit is contained in:
erwincoumans
2018-11-10 14:26:31 -08:00
parent 642c6a71d2
commit 17219f84c6
14 changed files with 512 additions and 36 deletions

View File

@@ -149,6 +149,32 @@ bool PhysicsClientSharedMemory::getJointInfo(int bodyUniqueId, int jointIndex, b
if ((jointIndex >= 0) && (jointIndex < bodyJoints->m_jointInfo.size()))
{
info = bodyJoints->m_jointInfo[jointIndex];
switch (info.m_jointType)
{
case eSphericalType:
{
info.m_qSize = 4;//quaterion x,y,z,w
info.m_uSize = 3;
break;
}
case ePlanarType:
{
info.m_qSize = 2;
info.m_uSize = 2;
break;
}
case ePrismaticType:
case eRevoluteType:
{
info.m_qSize = 1;
info.m_uSize = 1;
break;
}
default:
{
}
}
return true;
}
}