pinocchio  3.7.0
A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives
 
Loading...
Searching...
No Matches
CodeGenBase< _Scalar > Struct Template Referenceabstract
Inheritance diagram for CodeGenBase< _Scalar >:
Collaboration diagram for CodeGenBase< _Scalar >:

Public Types

enum  { Options = 0 }
 
typedef ADModel::ConfigVectorType ADConfigVectorType
 
typedef pinocchio::DataTpl< ADScalar, Options > ADData
 
typedef CppAD::ADFun< CGScalar > ADFun
 
typedef Eigen::Matrix< ADScalar, Eigen::Dynamic, Eigen::Dynamic, Options > ADMatrixXs
 
typedef pinocchio::ModelTpl< ADScalar, Options > ADModel
 
typedef CppAD::AD< CGScalar > ADScalar
 
typedef ADModel::TangentVectorType ADTangentVectorType
 
typedef Eigen::Matrix< ADScalar, Eigen::Dynamic, 1, Options > ADVectorXs
 
typedef pinocchio::DataTpl< CGScalar, Options > CGData
 
typedef pinocchio::ModelTpl< CGScalar, Options > CGModel
 
typedef CppAD::cg::CG< Scalar > CGScalar
 
typedef Model::ConfigVectorType ConfigVectorType
 
typedef pinocchio::DataTpl< Scalar, Options > Data
 
typedef Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic, Options > MatrixXs
 
typedef pinocchio::ModelTpl< Scalar, Options > Model
 
typedef Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic, Options|Eigen::RowMajor > RowMatrixXs
 
typedef _Scalar Scalar
 
typedef Model::TangentVectorType TangentVectorType
 
typedef Eigen::Matrix< Scalar, Eigen::Dynamic, 1, Options > VectorXs
 

Public Member Functions

 CodeGenBase (const Model &model, const Eigen::DenseIndex dim_input, const Eigen::DenseIndex dim_output, const std::string &function_name, const std::string &library_name)
 
virtual void buildMap ()=0
 build the mapping Y = f(X)
 
CppAD::cg::ModelCSourceGen< Scalar > & codeGenerator ()
 
void compileAndLoadLib (const std::string &gcc_path)
 
void compileLib (const std::string &gcc_path="/usr/bin/gcc", const std::string &compile_options="-Ofast")
 
template<typename Vector >
void evalFunction (const Eigen::MatrixBase< Vector > &x)
 
template<typename Vector >
void evalJacobian (const Eigen::MatrixBase< Vector > &x)
 
bool existLib () const
 
Eigen::DenseIndex getInputDimension () const
 Dimension of the input vector.
 
Eigen::DenseIndex getOutputDimension () const
 Dimension of the output vector.
 
void initLib ()
 
void loadLib (const bool generate_if_not_exist=true, const std::string &gcc_path="/usr/bin/gcc", const std::string &compile_options="-Ofast")
 

Protected Attributes

ADTangentVectorType ad_a
 
ADData ad_data
 
ADTangentVectorType ad_dq
 
ADFun ad_fun
 
ADModel ad_model
 
ADConfigVectorType ad_q
 
ADConfigVectorType ad_q_plus
 
ADTangentVectorType ad_v
 
ADVectorXs ad_X
 
ADVectorXs ad_Y
 
bool build_forward
 Options to generate or not the source code for the evaluation function.
 
bool build_jacobian
 Options to build or not the Jacobian of he function.
 
std::unique_ptr< CppAD::cg::ModelCSourceGen< Scalar > > cgen_ptr
 
std::unique_ptr< CppAD::cg::DynamicLib< Scalar > > dynamicLib_ptr
 
std::unique_ptr< CppAD::cg::DynamicModelLibraryProcessor< Scalar > > dynamicLibManager_ptr
 
const std::string function_name
 Name of the function.
 
std::unique_ptr< CppAD::cg::GenericModel< Scalar > > generatedFun_ptr
 
RowMatrixXs jac
 
std::unique_ptr< CppAD::cg::ModelLibraryCSourceGen< Scalar > > libcgen_ptr
 
const std::string library_name
 Name of the library.
 
VectorXs y
 

Detailed Description

template<typename _Scalar>
struct pinocchio::CodeGenBase< _Scalar >

Definition at line 17 of file code-generator-base.hpp.

Member Typedef Documentation

◆ ADConfigVectorType

template<typename _Scalar >
typedef ADModel::ConfigVectorType ADConfigVectorType

Definition at line 45 of file code-generator-base.hpp.

◆ ADData

template<typename _Scalar >
typedef pinocchio::DataTpl<ADScalar, Options> ADData

Definition at line 33 of file code-generator-base.hpp.

