[ODE] requested fix in joint limit setting function

Jon Watte hplus-ode at mindcontrol.org
Tue Dec 7 16:01:40 MST 2004


I think the right solution is to just update BOTH stops if one stop 
is set to a contradictory value. The idea was not mine, although I 
forget who suggested it. Thus, the solution code would look like:

  case dParamLoStop:
    lostop = value;
    if (value > histop) histop = value;
    break;
  case dParamHiStop:
    histop = value;
    if (value < lostop) lostop = value;
    break;

This is not tested, just written into e-mail, but should be what 
you actually want in these functions.

Cheers,

			/ h+


-----Original Message-----
From: ode-bounces at q12.org [mailto:ode-bounces at q12.org]On Behalf Of Tyler
Streeter
Sent: Tuesday, December 07, 2004 9:46 AM
To: ode at q12.org
Subject: [ODE] requested fix in joint limit setting function


Could someone with CVS access please commit a bug fix for the problem
where joint low/high stops must be set twice?  This problem is bound
to keep confusing new users.  I'll quote Jon Watte since he has
mentioned this numerous times:

"There's a problem where you have to set stops twice, because 
you're not allowed to set stops that even temporarily contradict 
each other. Thus, if the stops start out at 0, and you set the 
low to 2, that will be ignored, because the high is still at 0."

...and here's the problematic code in joint.cpp:

void dxJointLimitMotor::set (int num, dReal value)
{
  switch (num) {
  case dParamLoStop:
    if (value <= histop) lostop = value;
    break;
  case dParamHiStop:
    if (value >= lostop) histop = value;
    break;
...
  }
}

It might need a special setting function that takes both stops at once.

Also, another thing that might help new users (and reduce some of the
mailing list volume) is putting a direct link to the wiki faq in a
more prominent place (e.g. on the ode.org docs page instead of the
ode.org -> community -> ODE wiki area -> faq).

Thanks!

Tyler Streeter
_______________________________________________
ODE mailing list
ODE at q12.org
http://q12.org/mailman/listinfo/ode




More information about the ODE mailing list