#146 Patch to fix problem with limit and angle wrapping

In_STABLE
open
nobody
Bug Fix (53)
5
2012-09-14
2008-11-21
Remi Ricard
No

Hi,

This patch is here for review.
If no one complains about problem I will patch the code.

  • Patch to fix the wrapping and limit problem for the
    Hinge.
  • Other joint with rotoide motor will be fixed lated.

  • Rename testRotationalLimit to testLimit

  • Create new function testRotationalLimit which handle
    angle wrapping correctly.

  • dxJointSlider::getInfo1 use testLimit

Question:
- Where should the assignment of prevAngle occur to be
only done when necessary
- Now it is always done in getInfo1 even if not needed.
- Should be done in:
- dJointSetParam when param is the loStop or
hiStop and in getInfo2 if limit exits.

Remi

Discussion

  • Remi Ricard

    Remi Ricard - 2008-11-21

    Patch to fix limit problem when angles are wrapping

     
    Attachments
  • Daniel K. O.

    Daniel K. O. - 2008-12-21

    Shouldn't the universal and hinge2 joints use the "rotational" test limit?

     
  • Nobody/Anonymous

    Hi Danilel,

    Yes every joint with a rotoide part should test their rotational limit.

    I did only some joint to get some feedback about the way it is done.

    Since I did not have any feedback I'm assuming this is a good way to go so I will update the patch to include the other joints when I will have time.

    Remi

     
  • Daniel K. O.

    Daniel K. O. - 2008-12-22

    It's not clear to me what the comparisons between "diff" and "(rate*stepsize)" are doing. It seems they should at least include some epsilon tolerance.

    It might not be robust enough to trust the current angle rate to estimate how it moved from "prevAngle" to the current angle. This rate could have changed by the user, or by damping. The "rate" should be the one that produced the actual rotation (that is, the actual angular displacement), obtainned inside dxStepBody (right after the angular velocity cap).

     
  • vlat

    vlat - 2010-03-20

    changes in joint.cpp in below function for corection lostop and histop limits and do not create new function, only fix small bug

    int dxJointLimitMotor::testRotationalLimit (dReal angle)
    {
    if (angle <= lostop) {
    limit = 1;
    limit_err = angle - lostop;
    if(limit_err<-M_PI)
    {
    limit = 2;
    limit_err = (angle-lostop)+2*M_PI;
    }

    return 1;
    }
    else if (angle >= histop) {
    limit = 2;
    limit_err = angle - histop;
    if(limit_err>M_PI)
    {
    limit = 1;
    limit_err = (angle - histop)-2*M_PI;
    }
    return 1;
    }
    else {
    limit = 0;
    return 0;
    }
    }
    lostop and histop must be -pi to pi
    It is necessary for correct change lostop and histop limits in significances near -pi and pi

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks