5#include <ament_index_cpp/get_package_share_directory.hpp>
16#include "gtest/gtest.h"
21#include "rclcpp/rclcpp.hpp"
26namespace fs = std::filesystem;
48std::pair<std::vector<common_lib::structures::Cone>, std::vector<common_lib::structures::Cone>>
56std::vector<common_lib::structures::PathPoint>
path_from_file(
const std::string &path);
74void extract_info(
const std::string_view &filename_view,
int &size,
int &n_outliers);
90 const std::vector<std::pair<double, double>> &vec);
105float round_n(
float num,
int decimal_places);
110 std::size_t h1 = std::hash<long>()(
static_cast<long>(std::round(p.
position.
x / 0.5)));
111 std::size_t h2 = std::hash<long>()(
static_cast<long>(std::round(p.
position.
y / 0.5)));
112 return h1 ^ (h2 << 1);
std::vector< std::pair< double, double > > order_vector_of_pairs(const std::vector< std::pair< double, double > > &vec)
orders a vector of pairs to make it easier to compare them
std::string get_current_date_time_as_string()
Get current date and time as a string.
void extract_info(const std::string_view &filename_view, int &size, int &n_outliers)
Extracts the size and number of outliers from a filename.
std::vector< common_lib::structures::Cone > cone_vector_from_file(const std::string &path)
Retrieves a cone vector from a file.
std::vector< common_lib::structures::PathPoint > path_from_file(const std::string &path)
Retrieves a path point vector from a file.
std::ifstream open_read_file(const std::string &filename)
Opens a file for reading.
float consecutive_max_distance(const std::vector< common_lib::structures::Cone > &cones)
Retrieves the max consecutive distance between adjacent cones in a vector.
std::pair< std::vector< common_lib::structures::Cone >, std::vector< common_lib::structures::Cone > > track_from_file(const std::string &path)
Retrieves a track (a pair of colored cone vectors from each side) from a file.
float round_n(float num, int decimal_places)
rounds float to n decimal places
bool operator()(const common_lib::structures::PathPoint &p1, const common_lib::structures::PathPoint &p2) const
std::size_t operator()(const common_lib::structures::PathPoint &p) const