[ODE] Jitters
Geoff Carlton
gcarlton at iinet.net.au
Tue Nov 9 10:56:10 MST 2004
Oh yeah, the actual problem.. Hmm.
What is the mass? If its very small then even 0.01x the velocity can be
too great a force (I've seen this with very small objects). Try a lower
value for both linear and angular, and see if it fixes it, (e.g. -0.001).
Judging by the results it looks like the -0.01 is providing way too much
force and the object is flying in the opposite direction each frame.
Geoff
Tim Rightnour wrote:
>On 08-Nov-2004 Jon Watte wrote:
>
>
>>Ouch! The problem is that dBodyGetXxxx returns pointers
>>into the actual data used by ODE. You're slamming the actual
>>velocity values kept in the bodies when you do the *= !
>>Just stepping into this with the debugger would probably have
>>shown you this, assuming you're building ODE from source
>>(which you should be doing).
>>
>>Instead, you can change your code to:
>>
>> dBodyAddForce( body, v[0]*-0.01, v[1]*-0.01, v[2]*-0.01 );
>>
>>Same for torque.
>>
>>
>
>So I changed it to:
>
>void apply_damping(dBodyID body) {
> const dReal *v = dBodyGetLinearVel(body);
> const dReal *x = dBodyGetAngularVel(body);
>
> dBodyAddForce(body, v[0]*-0.01, v[1]*-0.01, v[2]*-0.01);
> dBodyAddTorque(body, x[0]*-0.01, x[1]*-0.01, x[2]*-0.01);
>}
>
>And the exact same problem occurs. Body instantly shoots off into oblivion.
>
>OLD sword: pos 1200.00 449.90 1300.00 rot: -0.00 90.00 0.00
>NEW sword: pos 1200.00 454.62 1300.00 rot: -0.00 90.00 0.00
>step
>OLD sword: pos 1200.00 454.62 1300.00 rot: -0.00 90.00 0.00
>NEW sword: pos 1200.00 222.80 1300.00 rot: -0.00 90.00 0.00
>step
>OLD sword: pos 1200.00 222.80 1300.00 rot: -0.00 90.00 0.00
>NEW sword: pos 1200.00 11611.92 1300.00 rot: -0.00 90.00 0.00
>step
>OLD sword: pos 1200.00 11611.92 1300.00 rot: -0.00 90.00 0.00
>NEW sword: pos 1200.00 -547925.38 1300.00 rot: -0.00 90.00 0.00
>
>Groundheight is about 390 at this location. Without the damping, the object
>settles, but jitters forever. Dropping the stepsize from 0.05 to 0.01 didn't
>help, the object will still jitter for hours.
>
>---
>Tim Rightnour <root at garbled.net>
>NetBSD: Free multi-architecture OS http://www.netbsd.org/
>NetBSD supported hardware database: http://mail-index.netbsd.org/cgi-bin/hw.cgi
>_______________________________________________
>ODE mailing list
>ODE at q12.org
>http://q12.org/mailman/listinfo/ode
>
>
>
>
More information about the ODE
mailing list