[ODE] Restoring Force

Patrick Enoch Hendrix_ at gmx.net
Mon Jul 9 15:31:09 MST 2007


Hi,

I think you can add a rotation-limot with histop=lostop=0 and  
maxforce=f. That should do all the work for you. You need to check  
the joint.cpp.
I dont know if the universal joint suports limiting the agnles, but  
you can easily duplicate the joint-type and make up a new joint that  
adds those 2 limots.
Or enhance the universal joint.

Patrick

On 08.07.2007, at 22:06, Tobias Zimmer wrote:

> Hi all!
>
> I'm still working at my brushes and returned to the matter of the
> restoring force.
>
> The restoring forces are mostly calculated over the objects distance
> to the position
> where it should be. But if an object is turning around in space this
> distance isn't fix.
> So I decided to take the way over the angle of the segments in the
> bristles. If the
> angle is zero and the bristle such is not bended the force is zero as
> well. With
> growing angle the force gets bigger. This is the way I programmed it:
>
>
>    dReal force= -0.00000000015;
>    for (i=25; i<100; i++) {
>        dReal angle1 = dJointGetUniversalAngle1(joint[i]);
>        dReal angle2 = dJointGetUniversalAngle2(joint[i]);
>        dBodyAddForce (segment[i],-1*force*sin(angle1),-1*force*sin
> (angle2),0);
>        }
>
>
> Pitily it doesn't really work, the bristles are not returning to
> their position. The
> angles even get values which they are forbidden to get because of the
> hi- and
> lostop-params.
>
> So, any idea, what I did wrong? How would you program a flexible
> "stick"?
> Imagine a carbone bar or something similar. You should be able to
> bend it, but
> it has to return to its straight form after the deformation.
>
> desperate sunday-evening regards,
> Tobias
> _______________________________________________
> ODE mailing list
> ODE at ode.org
> http://ode.org/mailman/listinfo/ode



More information about the ODE mailing list