How to prevent complex bodies from shaking chaotically

General discussion about Box2D tutorials
Post Reply
ptc79
Posts: 11
Joined: Tue Apr 02, 2013 9:45 pm

How to prevent complex bodies from shaking chaotically

Post by ptc79 » Tue Apr 01, 2014 2:08 pm

Hi, I'm having a problem with chaotic movement when creating a jointed body. I made a ragdoll, similar to the one iforce created in one of his videos. The only difference is that this one is side on, and it only has one leg and one arm at present.

When I rotate the ragdoll in my c++ program, it works fine when rotating anticlockwise. This seems to be because the main body (the torso) pulls the limbs behind it, so there is no 'push back' effect. When I rotate the ragdoll clockwise it exhibits chaotic jerking movement. This is probably because there is some feedback from the limbs pushing back on the torso. Sorry, I don't know the proper technical terms for this. What I would like to know is are there any tricks for overcoming this effect, or lessening it in any way. There is probably no simple way to tackle this issue but I thought I would ask anyway. Thanks.

iforce2d
Site Admin
Posts: 860
Joined: Sat Dec 22, 2012 7:20 pm

Re: How to prevent complex bodies from shaking chaotically

Post by iforce2d » Tue Apr 01, 2014 3:31 pm

Usually this kind of problem comes about because the joints are being forced into a situation from which it is impossible for them to all satisfy their constraints simultaneously. Its a bit hard to guess at the problem from here, but you could try reducing the constraints one by one and see if the problem goes away at some point. A 'constraint' is either a joint itself, or some characteristic of the joint (eg. limits for prismatic/revolute joints).

ptc79
Posts: 11
Joined: Tue Apr 02, 2013 9:45 pm

Re: How to prevent complex bodies from shaking chaotically

Post by ptc79 » Tue Apr 01, 2014 5:25 pm

Thanks for the tip. I worked out what the problem was.

Cheers.

Post Reply