Bench-MR
A Motion Planning Benchmark for Wheeled Mobile Robots
PathLengthMetric.h
Go to the documentation of this file.
1#pragma once
2
3#include <cmath>
4#include <vector>
5
6#include "TrajectoryMetric.h"
8
9class PathLengthMetric : public TMetric<PathLengthMetric> {
10 public:
11 static double evaluateMetric(const ompl::geometric::PathGeometric &trajectory,
12 double) {
13 std::cout << "Evaluate Metric in geometric space " << std::endl;
14 const auto path = Point::fromPath(trajectory);
15 return PlannerUtils::totalLength(path);
16 }
17
18 static double evaluateMetric(const ompl::control::PathControl &trajectory,
19 double) {
20 std::cout << "Evaluate Metric in control space " << std::endl;
21 const auto path = Point::fromPath(trajectory);
22 return PlannerUtils::totalLength(path);
23 }
24 static const bool MoreIsBetter = false;
25};
Definition: PathLengthMetric.h:9
static double evaluateMetric(const ompl::geometric::PathGeometric &trajectory, double)
Definition: PathLengthMetric.h:11
static double evaluateMetric(const ompl::control::PathControl &trajectory, double)
Definition: PathLengthMetric.h:18
static const bool MoreIsBetter
Definition: PathLengthMetric.h:24
static double totalLength(const std::vector< Point > &path)
Compute total length of a path.
Definition: PlannerUtils.hpp:499
Definition: TrajectoryMetric.h:10
static std::vector< Point > fromPath(const ompl::geometric::PathGeometric &p, bool interpolate=false)
Definition: Primitives.cpp:25