Hinge constraint does not sufficiently constrain position

Post Reply
aclong
Posts: 3
Joined: Sat Jan 16, 2010 4:54 am

Hinge constraint does not sufficiently constrain position

Post by aclong »

I'm modeling a robot in Bullet and am having trouble with the fingers. I'm modeling each one as a single cylinder, attached to a common hand body with a hingeConstraint. I've got two fingers on one side of the hand and two on the other, all closing toward the center (so it's kind of like two fingers and two thumbs).

I can enable the motor and turn the fingers as expected, until they touch. That is, when they aren't touching, they rotate about the expected axis where the hand and finger intersect.

If two opposing fingers close and touch each other, the force they exert on each other causes the bases of both fingers (i.e., the part at the axis where they connect to the hand) to move outward. I would like to somehow strengthen the hinge constraint not prevent the base ends of the fingers from translating away from the axis of rotation.

Is this possible? If so, how?

BTW, the reason I'm doing this is that I want to use the fingers to pick up objects, such as cylinders, using friction. If the fingers move around at their bases, this will make picked-up objects move and rotate strangely.

Thanks very much.
eatingdirt
Posts: 8
Joined: Fri Mar 28, 2014 4:42 am

Re: Hinge constraint does not sufficiently constrain positio

Post by eatingdirt »

Did you ever find a solution to your problem? I am attempting something similar (modelling a robot claw) with 2 fingers...each finger made of a hinge constraint and attached to the wrist via a hinge constraint. I hope to be able to pick up and move objects with this but the instability with the hinge joints seems to prevent this. I did discover that creating limbs with more mass seems to stabilize the joint but when you chain a few of these joints together the combined mass drags the limb out of shape. I would be greatly interested in any experience or suggestions you might have.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Hinge constraint does not sufficiently constrain positio

Post by Erwin Coumans »

For robotics use it is best to use the new btMultiBody, connecting links with revolute joints. The algorithm is based on Featherstone Articulated Body Algorithm.
eatingdirt
Posts: 8
Joined: Fri Mar 28, 2014 4:42 am

Re: Hinge constraint does not sufficiently constrain positio

Post by eatingdirt »

Ok...that sounds a good avenue to explore. Is there any more information on this feature beyond the FeatherstoneMultiBodyDemo in the bullet source tree?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Hinge constraint does not sufficiently constrain positio

Post by Erwin Coumans »

You should check out the latest source tree at github, I am working on adding more demos to the 'App_AllBullet2Demos' project that use btMultiBody, including a URDF loader.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Hinge constraint does not sufficiently constrain positio

Post by Erwin Coumans »

You should check out the latest source tree at github, I am working on adding more demos to the 'App_AllBullet2Demos' project that use btMultiBody, including a URDF loader.
eatingdirt
Posts: 8
Joined: Fri Mar 28, 2014 4:42 am

Re: Hinge constraint does not sufficiently constrain positio

Post by eatingdirt »

I will checkout the latest source tree for more examples. Using the FeatherstoneMultiBodyDemo I have managed to get a moving limb with multiple joints inside my existing world. It articulates nicely, thank you for the Featherstone suggestion. Now I have an issue with being able to incorporate the multibody limb with my existing objects.

I am using OSG for rendering and osgBullet at least for my initial go at using bullet within my sim. So far its been very straight forward and many compliments to all the people who have worked on so many layers of these quality libs.

For the MultiBody I have gone directly to the bullet libs as there does not seem to be an interface to this exported through osgBullet (yet).

The problem is I have an existing btRigidBody connected via wheels etc to a btRaycastVehicle that is a moveable platform on which the MultiBody will be "attached"...but I dont see any way to attach the MultiBody to the existing raycast vehicle body. I have set the MultiBody base to be the rigidbody used by the RaycastVehicle....but now there are two systems fighting for control of the one body....the Raycast vehicle wants to move using its applyEngineForce() calls but the MultiBody can also cause the base to move as well and has its own idea of position for the base...how do I keep these in sync. Eventually I would like the ability for the arm to reach forward and push on the ground to lift the base up.

Thanks again.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Hinge constraint does not sufficiently constrain positio

Post by Erwin Coumans »

Further integration of btMultiBody and btRigidBody, in particular attaching constraints between them is work-in-progress. The btRaycastVehicle is a special case: you could replace btRigidBody by btMultiBody in the btRaycastVehicle, and apply the forces/impulses directly to a btMultiBody. If you do this, please consider contributing back the changes to the http://github.com/bulletphysics/bullet3 repository
eatingdirt
Posts: 8
Joined: Fri Mar 28, 2014 4:42 am

Re: Hinge constraint does not sufficiently constrain positio

Post by eatingdirt »

Thanks Erwin, I will investigate further the use of btMultiBody and your suggestion to get it integrated with btRaycastVehicle. For my immediate need I found switching my solver from btSequentialImpulseConstraintSolver to btDantzigSolver dramatically strengthened and stabilized my hinge joints. My next problem to resolve is to get grasping and manipulation working.....this may also take me down the btMultiBody path but I will start a new topic for that question.
Post Reply