◆ ADFun

template<typename _Scalar >
typedef CppAD::ADFun<CGScalar> ADFun

Definition at line 48 of file code-generator-base.hpp.

◆ ADMatrixXs

template<typename _Scalar >
typedef Eigen::Matrix<ADScalar, Eigen::Dynamic, Eigen::Dynamic, Options> ADMatrixXs

Definition at line 40 of file code-generator-base.hpp.

◆ ADModel

template<typename _Scalar >
typedef pinocchio::ModelTpl<ADScalar, Options> ADModel

Definition at line 32 of file code-generator-base.hpp.

◆ ADScalar

template<typename _Scalar >
typedef CppAD::AD<CGScalar> ADScalar

Definition at line 21 of file code-generator-base.hpp.

◆ ADTangentVectorType

template<typename _Scalar >
typedef ADModel::TangentVectorType ADTangentVectorType

Definition at line 46 of file code-generator-base.hpp.

◆ ADVectorXs

template<typename _Scalar >
typedef Eigen::Matrix<ADScalar, Eigen::Dynamic, 1, Options> ADVectorXs

Definition at line 39 of file code-generator-base.hpp.

◆ CGData

template<typename _Scalar >
typedef pinocchio::DataTpl<CGScalar, Options> CGData

Definition at line 31 of file code-generator-base.hpp.

◆ CGModel

template<typename _Scalar >
typedef pinocchio::ModelTpl<CGScalar, Options> CGModel

Definition at line 30 of file code-generator-base.hpp.

◆ CGScalar

template<typename _Scalar >
typedef CppAD::cg::CG<Scalar> CGScalar

Definition at line 20 of file code-generator-base.hpp.

◆ ConfigVectorType

template<typename _Scalar >
typedef Model::ConfigVectorType ConfigVectorType

Definition at line 42 of file code-generator-base.hpp.

◆ Data

template<typename _Scalar >
typedef pinocchio::DataTpl<Scalar, Options> Data

Definition at line 29 of file code-generator-base.hpp.

◆ MatrixXs

template<typename _Scalar >
typedef Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic, Options> MatrixXs

Definition at line 35 of file code-generator-base.hpp.

◆ Model

template<typename _Scalar >
typedef pinocchio::ModelTpl<Scalar, Options> Model

Definition at line 28 of file code-generator-base.hpp.

◆ RowMatrixXs

template<typename _Scalar >
typedef Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic, Options | Eigen::RowMajor> RowMatrixXs

Definition at line 38 of file code-generator-base.hpp.

◆ Scalar

template<typename _Scalar >
typedef _Scalar Scalar

Definition at line 19 of file code-generator-base.hpp.

◆ TangentVectorType

template<typename _Scalar >
typedef Model::TangentVectorType TangentVectorType

Definition at line 43 of file code-generator-base.hpp.

◆ VectorXs

template<typename _Scalar >
typedef Eigen::Matrix<Scalar, Eigen::Dynamic, 1, Options> VectorXs

Definition at line 36 of file code-generator-base.hpp.

Member Enumeration Documentation

◆ anonymous enum

Definition at line 23 of file code-generator-base.hpp.

Constructor & Destructor Documentation

◆ CodeGenBase()

template<typename _Scalar >
CodeGenBase ( const Model model,
const Eigen::DenseIndex  dim_input,
const Eigen::DenseIndex  dim_output,
const std::string &  function_name,
const std::string &  library_name 
)
inline

Definition at line 50 of file code-generator-base.hpp.

◆ ~CodeGenBase()

template<typename _Scalar >
virtual ~CodeGenBase ( )
inlinevirtual

Definition at line 71 of file code-generator-base.hpp.

Member Function Documentation

◆ buildMap()

◆ codeGenerator()

template<typename _Scalar >
CppAD::cg::ModelCSourceGen< Scalar > & codeGenerator ( )
inline

Definition at line 94 of file code-generator-base.hpp.

◆ compileAndLoadLib()

template<typename _Scalar >
void compileAndLoadLib ( const std::string &  gcc_path)
inline

Definition at line 117 of file code-generator-base.hpp.

◆ compileLib()

template<typename _Scalar >
void compileLib ( const std::string &  gcc_path = "/usr/bin/gcc",
const std::string &  compile_options = "-Ofast" 
)
inline

Definition at line 99 of file code-generator-base.hpp.

◆ evalFunction()

template<typename _Scalar >
template<typename Vector >
void evalFunction ( const Eigen::MatrixBase< Vector > &  x)
inline

Definition at line 151 of file code-generator-base.hpp.

◆ evalJacobian()

template<typename _Scalar >
template<typename Vector >
void evalJacobian ( const Eigen::MatrixBase< Vector > &  x)
inline

