22 return UNIDIST(GENERATOR);
27 assert(lower_bound <= upper_bound);
28 return (upper_bound - lower_bound) *
uniform01() + lower_bound;
33 auto r = (int)floor(
uniformReal((
double)lower_bound, (
double)(upper_bound)));
34 return (r > upper_bound - 1) ? upper_bound - 1 : r;
44 return NORMALDIST(GENERATOR);
57 Eigen::Vector3d
RNG::uniformRPY(
const Eigen::Vector3d &lbound,
const Eigen::Vector3d &ubound)
88 Eigen::Vector3d
RNG::uniformVec(
const Eigen::Vector3d &lbound,
const Eigen::Vector3d &ubound)
103 Eigen::Vector3d
RNG::gaussianVec(
const Eigen::Vector3d &mean,
const Eigen::Vector3d &stddev)
106 vec[0] =
gaussian(mean[0], stddev[0]);
107 vec[1] =
gaussian(mean[1], stddev[1]);
108 vec[2] =
gaussian(mean[2], stddev[2]);
double uniformReal(double lower_bound, double upper_bound)
Generate a random real within given bounds: [lower_bound, upper_bound)
double uniform01()
Generate a random real in [0,1).
double gaussian(double mean, double stddev)
Generate a random real using a normal distribution with given mean and standard deviation.
bool uniformBool()
Generate a random boolean.
Eigen::Vector3d uniformRPY(const Eigen::Vector3d &lbound, const Eigen::Vector3d &ubound)
Uniform random sampling of Euler roll-pitch-yaw angles within lower bound lbound and upper bound ubou...
Eigen::Vector3d unifromRPY()
Uniform random sampling of Euler roll-pitch-yaw angles, roll, yaw in range [-pi, pi) and pitch in ran...
int uniformInt(int lower_bound, int upper_bound)
Generate a random integer within given bounds: [lower_bound, upper_bound)
void setSeed(unsigned int seed)
Set the random seed of the underlying generator.
Eigen::Vector3d uniformVec(const Eigen::Vector3d &lbound, const Eigen::Vector3d &ubound)
Generate a uniform real vector within given bounds: [lower_bound, upper_bound)
Eigen::Vector3d gaussianVec(const Eigen::Vector3d &mean, const Eigen::Vector3d &stddev)
Generate a random real vector using a normal distribution with given mean and standard deviation.
static const double half_pi
Main namespace. Contains all library classes and functions.