control-toolbox icon indicating copy to clipboard operation
control-toolbox copied to clipboard

Make Gaussian and Uniform Noise fully compatible with vectors

Open markusgft opened this issue 5 years ago • 0 comments

@jcarius has proposed the following inspiration

std::default_random_engine generator;
SCALAR mu(0.0);
SCALAR sigma(1.0);
std::normal_distribution<SCALAR> distribution(mu, sigma);
auto normal = [&] (SCALAR)->SCALAR {return distribution(generator);}; // dummy argument required by Eigen

Eigen::Vector3d randVec = Eigen::Vector3d::NullaryExpr(normal);

markusgft avatar May 18 '19 06:05 markusgft