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

Random rotation #100

Closed
versatran01 opened this issue Aug 3, 2017 · 4 comments
Closed

Random rotation #100

versatran01 opened this issue Aug 3, 2017 · 4 comments

Comments

@versatran01
Copy link
Contributor

versatran01 commented Aug 3, 2017

Is there a function that generates a random member of SO3?
Like something described in
Effective sampling and distance metrics for 3d rigid body path planning, J. Kuffner, ICRA 2004.

@strasdat
Copy link
Owner

strasdat commented Aug 7, 2017

There is a simple, well-known method to sample uniformly from a sphere:
Draw x_i from a normal distribution N(0,1), construct a=(x_0, x_1, x_2) and normalize this to vector axis := a/a.norm(). Obviously, if a=0 we need to discard the samples and try again.
[1, Muller, M. E. "A Note on a Method for Generating Points Uniformly on N-Dimensional Spheres." Comm. Assoc. Comput. Mach. 2, 19-20, Apr. 1959.]

Now, axis is our axis of rotation. In addition, we sample theta from (-p, pi] uniformly.
Then SO3::exp(theta * axis) should be a uniform sample on the manifold SO(3), if I'm not mistaken.

@versatran01
Copy link
Contributor Author

Thanks for the answer. I was just wondering if you can add this to the interface?

@strasdat
Copy link
Owner

strasdat commented Aug 7, 2017

Will do.

@strasdat
Copy link
Owner

I implemented this for SO(2) and SO(3). See #114.

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