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

Use a stronger source of randomness #1721

Merged
merged 3 commits into from
Nov 17, 2022
Merged

Use a stronger source of randomness #1721

merged 3 commits into from
Nov 17, 2022

Conversation

ChrisThrasher
Copy link
Contributor

@ChrisThrasher ChrisThrasher commented Nov 16, 2022

Description

rsl::rng() seeds a Mersenne twister to the full extent allowed by the <random> API so that we can ensure we're getting the highest quality randomness possible. Using this global random number generator also lets us remove a few member variables that existed for this same purpose.

std::random_shuffle has been deprecated and removed from the standard so I also replaced the remaining uses of that function with std::shuffle.

Checklist

Copy link
Member

@tylerjw tylerjw left a comment

Choose a reason for hiding this comment

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

Looks good, will merge after CI runs.

@ChrisThrasher ChrisThrasher mentioned this pull request Nov 16, 2022
6 tasks
@codecov
Copy link

codecov bot commented Nov 17, 2022

Codecov Report

Base: 50.95% // Head: 50.95% // Decreases project coverage by -0.01% ⚠️

Coverage data is based on head (b638161) compared to base (2dfdad0).
Patch coverage: 46.67% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1721      +/-   ##
==========================================
- Coverage   50.95%   50.95%   -0.00%     
==========================================
  Files         378      378              
  Lines       31643    31658      +15     
==========================================
+ Hits        16122    16128       +6     
- Misses      15521    15530       +9     
Impacted Files Coverage Δ
moveit_ros/moveit_servo/src/servo_calcs.cpp 65.97% <46.67%> (-1.97%) ⬇️
moveit_ros/moveit_servo/src/pose_tracking.cpp 76.78% <0.00%> (-0.47%) ⬇️
...dl_kinematics_plugin/src/kdl_kinematics_plugin.cpp 79.93% <0.00%> (+3.41%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@tylerjw tylerjw merged commit edc4fea into moveit:main Nov 17, 2022
@ChrisThrasher ChrisThrasher deleted the random branch November 17, 2022 21:22
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.

2 participants