I am trying to implement the robot as a series of rigid bodies for links, which are connected by btHingeConstraints (similar to say, a ragdoll). Unfortunately, I'm running into issues when connecting the robot's links together using hinge constraints.
What I have from our kinematic simulation is this:
- * The transform of each link in the global world frame (call these t_A and t_B).
* The transform of the joint in the global world frame (call this t_j)
* The axis of the joint in the joint's frame (assumed to be the Z axis)
Code: Select all
bt::HingeConstraintbtHingeConstraint(btRigidBody body1, btRigidBody body2, btTransform rbA, btTransform rbB);
So, I am assuming
- * rbA is the coordinate frame of the joint expressed in the local coordinate frame of body1
* rbB is the coordinate frame of the joint expressed in the local coordinate frame of body2.
Code: Select all
rbA = (t_j).inverse() * t_A;
rbB = (t_j).inverse() * t_B;
Unfortunately, when I do this, the resulting transform of both bodies ends up being Nan after the first update step. Some example output is here:
Code: Select all
04:22:02:820 PM
t_j =
-1 0 0 0.22
0 0 -1 0.14
0 -1 0 0.346
0 0 0 1
t_A =
1 2.44921e-16 0 0.22
-2.44921e-16 1 0 0.14
0 0 1 0.346
0 0 0 1
t_B =
-1 0 0 0.22
0 0 -1 0.14
0 -1 0 0.346
0 0 0 1
rbA =
-1 0 0 0
0 0 -1 0
0 -1 0 0
0 0 0 1
rbB =
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1