bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
bitsim::utils::io Namespace Reference

Classes

class  CSVFileReader
 The CSVFileReader class. More...
class  CSVWriter
 The CSVWriter class. Handles writing into CSV file format. More...
struct  FileFormats
class  FileHandlerBase
 Abstract base class for file handling operations. More...
class  FileReaderBase
class  FileWriterBase
 The FileWriterBase class. More...
class  JSONFileReader

Functions

std::ostream & print_time_point (std::ostream &out, const std::chrono::system_clock::time_point &tp)
template<typename T>
std::ostream & print_vector (std::ostream &out, const std::vector< T > &obs)
template<typename T>
std::ostream & print_vector (std::ostream &out, const std::vector< std::vector< T > > &obs)
template<typename T>
std::ostream & print_vector (std::ostream &out, const std::vector< std::vector< std::vector< T > > > &obs)
real_t clean (real_t x, real_t zero=5.0e-4)
 x, or 0 when \(|x| <\) zero
void print_title (const std::string &title, std::ostream &out)
 An empty line and then the title.
void print_title (const std::string &title)
void print_number (const std::string &label, real_t value, int width=26)
 The label and the value, with 3 decimals.
void print_flag (const std::string &label, bool value, int width=26)
 The label and true or false.
void print_error (const std::string &label, real_t value, int width=26)
 The label and the value in scientific notation with one decimal, for small errors.
void print_value (const std::string &label, real_t value, const std::string &unit, int precision=3, int width=30)
 The label, the value right-aligned with the given decimals, and the unit.
std::string to_string (const chrono::ChVector3d &v)
 "(x, y, z)" with 3 decimals
void print_vector (const std::string &label, const chrono::ChVector3d &v, int width=26)
 The label and the vector as "(x, y, z)".
void print_matrix (const std::string &label, const chrono::ChMatrix33d &R)
 The label on a line of its own, then the three rows of the matrix.
void print_frame (const std::string &label, const chrono::ChFrame<> &frame, int width=14)
 The label, the origin of the frame and its three axes, as seen from its parent: the columns of its rotation matrix.

Function Documentation

◆ clean()

real_t bitsim::utils::io::clean ( real_t x,
real_t zero )

x, or 0 when \(|x| <\) zero

◆ print_error()

void bitsim::utils::io::print_error ( const std::string & label,
real_t value,
int width )

The label and the value in scientific notation with one decimal, for small errors.

◆ print_flag()

void bitsim::utils::io::print_flag ( const std::string & label,
bool value,
int width )

The label and true or false.

◆ print_frame()

void bitsim::utils::io::print_frame ( const std::string & label,
const chrono::ChFrame<> & frame,
int width )

The label, the origin of the frame and its three axes, as seen from its parent: the columns of its rotation matrix.

◆ print_matrix()

void bitsim::utils::io::print_matrix ( const std::string & label,
const chrono::ChMatrix33d & R )

The label on a line of its own, then the three rows of the matrix.

◆ print_number()

void bitsim::utils::io::print_number ( const std::string & label,
real_t value,
int width )

The label and the value, with 3 decimals.

◆ print_time_point()

std::ostream & bitsim::utils::io::print_time_point ( std::ostream & out,
const std::chrono::system_clock::time_point & tp )
Parameters
outThe stream to write
tpThe time point to write on the stream
Returns
Read/write reference to the stream we write on

◆ print_title() [1/2]

void bitsim::utils::io::print_title ( const std::string & title)

◆ print_title() [2/2]

void bitsim::utils::io::print_title ( const std::string & title,
std::ostream & out )

An empty line and then the title.

◆ print_value()

void bitsim::utils::io::print_value ( const std::string & label,
real_t value,
const std::string & unit,
int precision,
int width )

The label, the value right-aligned with the given decimals, and the unit.

◆ print_vector() [1/4]

void bitsim::utils::io::print_vector ( const std::string & label,
const chrono::ChVector3d & v,
int width )

The label and the vector as "(x, y, z)".

◆ print_vector() [2/4]

template<typename T>
std::ostream & bitsim::utils::io::print_vector ( std::ostream & out,
const std::vector< std::vector< std::vector< T > > > & obs )

◆ print_vector() [3/4]

template<typename T>
std::ostream & bitsim::utils::io::print_vector ( std::ostream & out,
const std::vector< std::vector< T > > & obs )

◆ print_vector() [4/4]

template<typename T>
std::ostream & bitsim::utils::io::print_vector ( std::ostream & out,
const std::vector< T > & obs )

◆ to_string()

std::string bitsim::utils::io::to_string ( const chrono::ChVector3d & v)

"(x, y, z)" with 3 decimals