Serially connected hinges, base hinge tend to drift...

jimali
Posts: 7
Joined: Thu Feb 07, 2008 8:06 am

Serially connected hinges, base hinge tend to drift...

Post by jimali »

Hi,

i use a series of hingeConstraints to represent a robot. My problem is that the base hinge, that is the hinge that fastens to a static body, tends to drift quite far...(see illustration). Do i have to do something specific when attaching to a static body?

This is how i create the constraints.

Code: Select all

Transform3D<> wTchild = Kinematics::WorldTframe(joint,state);
Transform3D<> wTparent = Kinematics::WorldTframe(parentFrame,state);

btTransform frameInA, frameInB;
frameInA.setIdentity(); // the joint allready use z-axis for rotation
frameInB = makeBtTransform( inverse(wTparent) * wTchild ); // calculate transform from parent to joint

btChild->setActivationState(DISABLE_DEACTIVATION);
btParent->setActivationState(DISABLE_DEACTIVATION);

btHingeConstraint *hinge = new btHingeConstraint(*btChild, *btParent, frameInA, frameInB);
hinge->setLimit( joint->getBounds().first, joint->getBounds().second );
hinge->enableAngularMotor(true, 0.0, 10);
m_dynamicsWorld->addConstraint(hinge, true);
_jointToConstraintMap[joint] = hinge;
constraints.push_back(hinge);
thx
You do not have the required permissions to view the files attached to this post.
jimali
Posts: 7
Joined: Thu Feb 07, 2008 8:06 am

Re: Serially connected hinges, base hinge tend to drift...

Post by jimali »

ok, i actually figured it out in the end. It seems that if you connect a rigid body to some fixed body using:

Code: Select all

new btHingeConstraint(*btChild, *btParent, frameInA, frameInB)
instead of just:

Code: Select all

new btHingeConstraint(*btChild,  frameInA)
makes the rigid body btChild drift relative to btParent. Not sure if this is an actual bug but could be nice if the apidoc for the first method mentioned this ;)

cheers jim
bindumol
Posts: 15
Joined: Thu May 08, 2008 9:55 am
Location: India, Kerala

Re: Serially connected hinges, base hinge tend to drift...

Post by bindumol »

Hi,
Please read my doubt if you have time...

This is the first stage of equipment loading is in the picture robotgif2.....
Here i am using bullet and irrlicht for developing my applications....
After rotating 90 degree the top body with respect to the point of the attached pin….then I got it like in picture robotgif1
In this i am using btTranform rotation without using any constraints....
But it is not working properly as i want...
So can you say which are the constraints i can give in between the mainshat,MiddleHinge, Pin and Arm Hinge...



Waiting for your reply
thanks& regards
Bindumol
You do not have the required permissions to view the files attached to this post.