6#include "../TrajectoryMetric.h" 
    8#pragma warning "The SpeedArcLengthMetric is not supported at the moment." 
   11class SpeedArcLengthMetric : 
public TMetric<SpeedArcLengthMetric> {
 
   13  static double evaluateMetric(
const ompl::geometric::PathGeometric &trajectory,
 
   33    unsigned long vsize = trajectory->getV().size();
 
   34    double *vel = 
new double[vsize];
 
   35    for (
auto vi : trajectory->getV()) {
 
   42    for (
int k = 0; k < vsize; k++) {
 
   43      if (vel[k] > vel[maxV]) maxV = k;
 
   52    for (std::size_t i = 0; i < path.size() - 1; i++) {
 
   53      v_x[i] = (path[i + 1].x - path[i].x) / dt;
 
   54      v_y[i] = (path[i + 1].y - path[i].y) / dt;
 
   55      v_x[i] = v_x[i] / Vmax;
 
   56      v_y[i] = v_y[i] / Vmax;
 
   59    for (std::size_t i = 1; i < path.size() - 2; i++) {
 
   60      acc_x[i] = (v_x[i + 1] - v_x[i - 1]) / (2 * dt);
 
   61      acc_y[i] = (v_y[i + 1] - v_y[i - 1]) / (2 * dt);
 
   63      pmetric += (std::sqrt((1 / T) * (1 / T) +
 
   64                            (acc_x[i] * acc_x[i] + acc_y[i] * acc_y[i])) *
 
   69    metric = -std::log(pmetric);
 
Definition: TrajectoryMetric.h:10
 
static std::vector< Point > fromPath(const ompl::geometric::PathGeometric &p, bool interpolate=false)
Definition: Primitives.cpp:25