I'm using BT to simulate a humanoid robot and I am currently researching fall mitigation strategies. When the robot falls to the ground, I would like to determine the ground reaction force / torque acting on the rigid bodies in the moment of the impact, and the torque acting on the joints (motors) of the robot.
Concerning rigid bodies, I tried to access the forces and toques acting on the bodies like so:
Code: Select all
dynamicsWorld->stepSimulation(config.systemIterationTime, int(5.0 * config.systemIterationTime), 1.0);
foreach (btRigidBody* rb, rigidBodies)
{
qDebug() << rb->getTotalForce().length();
qDebug() << rb->getTotalTorque().length();
}
When it comes to joints (btGeneric6DofConstraint), I found the btGeneric6DofConstraint::getAppliedImpulse() to report some quantity that peaks when bodies collide. I have however no idea what exactly this quantity is nor can I resolve this to torques about the rotational axes of the joint. I found that joint->getRotationalLimitMotor(0)->m_accumulatedImpulse sounds like it could be something of interest, but this field is always zero. Again, can anyone please me point me to a way to retrieve the information I'm looking for?
Thank you,
Marcell