# Physics Simulation Forum

 All times are UTC

 Page 1 of 1 [ 1 post ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Joint Motor Torque / ImpulsePosted: Sun Apr 01, 2012 9:44 am

Joined: Sun Apr 01, 2012 6:20 am
Posts: 1
Hi,

I want to get the torque applied by a single rotational motor in a hinge constraint. When I first tried to measure the torque using a btHingeConstraint and reading the m_appliedImpulse member, I realized that the value is the sum of all torques added to the rigid bodies by the constraint. This includes torques to keep up the constraint in all three joint axes (not only the axis of the motor).

Now, I am trying to get the torque/impulse applied by a btRotationalLimitMotor from a btGeneric6DofConstraint. I thought that maybe the m_accumulatedImpulse member of the btRotationalLimitMotor would help me to solve my problem. But it is never updated in Bullet.

I searched the forum for answers to this question and stumbled upon these two posts:

http://bulletphysics.org/Bullet/phpBB3/viewtopic.php?f=9&t=4766

In this post the same problem is discussed but it's not clear if there was a change in the way Bullet reports its joint feedback. I found nothing like the joint feedback of ODE in Bullet and no splitted torque values for constraints.

http://bulletphysics.org/Bullet/phpBB3/viewtopic.php?f=9&t=7849

Quiet the same here: A btGeneric6DofConstraint was used. I tried to set the m_useSolveConstraintObsolete and get the applied impulse computed in btRotationalLimitMotor::solveAngularLimits. But the method doesn't seem to be called ever.
Next I took a look into the btSequentialConstraintSolver and I think the m_appliedImpulse is 'loosing its dimension' in btSequentialImpulseConstraintSolver::resolveSingleConstraintRowGeneric.

Code:
btScalar deltaImpulse = c.m_rhs-btScalar(c.m_appliedImpulse)*c.m_cfm;
const btScalar deltaVel1Dotn   =   c.m_contactNormal.dot(body1.internalGetDeltaLinearVelocity())    + c.m_relpos1CrossNormal.dot(body1.internalGetDeltaAngularVelocity());
const btScalar deltaVel2Dotn   =   -c.m_contactNormal.dot(body2.internalGetDeltaLinearVelocity()) + c.m_relpos2CrossNormal.dot(body2.internalGetDeltaAngularVelocity());

//   const btScalar delta_rel_vel   =   deltaVel1Dotn-deltaVel2Dotn;
deltaImpulse   -=   deltaVel1Dotn*c.m_jacDiagABInv;
deltaImpulse   -=   deltaVel2Dotn*c.m_jacDiagABInv;

const btScalar sum = btScalar(c.m_appliedImpulse) + deltaImpulse;

Unfortunately I am not that deep into the math behind this operation to get a clue where to start to split these values again.

Does anyone experienced the same problem? Is there any feasible solution provided by the current version of Bullet?

Cheers,
Honk

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 1 post ]

 All times are UTC

#### Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 5 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ BULLET PHYSICS LIBRARY USERS    General Bullet Physics Support and Feedback    Release Announcements    Applications, Games, Demos or Movies using Bullet PHYSICS AUTHORING TOOLS, SERIALIZATION AND STANDARDS    Physics authoring tools, serialization, standards and related topics RESEARCH AND DEVELOPMENT IN COLLISION DETECTION & PHYSICS. Don't post Bullet support questions here!    Research and development discussion about Collision Detection and Physics Simulation    Links, Papers, Libraries, Demos, Movies, Comparisons       Non-technical forum and license/patent discussion    Career Opportunities