Hello everyone!
Background information: I am working on a robot development project and we are using a special robot simulation software for tendon-driven robots (Caliper) that uses the Bullet Physics Library. Now, my job is to calculate the forces the mechanical structure of the robot will have to withstand (in static as well as dynamic cases). As the robot models will be build for this special robot simulation software, I would like to extract the constraint forces (e.g. at joints) from Bullet.
Question: Is it possible to extract constraint forces from Bullet? If modifications to Bullet will be necessary, have you got some hints for me where I will have to apply modifications?
I would be grateful for help.
Cheers,
Attila
Extraction of constraint forces from BulletPhysics
-
- Posts: 1
- Joined: Tue Oct 30, 2012 1:09 pm
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: Extraction of constraint forces from BulletPhysics
You can use the new btJointFeedback, introduced in Bullet 2.81, it gives access to the force and torque applied to each body.
Code: Select all
btJointFeedback fg;//make sure this variable is not a local variable that goes out-of-scope!
btTypedConstraint* joint = new btHingeConstraint(wheelBody, pivotInA, axisInA);
joint->setJointFeedback(&fb);
world->stepSimulation(...);
btVector3 axisInA(0,1,0);
btScalar appliedImpulse = hinge->getJointFeedback()->m_appliedTorqueBodyA.dot(axisInA);