controls  3.0.0
Functions | Variables
DebugPrint.h File Reference
#include <algorithm>
#include <iomanip>
#include <sstream>
#include <string>
#include "utils/Transforms.h"

Go to the source code of this file.

Functions

const Eigen::IOFormat EigFmt (PRINT_PRECISION, 0, ", ", ";\n", "", "", "[", "]")
 
template<typename Derived >
std::string fmt_eigen (const Eigen::MatrixBase< Derived > &m)
 Formats any Eigen matrix/vector as a string. More...
 
std::string fmt_pose (const Pose &pose)
 Formats a Pose as "pos=[x, y, z] rpy=[r, p, y] deg". More...
 
std::string fmt_state (const State &state)
 Formats a State (pose + twist + acceleration) as a multi-line string. More...
 
void fmt_hline (std::ostringstream &s, int w, const char *l, const char *r)
 
void fmt_row (std::ostringstream &s, int w, const std::string &content)
 
std::string fmt_f (double v, int w=7, int prec=2)
 
std::string fmt_v3 (const char *lbl, double a, double b, double c, const char *tag="")
 
std::string fmt_v6 (const char *lbl, double a, double b, double c, double d, double e, double g)
 
std::string fmt_scalar (const char *lbl, double v)
 
template<typename Params >
std::string fmt_config (const Params &c)
 Formats a vehicle config struct as a boxed table string. More...
 

Variables

constexpr int PRINT_PRECISION = 3
 

Function Documentation

◆ EigFmt()

const Eigen::IOFormat EigFmt ( PRINT_PRECISION  ,
,
,
,
";\n"  ,
""  ,
""  ,
""  [", "] 
)
inline

◆ fmt_config()

template<typename Params >
std::string fmt_config ( const Params &  c)

Formats a vehicle config struct as a boxed table string.

Templated to avoid a hard dependency on ControlsROS2Wrapper::Params.

◆ fmt_eigen()

template<typename Derived >
std::string fmt_eigen ( const Eigen::MatrixBase< Derived > &  m)

Formats any Eigen matrix/vector as a string.

Vectors (single column) are printed transposed as a row.

◆ fmt_f()

std::string fmt_f ( double  v,
int  w = 7,
int  prec = 2 
)
inline

◆ fmt_hline()

void fmt_hline ( std::ostringstream &  s,
int  w,
const char *  l,
const char *  r 
)
inline

◆ fmt_pose()

std::string fmt_pose ( const Pose pose)
inline

Formats a Pose as "pos=[x, y, z] rpy=[r, p, y] deg".

◆ fmt_row()

void fmt_row ( std::ostringstream &  s,
int  w,
const std::string &  content 
)
inline

◆ fmt_scalar()

std::string fmt_scalar ( const char *  lbl,
double  v 
)
inline

◆ fmt_state()

std::string fmt_state ( const State state)
inline

Formats a State (pose + twist + acceleration) as a multi-line string.

◆ fmt_v3()

std::string fmt_v3 ( const char *  lbl,
double  a,
double  b,
double  c,
const char *  tag = "" 
)
inline

◆ fmt_v6()

std::string fmt_v6 ( const char *  lbl,
double  a,
double  b,
double  c,
double  d,
double  e,
double  g 
)
inline

Variable Documentation

◆ PRINT_PRECISION

constexpr int PRINT_PRECISION = 3
constexpr