few fixes in inverse dynamics

This commit is contained in:
erwincoumans
2018-12-19 20:15:30 -08:00
parent 78de1f070f
commit 8e8c3fb315
5 changed files with 35 additions and 3 deletions

View File

@@ -134,6 +134,15 @@ public:
return m_baseCollider;
}
const btMultiBodyLinkCollider *getLinkCollider(int index) const
{
if (index >= 0 && index < getNumLinks())
{
return getLink(index).m_collider;
}
return 0;
}
btMultiBodyLinkCollider *getLinkCollider(int index)
{
if (index >= 0 && index < getNumLinks())

View File

@@ -281,6 +281,8 @@ int MultiBodyTree::addBody(int body_index, int parent_index, JointType joint_typ
break;
case FLOATING:
break;
case SPHERICAL:
break;
default:
bt_id_error_message("unknown joint type %d\n", joint_type);
return -1;
@@ -437,6 +439,16 @@ int MultiBodyTree::finalize()
rigid_body.m_Jac_JT(1) = 0.0;
rigid_body.m_Jac_JT(2) = 0.0;
break;
case SPHERICAL:
// NOTE/TODO: this is not really correct.
// the Jacobians should be 3x3 matrices here !
rigid_body.m_Jac_JR(0) = 0.0;
rigid_body.m_Jac_JR(1) = 0.0;
rigid_body.m_Jac_JR(2) = 0.0;
rigid_body.m_Jac_JT(0) = 0.0;
rigid_body.m_Jac_JT(1) = 0.0;
rigid_body.m_Jac_JT(2) = 0.0;
break;
case FLOATING:
// NOTE/TODO: this is not really correct.
// the Jacobians should be 3x3 matrices here !

View File

@@ -28,6 +28,9 @@ int MultiBodyTree::InitCache::addBody(const int body_index, const int parent_ind
// does not add a degree of freedom
// m_num_dofs+=0;
break;
case SPHERICAL:
m_num_dofs += 3;
break;
case FLOATING:
m_num_dofs += 6;
break;