hpp-pinocchio  4.9.1
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())
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 << pretty_print (vectorOut_t(v))
<< iendl << condensed (vectorIn_t(v))
<< iendl;
std::cout << setpyformat
<< iendl << pretty_print (m)
<< iendl << condensed (m)
<< iendl << one_line (m.block(1,1,2,2))
<< iendl;

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)