37 #include "ompl/base/spaces/RealVectorBounds.h"
38 #include "ompl/util/Exception.h"
44 std::fill(
low.begin(),
low.end(), value);
49 std::fill(high.begin(), high.end(), value);
64 unsigned int n = std::min(low.size(), high.size());
65 std::vector<double> result(n);
66 for (
unsigned int i = 0 ; i < n ; ++i)
67 result[i] = high[i] - low[i];
74 unsigned int n = std::min(low.size(), high.size());
75 for (
unsigned int i = 0 ; i < n ; ++i)
77 double d = high[i] - low[i];
85 low.resize(size, 0.0);
86 high.resize(size, 0.0);
91 if (low.size() != high.size())
92 throw Exception(
"Lower and upper bounds are not of same dimension");
93 for (
unsigned int i = 0 ; i < low.size() ; ++i)
95 throw Exception(
"Bounds for real vector space seem to be incorrect (lower bound must be stricly less than upper bound). Sampling will not be possible");
void resize(std::size_t size)
Change the number of dimensions for the bounds.
std::vector< double > low
Lower bound.
void setLow(double value)
Set the lower bound in each dimension to a specific value.
std::vector< double > getDifference(void) const
Get the difference between the high and low bounds for each dimension: result[i] = high[i] - low[i]...
void setHigh(double value)
Set the upper bound in each dimension to a specific value.
double getVolume(void) const
Compute the volume of the space enclosed by the bounds.
void check(void) const
Check if the bounds are valid (same length for low and high, high[i] > low[i]). Throw an exception if...
The exception type for ompl.