hpp-pinocchio  6.0.0
Wrapping of the kinematic/dynamic chain Pinocchio for HPP.
Printing to output stream

Classes

struct  hpp::prettyPrint< T, Option >
 This function must be specialized for the type you want to print. More...
 

Enumerations

enum  { hpp::OutputFormatBits = 3 , hpp::OneLineOutput = 0 , hpp::CondensedOutput = 1 , hpp::PrettyOutput = 2 }
 The printing options, currently only contains the output format. More...
 

Functions

HPP_PINOCCHIO_DLLAPI std::ostream & hpp::setpyformat (std::ostream &o)
 
HPP_PINOCCHIO_DLLAPI std::ostream & hpp::unsetpyformat (std::ostream &o)
 
template<typename T >
PrettyPrint< T, PrettyOutputhpp::pretty_print (const T &t)
 Pretty printing. More...
 
template<typename T >
PrettyPrint< T, CondensedOutputhpp::condensed (const T &t)
 Condensed printing. More...
 
template<typename T >
PrettyPrint< T, OneLineOutputhpp::one_line (const T &t)
 Print on one line. More...
 

Detailed Description

Some tools to ease pretty printing of objects in HPP. To print vectors, you have the following options:

std::cout << incindent << iendl << pretty_print(SE3::Identity()) << iendl
<< condensed(SE3::Identity()) << iendl << one_line(SE3::Identity())
<< decindent << iendl;
std::cout << setpyformat << iendl << pretty_print(SE3::Identity()) << iendl
<< condensed(SE3::Identity()) << iendl << one_line(SE3::Identity())
<< iendl;
vector_t v = vector_t::Ones(2);
matrix_t m = matrix_t::Identity(3, 3);
std::cout << unsetpyformat << iendl << pretty_print(v) << iendl
<< condensed(v) << iendl << one_line(v.segment(0, 2)) << iendl
<< iendl;
std::cout << setpyformat << iendl << pretty_print(m) << iendl << condensed(m)
<< iendl << one_line(m.block(1, 1, 2, 2)) << iendl;
PrettyPrint< T, PrettyOutput > pretty_print(const T &t)
Pretty printing.
Definition: util.hh:214
PrettyPrint< T, CondensedOutput > condensed(const T &t)
Condensed printing.
Definition: util.hh:219
HPP_PINOCCHIO_DLLAPI std::ostream & unsetpyformat(std::ostream &o)
PrettyPrint< T, OneLineOutput > one_line(const T &t)
Print on one line.
Definition: util.hh:224
HPP_PINOCCHIO_DLLAPI std::ostream & setpyformat(std::ostream &o)
Eigen::Matrix< value_type, Eigen::Dynamic, 1 > vector_t
Definition: fwd.hh:88
Eigen::Ref< vector_t > vectorOut_t
Definition: fwd.hh:94
Eigen::Matrix< value_type, Eigen::Dynamic, Eigen::Dynamic > matrix_t
Definition: fwd.hh:95
Eigen::Ref< const vector_t > vectorIn_t
Definition: fwd.hh:93

which should output something like

R = 1, 0, 0
0, 1, 0
0, 0, 1
p = 0, 0, 0
q = 0, 0, 0, 1
p = 0, 0, 0
q = 0, 0, 0, 1, p = 0, 0, 0
R = ( (1, 0, 0,)
(0, 1, 0,)
(0, 0, 1,) )
p = (0, 0, 0,)
q = (0, 0, 0, 1,)
p = (0, 0, 0,)
q = (0, 0, 0, 1,), p = (0, 0, 0,)
1, 1
1, 1
1, 1
1, 1
1, 1
( (1, 0, 0,),
(0, 1, 0,),
(0, 0, 1,), )
( (1, 0, 0,), (0, 1, 0,), (0, 0, 1,), )
( (1, 0,), (0, 1,), )

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

The printing options, currently only contains the output format.

Enumerator
OutputFormatBits 
OneLineOutput 
CondensedOutput 
PrettyOutput 

Function Documentation

◆ condensed()

template<typename T >
PrettyPrint<T, CondensedOutput> hpp::condensed ( const T &  t)
inline

Condensed printing.

◆ one_line()

template<typename T >
PrettyPrint<T, OneLineOutput> hpp::one_line ( const T &  t)
inline

Print on one line.

◆ pretty_print()

template<typename T >
PrettyPrint<T, PrettyOutput> hpp::pretty_print ( const T &  t)
inline

Pretty printing.

◆ setpyformat()

HPP_PINOCCHIO_DLLAPI std::ostream& hpp::setpyformat ( std::ostream &  o)

◆ unsetpyformat()

HPP_PINOCCHIO_DLLAPI std::ostream& hpp::unsetpyformat ( std::ostream &  o)