Parasol Planning Library (PPL)
DistanceMetric_UseCase.cpp

This is an example of how to use the distance metric methods.

void DistanceMetricUseCase() {
// Get the distance metric by the XML node label
std::string dmLabel = "Euclidean";
DistanceMetricMethod* distanceMetric = this->GetDistanceMetric(dmLabel);
// The two configurations to calculate the distance from.
CfgType c1, c2;
// The distance function takes as input two configurations, c1 and c2, and
// returns the computed transition distance between them.
double dist = distanceMetric->Distance(c1, c2);
// Desired magnitude by which the directional configuration is scaled.
double length = 0.3;
// Configuration to be scaled.
CfgType c3;
// The ScaleCfg function rescales a configuration vector based on the
// determined distance metric. It scales a directional configuration to a
// certain magnitude using the default origin.
distanceMetric->ScaleCfg(length, c3);
}
Definition: DistanceMetricMethod.h:33
virtual void ScaleCfg(double _length, Cfg &_c, const Cfg &_o)
Definition: DistanceMetricMethod.cpp:66
virtual double Distance(const Cfg &_c1, const Cfg &_c2)=0