Bench-MR
A Motion Planning Benchmark for Wheeled Mobile Robots
Log.h
Go to the documentation of this file.
1#pragma once
2
3#include <chrono>
4#include <nlohmann/json.hpp>
5
6#include <base/Primitives.h>
7#include <ompl/control/PathControl.h>
9
10class Log {
11 public:
12 static void instantiateRun();
13
14 static void log(const PathStatistics &stats);
15 static void log(const nlohmann::json &stats);
16
17 static void storeRun();
18
19 static void save(std::string filename = "", const std::string &path = "log/");
20
21 static std::string filename();
22
23 static std::vector<std::array<double, 2>> serializePath(
24 const std::vector<Point> &path);
25 static std::vector<std::array<double, 3>> serializeTrajectory(
26 const ompl::geometric::PathGeometric &traj, bool interpolate = true);
27
28 static std::vector<std::array<double, 3>> serializeTrajectory(
29 const ompl::control::PathControl &traj, bool interpolate = true);
30
31 private:
32 static nlohmann::json _json;
33 static nlohmann::json _currentRun;
34};
Definition: Log.h:10
static void instantiateRun()
Definition: Log.cpp:11
static void save(std::string filename="", const std::string &path="log/")
Definition: Log.cpp:39
static std::vector< std::array< double, 3 > > serializeTrajectory(const ompl::geometric::PathGeometric &traj, bool interpolate=true)
Definition: Log.cpp:76
static std::vector< std::array< double, 2 > > serializePath(const std::vector< Point > &path)
Definition: Log.cpp:69
static void log(const PathStatistics &stats)
Definition: Log.cpp:29
static std::string filename()
Definition: Log.cpp:57
static void storeRun()
Definition: Log.cpp:47
Definition: PathStatistics.hpp:16