Skip to content

Added constrained uniform sampling of angles for SE3, SO3, and Quaternions #139

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

Merged

Conversation

bokorn-bdaii
Copy link
Contributor

@bokorn-bdaii bokorn-bdaii commented Oct 9, 2024

Change Overview

Added constrained uniform sampling of angles for SE3, SO3, and Quaternions based. Samling respects the distribution of orientations at different magnitudes and samples accordingly using the analytical CDF and Inverse Transform Sampling. Interpolation is used for fast inverses of the CDF. Derivation of CDF can be found here: Uniform_Rotation_Distributions.pdf.

Testing Done

Pose based unit tests pass.

Empirically checked distribution against rejection sampling.
image
image
image

Copy link

@neshed-bdai neshed-bdai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good to me, I just found some typos in the comments.

@bokorn-bdaii
Copy link
Contributor Author

@neshed-bdai Fixed all typos mentioned. Thanks for the catch. Spell checker turned off when my VSCode updated.


_eps = np.finfo(np.float64).eps

_NUMBER_CDF_SIN_SQUARED_INTERP_POINTS = 256
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd make these optional arguments to the _compute_cdf_sin_squared function with 256 default and compute the next one in the function?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this result in fixed, discrete number of orientations you can get?

@myeatman-bdai myeatman-bdai merged commit 504f545 into master Oct 11, 2024
15 checks passed
@myeatman-bdai myeatman-bdai deleted the 10-09-Added_constrained_uniform_sampling_of_angles branch October 11, 2024 12:36
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

Successfully merging this pull request may close these issues.

4 participants