summaryrefslogtreecommitdiff
path: root/thirdparty/bullet/BulletInverseDynamics/details
diff options
context:
space:
mode:
Diffstat (limited to 'thirdparty/bullet/BulletInverseDynamics/details')
-rw-r--r--thirdparty/bullet/BulletInverseDynamics/details/MultiBodyTreeImpl.cpp33
1 files changed, 30 insertions, 3 deletions
diff --git a/thirdparty/bullet/BulletInverseDynamics/details/MultiBodyTreeImpl.cpp b/thirdparty/bullet/BulletInverseDynamics/details/MultiBodyTreeImpl.cpp
index befbc2e2a4..ec9a562295 100644
--- a/thirdparty/bullet/BulletInverseDynamics/details/MultiBodyTreeImpl.cpp
+++ b/thirdparty/bullet/BulletInverseDynamics/details/MultiBodyTreeImpl.cpp
@@ -479,9 +479,17 @@ int MultiBodyTree::MultiBodyImpl::calculateKinematics(const vecx &q, const vecx
//todo: review
RigidBody &body = m_body_list[m_body_spherical_list[i]];
- body.m_body_T_parent = transformZ(q(body.m_q_index + 2)) *
- transformY(q(body.m_q_index + 1)) *
- transformX(q(body.m_q_index));
+ mat33 T;
+
+ T = transformX(q(body.m_q_index)) *
+ transformY(q(body.m_q_index + 1)) *
+ transformZ(q(body.m_q_index + 2));
+ body.m_body_T_parent = T * body.m_body_T_parent_ref;
+
+ body.m_parent_pos_parent_body(0)=0;
+ body.m_parent_pos_parent_body(1)=0;
+ body.m_parent_pos_parent_body(2)=0;
+
body.m_parent_pos_parent_body = body.m_body_T_parent * body.m_parent_pos_parent_body;
if (type >= POSITION_VELOCITY)
@@ -832,6 +840,25 @@ int MultiBodyTree::MultiBodyImpl::calculateMassMatrix(const vecx &q, const bool
body.m_parent_pos_parent_body = body.m_body_T_parent * body.m_parent_pos_parent_body;
}
+
+ for (idArrayIdx i = 0; i < m_body_spherical_list.size(); i++)
+ {
+ //todo: review
+ RigidBody &body = m_body_list[m_body_spherical_list[i]];
+
+ mat33 T;
+
+ T = transformX(q(body.m_q_index)) *
+ transformY(q(body.m_q_index + 1)) *
+ transformZ(q(body.m_q_index + 2));
+ body.m_body_T_parent = T * body.m_body_T_parent_ref;
+
+ body.m_parent_pos_parent_body(0)=0;
+ body.m_parent_pos_parent_body(1)=0;
+ body.m_parent_pos_parent_body(2)=0;
+
+ body.m_parent_pos_parent_body = body.m_body_T_parent * body.m_parent_pos_parent_body;
+ }
}
for (int i = m_body_list.size() - 1; i >= 0; i--)
{