void ompl::control::GridDecomposition::sampleFromRegion(int rid, RNG &rng, std::vector<double> &coord) const { coord.resize(dimension_); const base::RealVectorBounds& regionBounds(getRegionBounds(rid)); for (int i = 0; i < dimension_; ++i) coord[i] = rng.uniformReal(regionBounds.low[i], regionBounds.high[i]); }
static double avgRealsN(double s, double l, const int N) { RNG r; double sum = 0.0; for (int i = 0 ; i < N ; ++i) sum += r.uniformReal(s, l); return sum / (double)N; }