Definition at line 159 of file code-generator-base.hpp.

◆ existLib()

template<typename _Scalar >
bool existLib ( ) const
inline

Definition at line 109 of file code-generator-base.hpp.

◆ getInputDimension()

template<typename _Scalar >
Eigen::DenseIndex getInputDimension ( ) const
inline

Dimension of the input vector.

Definition at line 170 of file code-generator-base.hpp.

◆ getOutputDimension()

template<typename _Scalar >
Eigen::DenseIndex getOutputDimension ( ) const
inline

Dimension of the output vector.

Definition at line 175 of file code-generator-base.hpp.

◆ initLib()

template<typename _Scalar >
void initLib ( )
inline

Definition at line 78 of file code-generator-base.hpp.

◆ loadLib()

template<typename _Scalar >
void loadLib ( const bool  generate_if_not_exist = true,
const std::string &  gcc_path = "/usr/bin/gcc",
const std::string &  compile_options = "-Ofast" 
)
inline

Definition at line 123 of file code-generator-base.hpp.

Member Data Documentation

◆ ad_a

template<typename _Scalar >
ADTangentVectorType ad_a
protected

Definition at line 199 of file code-generator-base.hpp.

◆ ad_data

template<typename _Scalar >
ADData ad_data
protected

Definition at line 182 of file code-generator-base.hpp.

◆ ad_dq

template<typename _Scalar >
ADTangentVectorType ad_dq
protected

Definition at line 199 of file code-generator-base.hpp.

◆ ad_fun

template<typename _Scalar >
ADFun ad_fun
protected

Definition at line 196 of file code-generator-base.hpp.

◆ ad_model

template<typename _Scalar >
ADModel ad_model
protected

Definition at line 181 of file code-generator-base.hpp.

◆ ad_q

template<typename _Scalar >
ADConfigVectorType ad_q
protected

Definition at line 198 of file code-generator-base.hpp.

◆ ad_q_plus

template<typename _Scalar >
ADConfigVectorType ad_q_plus
protected

Definition at line 198 of file code-generator-base.hpp.

◆ ad_v

template<typename _Scalar >
ADTangentVectorType ad_v
protected

Definition at line 199 of file code-generator-base.hpp.

◆ ad_X

template<typename _Scalar >
ADVectorXs ad_X
protected

Definition at line 195 of file code-generator-base.hpp.

◆ ad_Y

template<typename _Scalar >
ADVectorXs ad_Y
protected

Definition at line 195 of file code-generator-base.hpp.

◆ build_forward

template<typename _Scalar >
bool build_forward
protected

Options to generate or not the source code for the evaluation function.

Definition at line 190 of file code-generator-base.hpp.

◆ build_jacobian

template<typename _Scalar >
bool build_jacobian
protected

Options to build or not the Jacobian of he function.

Definition at line 193 of file code-generator-base.hpp.

◆ cgen_ptr

template<typename _Scalar >
std::unique_ptr<CppAD::cg::ModelCSourceGen<Scalar> > cgen_ptr
protected

Definition at line 204 of file code-generator-base.hpp.

◆ dynamicLib_ptr

template<typename _Scalar >
std::unique_ptr<CppAD::cg::DynamicLib<Scalar> > dynamicLib_ptr
protected

Definition at line 207 of file code-generator-base.hpp.

◆ dynamicLibManager_ptr

template<typename _Scalar >
std::unique_ptr<CppAD::cg::DynamicModelLibraryProcessor<Scalar> > dynamicLibManager_ptr
protected

Definition at line 206 of file code-generator-base.hpp.

◆ function_name

template<typename _Scalar >
const std::string function_name
protected

Name of the function.

Definition at line 185 of file code-generator-base.hpp.

◆ generatedFun_ptr

template<typename _Scalar >
std::unique_ptr<CppAD::cg::GenericModel<Scalar> > generatedFun_ptr
protected

Definition at line 208 of file code-generator-base.hpp.

◆ jac

template<typename _Scalar >
RowMatrixXs jac
protected

Definition at line 202 of file code-generator-base.hpp.

◆ libcgen_ptr

template<typename _Scalar >
std::unique_ptr<CppAD::cg::ModelLibraryCSourceGen<Scalar> > libcgen_ptr
protected

Definition at line 205 of file code-generator-base.hpp.

◆ library_name

template<typename _Scalar >
const std::string library_name
protected

Name of the library.

Definition at line 187 of file code-generator-base.hpp.

◆ y

template<typename _Scalar >
VectorXs y
protected

Definition at line 201 of file code-generator-base.hpp.


The documentation for this struct was generated from the following file: