37 this->originalCSpace = cspace;
38 this->scalingFactors = scale;
39 unscaled.resize(scalingFactors.size());
41 if (
static_cast<std::size_t
>(originalCSpace->getDimensionality()) != scalingFactors.size())
44 s <<
"Different number of scaling factors (" << scalingFactors.size()
45 <<
") than dimensionality of the original cspace(" << originalCSpace->getDimensionality() <<
")";
47 throw std::invalid_argument {
s.str()};
50 if (std::any_of(scalingFactors.begin(), scalingFactors.end(), [](
float f)
56 throw std::invalid_argument {
"One or more factors are <= 0!"};
78 for (
auto& cfg : nodes)
87 for (std::size_t i = 0; i < scalingFactors.size(); ++i)
89 config.at(i) *= scalingFactors.at(i);
95 for (
auto& cfg : path.nodes)
105 return originalCSpace->isCollisionFree(std::make_pair(unscaled.data(), unscaled.data() + unscaled.size()));
111 cloned->scalingFactors = scalingFactors;
112 cloned->originalCSpace = originalCSpace->
clone();
118 FloatRangeSeq bounds = originalCSpace->getDimensionsBounds();
120 for (std::size_t i = 0; i < scalingFactors.size(); ++i)
122 bounds.at(i).min *= scalingFactors.at(i);
123 bounds.at(i).max *= scalingFactors.at(i);
133 for (std::size_t i = 0; i < scalingFactors.size(); ++i)
135 buffer.at(i) = cfg[i] / scalingFactors.at(i);