How to make Hinge harder and locked exactly on the posision?

Tonmey
Posts: 3
Joined: Sun Apr 05, 2009 5:41 am

How to make Hinge harder and locked exactly on the posision?

Post by Tonmey »

Hi:
I am trying to use Bullet to do a simple simulation of reptile robot. However, after I established the simple skeleton of the reptile, I found the hinge is very soft. I can simply drage the legs, press them to make them out of the degree of the hinge freeddom. They normally back up like sponge. But it is extremely unacceptalbe that if the hinges of the four legs deform after the robot take up some weight.
I have tried to solve this problems by setting the parameters. Like the hinge's limitsoftness, relaxationFactor, and the biasFactor. I don't know what exactly they mean. And they only make things worse.
I just want to make the constraint fixed in a single position and only response in the indicated freedom even driven by other force.
I will try to read the constrain solver by myself. But the deadline is soon comming, I don't have much time to hand up the work. Can anyone do me a favor to fix this problem? I will appreciate that so much.

When I drag the skeleton, the hinge was totally deformed and running on a unexpected freedom.
Image

Thank you for all your attention

Tony
Last edited by Tonmey on Tue May 26, 2009 1:34 am, edited 1 time in total.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: How to make Hinge harder and locked exactly on the posision?

Post by Erwin Coumans »

When I drug the skeleton
Drugging a skeleton ;-) ?

There are some things to try to make constraints more rigid:
  • Make sure to keep the mass of all objects involved very similar, large mass rations are not supported by the constraint solver.
  • Disable collision detection between connected parts
  • Keep the pivot point close to the center of mass (or in the center) of both connected rigid bodies
  • Increase the number of constraint solving iterations (dynaWorld->getSolverInfo().m_numIterations=20)
  • Avoid constraint angle limits close to -PI or PI
We might be able to help improving the constraint setup. Can you share a basic test, so we can have a look to see if we can help making it more stable?
Thanks,
Erwin
Tonmey
Posts: 3
Joined: Sun Apr 05, 2009 5:41 am

Re: How to make Hinge harder and locked exactly on the posision?

Post by Tonmey »

It's so generous for you to help,
I will try to do something to improve with your suggestions. Here I have attached the source files. And I prefer some solution inside the constraints themselves, or I believe the designer will be extremely limited because of such problems.

In fact after I have set up the m_dynamicsWorld->getSolverInfo().m_numIterations=160; The situation becomes much better.

The reptile was consititute of the base, and four legs as the image above Bascially all the names in the file you need to know is just base, upleg, dnleg with HALF_LENGTH and HALF_WIDTH.

I cannot upload the whole workspace to you because the project is totally a modification of the forkLiftDemo, there are numerous unused files in the workspace. And other files are ditributed in the directory. I cannot keep them complete if they are selected indivudually.
However, if you have the demo, just substitue the source file would be OK.
I will add enough comment so that you can read it .

Thanks
Tony
You do not have the required permissions to view the files attached to this post.