[ODE] Jitters

Jon Watte hplus-ode at mindcontrol.org
Mon Nov 8 15:28:55 MST 2004


You have something else the matter.

Note that the value of the rotation is "90" in all the steps, 
yet your code ought to try to make that rotate towards 0. I 
think the source of your problem is elsewhere.

Are you running collisions? Is this sword held by a character? 
Does the sword collide with the character? Does that generate 
a contact?

Perhaps you could put a data breakpoint where the Y force and 
velocity of that object is updated? Perhaps you could log all 
the joints/contacts that affect the thing?

Cheers,

			/ h+


-----Original Message-----
From: ode-bounces at q12.org [mailto:ode-bounces at q12.org]On Behalf Of Tim
Rightnour
Sent: Monday, November 08, 2004 3:16 PM
To: ODE
Subject: RE: [ODE] Jitters



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