14#include <ompl/geometric/PathGeometric.h>
15#include <ompl/control/PathControl.h>
38 static double evMetric(
const std::vector<Point>& path,
39 bool visualize =
false) {
41 double total_yaw_change = 0;
43 auto prev = path.begin();
46 while (next != path.end()) {
48 if (prev->distance(*current) <= 0) {
52 else if (current->distance(*next) <= 0) {
61 const double yaw_change =
67 total_yaw_change += yaw_change;
75 return total_yaw_change / path_length;
78 static double evaluateMetric(
const ompl::geometric::PathGeometric& trajectory,
79 double,
bool visualize =
false) {
81 return evMetric(path, visualize);
84 static double evaluateMetric(
const ompl::control::PathControl& trajectory,
85 double,
bool visualize =
false) {
87 return evMetric(path, visualize);
90 static const bool MoreIsBetter =
false;
93 static double distance(
double x1,
double y1,
double x2,
double y2) {
94 return std::sqrt(std::pow(x2 - x1, 2.) + std::pow(y2 - y1, 2.));
Definition: AOLMetric.h:21
static double totalLength(const std::vector< Point > &path)
Compute total length of a path.
Definition: PlannerUtils.hpp:499
static double slope(const N &x1, const N &y1, const N &x2, const N &y2)
Compute the angular slope between two points.
Definition: PlannerUtils.hpp:39
static double normalizeAngle(double angle)
Normalize angle in radians to the interval .
Definition: PlannerUtils.hpp:572
Definition: TrajectoryMetric.h:10
double max(const std::vector< double > &values)
Definition: PathStatistics.hpp:79
static std::vector< Point > fromPath(const ompl::geometric::PathGeometric &p, bool interpolate=false)
Definition: Primitives.cpp:25