Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduced coordinate articulation revolute joint problem #531

Open
zemlifr opened this issue Feb 14, 2022 · 1 comment
Open

Reduced coordinate articulation revolute joint problem #531

zemlifr opened this issue Feb 14, 2022 · 1 comment

Comments

@zemlifr
Copy link

zemlifr commented Feb 14, 2022

Hello, I have reduced coordinate articulation consisting from two links connected by revolute joint with TWIST motion. Root link is connected by fixed joint to RigidBody vehicle.
I am trying to make full circle with their drive, however I have problem, that my application controller gives values from -Pi to Pi, so when gradually changing rotation angle, in one moment target switches from -pi to pi in one step, which introduces huge error which obviously causes huge force applied.

It seems to work fine when I do same using regular rigid bodies and D6 joint with twist axis unlocked.

Is it bug, or I am required to provide values only in <0, 2pi> range?

@kstorey-nvidia
Copy link

kstorey-nvidia commented Feb 28, 2022

The joint positions should operate in the range -2pi to 2pi and the integrator does differentiate between pi and -pi even though they both equate to the same orientation.

If this doesn't suit your needs, you can do a search for pieces of code that look like this:

if (jPos > PxTwoPi)
jPos -= PxTwoPi2.f;
else if (jPos < -PxTwoPi)
jPos += PxTwoPi
2.f;

and remove them.

In PhysX 5, there are two different kinds of revolute joints exposed - one that wraps at +/- 2pi and one that doesn't. For something like a wheel that is expected to spin infinitely, wrapping at 2pi is desirable to avoid hitting numerical issues after the wheel has rotated 1000s of times. However, if you want to simulate a robot with limits such that it can rotate +/- 1080 degrees, then hits a limit, a revolute joint that doesn't wrap at 2pi would be required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants