TinyURDF 1.0.0
Loading...
Searching...
No Matches
utils.h
Go to the documentation of this file.
1#ifndef INCLUDE_TINYURDF_UTILITY_UTILS_H_
2#define INCLUDE_TINYURDF_UTILITY_UTILS_H_
3
4// Copyright 2025 Wissem CHIHA
5
6#include <string>
7#include <vector>
8#include <sstream>
9#include <Eigen/Dense>
10#include <loguru/loguru.hpp>
11#ifdef USE_OPENMP
12#include <omp.h>
13#endif
17using Vec3 = Eigen::Matrix<double, 3, 1>;
18
22using Rot3 = Eigen::Quaternion<double>;
23
30void str2array(const char* str_, double* arr);
31
35void str2double(const char* in, double& num_);
36
43void split(const std::string& str, std::vector<std::string>& split_result,
44 const std::string& delimiter);
45
51std::string join(const std::vector<std::string>& elements, const std::string& delimiter);
52
56std::string trim(const std::string& str);
57
61std::string toLower(const std::string& str);
62
66std::string toUpper(const std::string& str);
67
68#endif // INCLUDE_TINYURDF_UTILITY_UTILS_H_
std::string toUpper(const std::string &str)
Converts a string to uppercase.
void split(const std::string &str, std::vector< std::string > &split_result, const std::string &delimiter)
Splits a string by a delimiter into a vector of strings.
Definition utils.cc:22
Eigen::Matrix< double, 3, 1 > Vec3
Base struct for 3D position vectors.
Definition utils.h:17
void str2array(const char *str_, double *arr)
Definition utils.cc:3
std::string trim(const std::string &str)
Trims leading and trailing whitespace from a string.
std::string toLower(const std::string &str)
Converts a string to lowercase.
std::string join(const std::vector< std::string > &elements, const std::string &delimiter)
Joins a vector of strings into a single string with a given delimiter.
void str2double(const char *in, double &num_)
Converts a string to a double value in a locale-safe manner.
Definition utils.cc:14
Eigen::Quaternion< double > Rot3
Base struct for 3D rotation elements.
Definition utils.h:22