Hello,
In the last few days I have been wondering why my PID position controller doesn't work as nicely as it should with hinges. I finally tracked down my problem to the "btAtan2Fast" function used in the "btHingeConstraint::getHingeAngle".
When I replaced the "btAtan2Fast" call with a simple "atan2" call, my position controller worked like a charm.
I didn't measure it, but it seems that the "btAtan2Fast" function has a precision of +-4 degrees in some situations. My question is: is the speed increase of "btAtan2Fast" really worth the reduction in precision?
Thanks for any insight!
btAtan2Fast too approximate
-
- Posts: 56
- Joined: Sat Mar 08, 2008 12:37 am
Re: btAtan2Fast too approximate
Yes, btAtan2Fast() is not precise.
I replaced it by btAtan2() as of r1833
Hopefully it will not hurt performance (unless you have several thousand of hinges in your scene)
Thanks for pointing on that,
Roman
I replaced it by btAtan2() as of r1833
Hopefully it will not hurt performance (unless you have several thousand of hinges in your scene)
Thanks for pointing on that,
Roman
-
- Posts: 456
- Joined: Tue Dec 25, 2007 1:06 pm
Re: btAtan2Fast too approximate
AFAIK there are still some btAtan2Fast calls in btConeTwistContraint.cpp.rponomarev wrote:
I replaced it by btAtan2() as of r1833
(Or maybe you can temporary replace it in btScalar.h and make it call btAtan2 to avoid these problems, in case somebody will find a better implementation in the future).
Regards,
Flix