Merge remote-tracking branch 'bp/master'
This commit is contained in:
@@ -3977,7 +3977,13 @@ bool PhysicsServerCommandProcessor::processCommand(const struct SharedMemoryComm
|
|||||||
case ePoint2PointType:
|
case ePoint2PointType:
|
||||||
{
|
{
|
||||||
sprintf(jointTypeStr,"p.JOINT_POINT2POINT");
|
sprintf(jointTypeStr,"p.JOINT_POINT2POINT");
|
||||||
break; }
|
break;
|
||||||
|
}
|
||||||
|
case eGearType:
|
||||||
|
{
|
||||||
|
sprintf(jointTypeStr,"p.JOINT_GEAR");
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
hasKnownJointType = false;
|
hasKnownJointType = false;
|
||||||
@@ -7661,14 +7667,16 @@ bool PhysicsServerCommandProcessor::processCommand(const struct SharedMemoryComm
|
|||||||
|
|
||||||
|
|
||||||
btInverseDynamics::vecx nu(numDofs+baseDofs), qdot(numDofs + baseDofs), q(numDofs + baseDofs), joint_force(numDofs + baseDofs);
|
btInverseDynamics::vecx nu(numDofs+baseDofs), qdot(numDofs + baseDofs), q(numDofs + baseDofs), joint_force(numDofs + baseDofs);
|
||||||
for (int i = 0; i < numDofs; i++)
|
int DofIndex = 0;
|
||||||
{
|
for (int i = 0; i < bodyHandle->m_multiBody->getNumLinks(); ++i) {
|
||||||
q_current[i] = bodyHandle->m_multiBody->getJointPos(i);
|
if (bodyHandle->m_multiBody->getLink(i).m_jointType >= 0 && bodyHandle->m_multiBody->getLink(i).m_jointType <= 2) { // 0, 1, 2 represent revolute, prismatic, and spherical joint types respectively. Skip the fixed joints.
|
||||||
q[i+baseDofs] = bodyHandle->m_multiBody->getJointPos(i);
|
q_current[DofIndex] = bodyHandle->m_multiBody->getJointPos(i);
|
||||||
qdot[i + baseDofs] = 0;
|
q[DofIndex+baseDofs] = bodyHandle->m_multiBody->getJointPos(i);
|
||||||
nu[i+baseDofs] = 0;
|
qdot[DofIndex+baseDofs] = 0;
|
||||||
|
nu[DofIndex+baseDofs] = 0;
|
||||||
|
DofIndex++;
|
||||||
}
|
}
|
||||||
// Set the gravity to correspond to the world gravity
|
} // Set the gravity to correspond to the world gravity
|
||||||
btInverseDynamics::vec3 id_grav(m_data->m_dynamicsWorld->getGravity());
|
btInverseDynamics::vec3 id_grav(m_data->m_dynamicsWorld->getGravity());
|
||||||
|
|
||||||
if (-1 != tree->setGravityInWorldFrame(id_grav) &&
|
if (-1 != tree->setGravityInWorldFrame(id_grav) &&
|
||||||
|
|||||||
Reference in New Issue
Block a user