-
Notifications
You must be signed in to change notification settings - Fork 599
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
How to sample uniformly in SO(3) #192
Comments
The discussion is quite interesting... |
Any method that uniformly randomly samples from the 4D hypersphere, treated as a unit quaternion, will be a uniformly random element of SO(3) because of the 2-to-1 mapping from unit quaternions to SO(3). I would be curious to know if the method cited in the Eigen docs is faster than generating a unit quaternion using Marsaglia's method here: http://mathworld.wolfram.com/HyperspherePointPicking.html It would seem to me that Marsaglia's method might be faster due to avoiding the sin and cos. At any rate it must be faster three calls to In my experience, rejection sampling is faster than carefully doing sin and cos, for example, when generating points in a unit disk. |
+💯 for the meme! 😃 |
Look this paper: |
There are serveral realization of SO(3) sampling.
In Sophus, we firstly uniformly sample a point on a sphere (unit rotation axis), then uniformly sample a rotation angle: Sophus::SO3d::sampleUniform()
But in Eigen, Eigen::Quaterniond::unitRandom() is based on http://planning.cs.uiuc.edu/node198.html
Besides, in manif, they generate a random tangent space element and expMap to Lie group: LieGroupBase::setRandom().
Which sampling is better? Or, why doesn't Sophus use the Eigen's realization?
Besides, I also open a discussion in Manif.
The text was updated successfully, but these errors were encountered: