6#include <nlohmann/json.hpp>
14using namespace params;
17 Property<double>
planning_time{std::numeric_limits<double>::quiet_NaN(),
18 "planning_time",
this};
20 "collision_time",
this};
21 Property<double>
steering_time{std::numeric_limits<double>::quiet_NaN(),
22 "steering_time",
this};
26 Property<double>
path_length{std::numeric_limits<double>::quiet_NaN(),
28 Property<double>
max_curvature{std::numeric_limits<double>::quiet_NaN(),
29 "max_curvature",
this};
31 std::numeric_limits<double>::quiet_NaN(),
"normalized_curvature",
this};
33 std::numeric_limits<double>::quiet_NaN(),
"aol",
this};
34 Property<double>
smoothness{std::numeric_limits<double>::quiet_NaN(),
37 std::numeric_limits<double>::quiet_NaN(),
"mean_clearing_distance",
this};
39 std::numeric_limits<double>::quiet_NaN(),
"median_clearing_distance",
42 std::numeric_limits<double>::quiet_NaN(),
"min_clearing_distance",
this};
44 std::numeric_limits<double>::quiet_NaN(),
"max_clearing_distance",
this};
45 Property<std::string>
planner{
"UNKNOWN",
"planner",
this};
47 Property<std::vector<Point>>
cusps{{},
"cusps",
this};
48 Property<std::vector<Point>>
collisions{{},
"collisions",
this};
57inline double median(std::vector<double> values) {
58 std::sort(values.begin(), values.end());
59 size_t count = values.size();
60 if (count % 2 == 1)
return values[count / 2];
62 double right = values[count / 2];
63 double left = values[count / 2 - 1];
64 return (right + left) / 2.0;
67inline double mean(
const std::vector<double> &values) {
69 for (
double v : values) avg += v;
70 return avg / values.size();
73inline double min(
const std::vector<double> &values) {
75 for (
double v : values) m =
std::min(m, v);
79inline double max(
const std::vector<double> &values) {
81 for (
double v : values) m =
std::max(m, v);
85inline double std(
const std::vector<double> &values) {
87 double m =
mean(values);
88 for (
double v : values) s += std::pow(v - m, 2.);
89 return std::sqrt(1. / values.size() * s);
Definition: PathStatistics.hpp:56
double max(const std::vector< double > &values)
Definition: PathStatistics.hpp:79
double std(const std::vector< double > &values)
Definition: PathStatistics.hpp:85
double min(const std::vector< double > &values)
Definition: PathStatistics.hpp:73
double median(std::vector< double > values)
Definition: PathStatistics.hpp:57
double mean(const std::vector< double > &values)
Definition: PathStatistics.hpp:67
Definition: PathStatistics.hpp:16
Property< double > smoothness
Definition: PathStatistics.hpp:34
Property< std::vector< Point > > collisions
Definition: PathStatistics.hpp:48
Property< bool > path_collides
Definition: PathStatistics.hpp:24
Property< double > normalized_curvature
Definition: PathStatistics.hpp:30
Property< double > planning_time
Definition: PathStatistics.hpp:17
Property< std::vector< Point > > cusps
Definition: PathStatistics.hpp:47
Property< double > max_curvature
Definition: PathStatistics.hpp:28
Property< double > aol
Definition: PathStatistics.hpp:32
Property< double > steering_time
Definition: PathStatistics.hpp:21
Property< bool > path_found
Definition: PathStatistics.hpp:23
Property< double > min_clearing_distance
Definition: PathStatistics.hpp:41
Property< double > path_length
Definition: PathStatistics.hpp:26
Property< double > mean_clearing_distance
Definition: PathStatistics.hpp:36
Property< std::string > planner
Definition: PathStatistics.hpp:45
Property< bool > exact_goal_path
Definition: PathStatistics.hpp:25
Property< double > collision_time
Definition: PathStatistics.hpp:19
Property< double > median_clearing_distance
Definition: PathStatistics.hpp:38
Property< double > max_clearing_distance
Definition: PathStatistics.hpp:43
Property< nlohmann::json > planner_settings
Definition: PathStatistics.hpp:46
PathStatistics(const std::string &planner="UNKNOWN")
Definition: PathStatistics.hpp:50