Commit 7863ecfc authored by Guilhem Saurel's avatar Guilhem Saurel

Merge branch 'devel' into cmake-export

parents e014e3b6 2c9a1df4
# Copyright 2010, François Bleibel, Olivier Stasse, JRL, CNRS/AIST
<<<<<<< HEAD
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
SET(PROJECT_ORG stack-of-tasks)
=======
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
SET(PROJECT_NAMESPACE stack-of-tasks)
>>>>>>> devel
SET(PROJECT_NAME sot-dynamic-pinocchio)
SET(PROJECT_DESCRIPTION "pinocchio bindings for dynamic-graph.")
SET(PROJECT_URL "https://github.com/${PROJECT_ORG}/${PROJECT_NAME}")
SET(PROJECT_SUFFIX "-v3")
# Export CMake Target
SET(PROJECT_USE_CMAKE_EXPORT TRUE)
INCLUDE(cmake/base.cmake)
INCLUDE(cmake/boost.cmake)
INCLUDE(cmake/eigen.cmake)
INCLUDE(cmake/python.cmake)
INCLUDE(cmake/test.cmake)
SET(CUSTOM_HEADER_DIR "${PROJECT_NAME}")
SET(DOXYGEN_USE_MATHJAX YES)
# Disable -Werror on Unix for now.
SET(CXX_DISABLE_WERROR True)
......@@ -41,6 +53,9 @@ SET(PKG_CONFIG_ADDITIONAL_VARIABLES
plugindir
)
COMPUTE_PROJECT_ARGS(PROJECT_ARGS LANGUAGES CXX)
PROJECT(${PROJECT_NAME} ${PROJECT_ARGS})
# Search for dependencies.
ADD_REQUIRED_DEPENDENCY("pinocchio >= 2.0.0")
ADD_PROJECT_DEPENDENCY(dynamic-graph REQUIRED )
......@@ -51,12 +66,15 @@ SET(BOOST_COMPONENTS filesystem system unit_test_framework)
OPTION (BUILD_PYTHON_INTERFACE "Build the python binding" ON)
OPTION (INSTALL_PYTHON_INTERFACE_ONLY "Install *ONLY* the python bindings" OFF)
OPTION(SUFFIX_SO_VERSION
"Suffix shared library name by a string depending on git status of project"
ON)
IF(BUILD_PYTHON_INTERFACE)
FINDPYTHON()
ADD_PROJECT_DEPENDENCY(dynamic-graph-python REQUIRED)
SET(BOOST_COMPONENTS ${BOOST_COMPONENTS} python)
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
INCLUDE_DIRECTORIES(SYSTEM ${PYTHON_INCLUDE_PATH})
ADD_REQUIRED_DEPENDENCY("eigenpy")
ENDIF(BUILD_PYTHON_INTERFACE)
......@@ -74,5 +92,3 @@ ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(doc)
ADD_SUBDIRECTORY(python)
ADD_SUBDIRECTORY(unitTesting)
SETUP_PROJECT_PACKAGE_FINALIZE()
......@@ -28,7 +28,8 @@ install these packages at https://github.com/jrl-umi3218.
\section python_bindings Python bindings
As most packages based on the dynamic-graph framework (see https://github.com/jrl-umi3218/dynamic-graph),
the functionnality is exposed through entities. Hence python sub-modules of dynamic_graph are generated. See <a href="../sphinx-html/index.html">sphinx documentation</a> for more details.
the functionnality is exposed through entities. Hence python sub-modules of dynamic_graph are generated. See <a
href="../sphinx-html/index.html">sphinx documentation</a> for more details.
The following entities are created by this package:\n
(all entites are placed in the namespace sot::)
......
......@@ -13,14 +13,14 @@
/* --- API ------------------------------------------------------------- */
/* --------------------------------------------------------------------- */
#if defined (WIN32)
# if defined (angle_estimator_EXPORTS)
# define SOTANGLEESTIMATOR_EXPORT __declspec(dllexport)
# else
# define SOTANGLEESTIMATOR_EXPORT __declspec(dllimport)
# endif
#if defined(WIN32)
#if defined(angle_estimator_EXPORTS)
#define SOTANGLEESTIMATOR_EXPORT __declspec(dllexport)
#else
# define SOTANGLEESTIMATOR_EXPORT
#define SOTANGLEESTIMATOR_EXPORT __declspec(dllimport)
#endif
#else
#define SOTANGLEESTIMATOR_EXPORT
#endif
/* --------------------------------------------------------------------- */
......@@ -30,87 +30,70 @@
/* Matrix */
#include <dynamic-graph/linear-algebra.h>
/* SOT */
#include <dynamic-graph/entity.h>
#include <dynamic-graph/signal-ptr.h>
#include <dynamic-graph/signal-time-dependent.h>
#include <sot/core/matrix-geometry.hh>
/* STD */
#include <string>
namespace dynamicgraph { namespace sot {
namespace dynamicgraph {
namespace sot {
namespace dg = dynamicgraph;
/* --------------------------------------------------------------------- */
/* --- CLASS ----------------------------------------------------------- */
/* --------------------------------------------------------------------- */
class SOTANGLEESTIMATOR_EXPORT AngleEstimator
:public dg::Entity
{
class SOTANGLEESTIMATOR_EXPORT AngleEstimator : public dg::Entity {
public:
static const std::string CLASS_NAME;
virtual const std::string& getClassName( void ) const { return CLASS_NAME; }
virtual const std::string& getClassName(void) const { return CLASS_NAME; }
public: /* --- CONSTRUCTION --- */
AngleEstimator( const std::string& name );
virtual ~AngleEstimator( void );
public: /* --- SIGNAL --- */
dg::SignalPtr<MatrixRotation,int> sensorWorldRotationSIN; // estimate(worldRc)
dg::SignalPtr<MatrixHomogeneous,int> sensorEmbeddedPositionSIN; // waistRchest
dg::SignalPtr<MatrixHomogeneous,int> contactWorldPositionSIN; // estimate(worldRf)
dg::SignalPtr<MatrixHomogeneous,int> contactEmbeddedPositionSIN; // waistRleg
dg::SignalTimeDependent<dynamicgraph::Vector,int> anglesSOUT; // [ flex1 flex2 yaw_drift ]
dg::SignalTimeDependent<MatrixRotation,int> flexibilitySOUT; // footRleg
dg::SignalTimeDependent<MatrixRotation,int> driftSOUT; // Ryaw = worldRc est(wRc)^-1
dg::SignalTimeDependent<MatrixRotation,int> sensorWorldRotationSOUT; // worldRc
dg::SignalTimeDependent<MatrixRotation,int> waistWorldRotationSOUT; // worldRwaist
dg::SignalTimeDependent<MatrixHomogeneous,int> waistWorldPositionSOUT; // worldMwaist
dg::SignalTimeDependent<dynamicgraph::Vector,int> waistWorldPoseRPYSOUT; // worldMwaist
dg::SignalPtr<dynamicgraph::Matrix,int> jacobianSIN;
dg::SignalPtr<dynamicgraph::Vector,int> qdotSIN;
dg::SignalTimeDependent<dynamicgraph::Vector,int> xff_dotSOUT;
dg::SignalTimeDependent<dynamicgraph::Vector,int> qdotSOUT;
AngleEstimator(const std::string& name);
virtual ~AngleEstimator(void);
public: /* --- SIGNAL --- */
dg::SignalPtr<MatrixRotation, int> sensorWorldRotationSIN; // estimate(worldRc)
dg::SignalPtr<MatrixHomogeneous, int> sensorEmbeddedPositionSIN; // waistRchest
dg::SignalPtr<MatrixHomogeneous, int> contactWorldPositionSIN; // estimate(worldRf)
dg::SignalPtr<MatrixHomogeneous, int> contactEmbeddedPositionSIN; // waistRleg
dg::SignalTimeDependent<dynamicgraph::Vector, int> anglesSOUT; // [ flex1 flex2 yaw_drift ]
dg::SignalTimeDependent<MatrixRotation, int> flexibilitySOUT; // footRleg
dg::SignalTimeDependent<MatrixRotation, int> driftSOUT; // Ryaw = worldRc est(wRc)^-1
dg::SignalTimeDependent<MatrixRotation, int> sensorWorldRotationSOUT; // worldRc
dg::SignalTimeDependent<MatrixRotation, int> waistWorldRotationSOUT; // worldRwaist
dg::SignalTimeDependent<MatrixHomogeneous, int> waistWorldPositionSOUT; // worldMwaist
dg::SignalTimeDependent<dynamicgraph::Vector, int> waistWorldPoseRPYSOUT; // worldMwaist
dg::SignalPtr<dynamicgraph::Matrix, int> jacobianSIN;
dg::SignalPtr<dynamicgraph::Vector, int> qdotSIN;
dg::SignalTimeDependent<dynamicgraph::Vector, int> xff_dotSOUT;
dg::SignalTimeDependent<dynamicgraph::Vector, int> qdotSOUT;
public: /* --- FUNCTIONS --- */
dynamicgraph::Vector& computeAngles( dynamicgraph::Vector& res,
const int& time );
MatrixRotation& computeFlexibilityFromAngles( MatrixRotation& res,
const int& time );
MatrixRotation& computeDriftFromAngles( MatrixRotation& res,
const int& time );
MatrixRotation& computeSensorWorldRotation( MatrixRotation& res,
const int& time );
MatrixRotation& computeWaistWorldRotation( MatrixRotation& res,
const int& time );
MatrixHomogeneous& computeWaistWorldPosition( MatrixHomogeneous& res,
const int& time );
dynamicgraph::Vector& computeWaistWorldPoseRPY( dynamicgraph::Vector& res,
const int& time );
dynamicgraph::Vector& compute_xff_dotSOUT( dynamicgraph::Vector& res,
const int& time );
dynamicgraph::Vector& compute_qdotSOUT( dynamicgraph::Vector& res,
const int& time );
dynamicgraph::Vector& computeAngles(dynamicgraph::Vector& res, const int& time);
MatrixRotation& computeFlexibilityFromAngles(MatrixRotation& res, const int& time);
MatrixRotation& computeDriftFromAngles(MatrixRotation& res, const int& time);
MatrixRotation& computeSensorWorldRotation(MatrixRotation& res, const int& time);
MatrixRotation& computeWaistWorldRotation(MatrixRotation& res, const int& time);
MatrixHomogeneous& computeWaistWorldPosition(MatrixHomogeneous& res, const int& time);
dynamicgraph::Vector& computeWaistWorldPoseRPY(dynamicgraph::Vector& res, const int& time);
dynamicgraph::Vector& compute_xff_dotSOUT(dynamicgraph::Vector& res, const int& time);
dynamicgraph::Vector& compute_qdotSOUT(dynamicgraph::Vector& res, const int& time);
public: /* --- PARAMS --- */
void fromSensor(const bool& fs) { fromSensor_ = fs; }
bool fromSensor() const { return fromSensor_; }
bool fromSensor() const { return fromSensor_; }
private:
bool fromSensor_;
};
} /* namespace sot */
} /* namespace dynamicgraph */
} /* namespace sot */} /* namespace dynamicgraph */
#endif // #ifndef __SOT_ANGLE_ESTIMATOR_H__
#endif // #ifndef __SOT_ANGLE_ESTIMATOR_H__
......@@ -17,7 +17,6 @@
/* Matrix */
#include <dynamic-graph/linear-algebra.h>
/* SOT */
#include <dynamic-graph/entity.h>
#include <dynamic-graph/signal-ptr.h>
......@@ -33,49 +32,39 @@
/* --- API ------------------------------------------------------------- */
/* --------------------------------------------------------------------- */
#if defined (WIN32)
# if defined (integrator_force_exact_EXPORTS)
# define SOTINTEGRATORFORCEEXACT_EXPORT __declspec(dllexport)
# else
# define SOTINTEGRATORFORCEEXACT_EXPORT __declspec(dllimport)
# endif
#if defined(WIN32)
#if defined(integrator_force_exact_EXPORTS)
#define SOTINTEGRATORFORCEEXACT_EXPORT __declspec(dllexport)
#else
# define SOTINTEGRATORFORCEEXACT_EXPORT
#define SOTINTEGRATORFORCEEXACT_EXPORT __declspec(dllimport)
#endif
#else
#define SOTINTEGRATORFORCEEXACT_EXPORT
#endif
namespace dynamicgraph { namespace sot {
namespace dynamicgraph {
namespace sot {
namespace dg = dynamicgraph;
/* --------------------------------------------------------------------- */
/* --- CLASS ----------------------------------------------------------- */
/* --------------------------------------------------------------------- */
class SOTINTEGRATORFORCEEXACT_EXPORT IntegratorForceExact
:public IntegratorForce
{
class SOTINTEGRATORFORCEEXACT_EXPORT IntegratorForceExact : public IntegratorForce {
public:
static const std::string CLASS_NAME;
protected:
public: /* --- CONSTRUCTION --- */
IntegratorForceExact( const std::string& name );
virtual ~IntegratorForceExact( void );
IntegratorForceExact(const std::string& name);
virtual ~IntegratorForceExact(void);
public: /* --- SIGNAL --- */
public: /* --- FUNCTIONS --- */
dynamicgraph::Vector& computeVelocityExact( dynamicgraph::Vector& res,
const int& time );
dynamicgraph::Vector& computeVelocityExact(dynamicgraph::Vector& res, const int& time);
};
} /* namespace sot */
} /* namespace dynamicgraph */
} /* namespace sot */} /* namespace dynamicgraph */
#endif // #ifndef __SOT_SOTINTEGRATORFORCEEXACT_H__
#endif // #ifndef __SOT_SOTINTEGRATORFORCEEXACT_H__
......@@ -17,7 +17,6 @@
/* Matrix */
#include <dynamic-graph/linear-algebra.h>
/* SOT */
#include <dynamic-graph/entity.h>
#include <dynamic-graph/signal-ptr.h>
......@@ -33,50 +32,39 @@
/* --- API ------------------------------------------------------------- */
/* --------------------------------------------------------------------- */
#if defined (WIN32)
# if defined (integrator_force_rk4_EXPORTS)
# define SOTINTEGRATORFORCERK4_EXPORT __declspec(dllexport)
# else
# define SOTINTEGRATORFORCERK4_EXPORT __declspec(dllimport)
# endif
#if defined(WIN32)
#if defined(integrator_force_rk4_EXPORTS)
#define SOTINTEGRATORFORCERK4_EXPORT __declspec(dllexport)
#else
# define SOTINTEGRATORFORCERK4_EXPORT
#define SOTINTEGRATORFORCERK4_EXPORT __declspec(dllimport)
#endif
#else
#define SOTINTEGRATORFORCERK4_EXPORT
#endif
namespace dynamicgraph { namespace sot {
namespace dynamicgraph {
namespace sot {
namespace dg = dynamicgraph;
/* --------------------------------------------------------------------- */
/* --- CLASS ----------------------------------------------------------- */
/* --------------------------------------------------------------------- */
class SOTINTEGRATORFORCERK4_EXPORT IntegratorForceRK4
:public IntegratorForce
{
class SOTINTEGRATORFORCERK4_EXPORT IntegratorForceRK4 : public IntegratorForce {
public:
static const std::string CLASS_NAME;
protected:
public: /* --- CONSTRUCTION --- */
IntegratorForceRK4( const std::string& name );
virtual ~IntegratorForceRK4( void );
IntegratorForceRK4(const std::string& name);
virtual ~IntegratorForceRK4(void);
public: /* --- SIGNAL --- */
public: /* --- FUNCTIONS --- */
dynamicgraph::Vector& computeDerivativeRK4( dynamicgraph::Vector& res,
const int& time );
dynamicgraph::Vector& computeDerivativeRK4(dynamicgraph::Vector& res, const int& time);
};
} /* namespace sot */
} /* namespace dynamicgraph */
} /* namespace sot */} /* namespace dynamicgraph */
#endif // #ifndef __SOT_SOTINTEGRATORFORCERK4_H__
#endif // #ifndef __SOT_SOTINTEGRATORFORCERK4_H__
......@@ -17,14 +17,12 @@
/* Matrix */
#include <dynamic-graph/linear-algebra.h>
/* SOT */
#include <dynamic-graph/entity.h>
#include <dynamic-graph/signal-ptr.h>
#include <dynamic-graph/signal-time-dependent.h>
#include <sot/core/matrix-geometry.hh>
/* STD */
#include <string>
......@@ -32,70 +30,59 @@
/* --- API ------------------------------------------------------------- */
/* --------------------------------------------------------------------- */
#if defined (WIN32)
# if defined (integrator_force_EXPORTS)
# define SOTINTEGRATORFORCE_EXPORT __declspec(dllexport)
# else
# define SOTINTEGRATORFORCE_EXPORT __declspec(dllimport)
# endif
#if defined(WIN32)
#if defined(integrator_force_EXPORTS)
#define SOTINTEGRATORFORCE_EXPORT __declspec(dllexport)
#else
# define SOTINTEGRATORFORCE_EXPORT
#define SOTINTEGRATORFORCE_EXPORT __declspec(dllimport)
#endif
#else
#define SOTINTEGRATORFORCE_EXPORT
#endif
namespace dynamicgraph { namespace sot {
namespace dynamicgraph {
namespace sot {
namespace dg = dynamicgraph;
/* --------------------------------------------------------------------- */
/* --- CLASS ----------------------------------------------------------- */
/* --------------------------------------------------------------------- */
class SOTINTEGRATORFORCE_EXPORT IntegratorForce
:public dg::Entity
{
class SOTINTEGRATORFORCE_EXPORT IntegratorForce : public dg::Entity {
public:
static const std::string CLASS_NAME;
virtual const std::string& getClassName( void ) const { return CLASS_NAME; }
virtual const std::string& getClassName(void) const { return CLASS_NAME; }
protected:
double timeStep;
static const double TIME_STEP_DEFAULT ; // = 5e-3
static const double TIME_STEP_DEFAULT; // = 5e-3
public: /* --- CONSTRUCTION --- */
IntegratorForce( const std::string& name );
virtual ~IntegratorForce( void );
IntegratorForce(const std::string& name);
virtual ~IntegratorForce(void);
public: /* --- SIGNAL --- */
dg::SignalPtr<dynamicgraph::Vector,int> forceSIN;
dg::SignalPtr<dynamicgraph::Matrix,int> massInverseSIN;
dg::SignalPtr<dynamicgraph::Matrix,int> frictionSIN;
dg::SignalPtr<dynamicgraph::Vector, int> forceSIN;
dg::SignalPtr<dynamicgraph::Matrix, int> massInverseSIN;
dg::SignalPtr<dynamicgraph::Matrix, int> frictionSIN;
/* Memory of the previous iteration. The sig is fed by the previous
* computations. */
dg::SignalPtr<dynamicgraph::Vector,int> velocityPrecSIN;
dg::SignalTimeDependent<dynamicgraph::Vector,int> velocityDerivativeSOUT;
dg::SignalTimeDependent<dynamicgraph::Vector,int> velocitySOUT;
dg::SignalPtr<dynamicgraph::Vector, int> velocityPrecSIN;
dg::SignalTimeDependent<dynamicgraph::Vector, int> velocityDerivativeSOUT;
dg::SignalTimeDependent<dynamicgraph::Vector, int> velocitySOUT;
dg::SignalPtr<dynamicgraph::Matrix,int> massSIN;
dg::SignalTimeDependent<dynamicgraph::Matrix,int> massInverseSOUT;
dg::SignalPtr<dynamicgraph::Matrix, int> massSIN;
dg::SignalTimeDependent<dynamicgraph::Matrix, int> massInverseSOUT;
public: /* --- FUNCTIONS --- */
dynamicgraph::Vector& computeDerivative( dynamicgraph::Vector& res,
const int& time );
dynamicgraph::Vector& computeIntegral( dynamicgraph::Vector& res,
const int& time );
dynamicgraph::Matrix& computeMassInverse( dynamicgraph::Matrix& res,
const int& time );
dynamicgraph::Vector& computeDerivative(dynamicgraph::Vector& res, const int& time);
dynamicgraph::Vector& computeIntegral(dynamicgraph::Vector& res, const int& time);
dynamicgraph::Matrix& computeMassInverse(dynamicgraph::Matrix& res, const int& time);
};
} /* namespace sot */
} /* namespace dynamicgraph */
} /* namespace sot */} /* namespace dynamicgraph */
#endif // #ifndef __SOT_WAISTATTITUDEFROMSENSOR_H__
#endif // #ifndef __SOT_WAISTATTITUDEFROMSENSOR_H__
......@@ -17,14 +17,12 @@
/* Matrix */
#include <dynamic-graph/linear-algebra.h>
/* SOT */
#include <dynamic-graph/entity.h>
#include <dynamic-graph/signal-ptr.h>
#include <dynamic-graph/signal-time-dependent.h>
#include <sot/core/matrix-geometry.hh>
/* STD */
#include <string>
......@@ -32,53 +30,48 @@
/* --- API ------------------------------------------------------------- */
/* --------------------------------------------------------------------- */
#if defined (WIN32)
# if defined (mass_apparent_EXPORTS)
# define SOTMASSAPPARENT_EXPORT __declspec(dllexport)
# else
# define SOTMASSAPPARENT_EXPORT __declspec(dllimport)
# endif
#if defined(WIN32)
#if defined(mass_apparent_EXPORTS)
#define SOTMASSAPPARENT_EXPORT __declspec(dllexport)
#else
# define SOTMASSAPPARENT_EXPORT
#define SOTMASSAPPARENT_EXPORT __declspec(dllimport)
#endif
#else
#define SOTMASSAPPARENT_EXPORT
#endif
namespace dynamicgraph {
namespace sot {
namespace dg = dynamicgraph;
namespace dynamicgraph { namespace sot {
namespace dg = dynamicgraph;
/* --------------------------------------------------------------------- */
/* --- CLASS ----------------------------------------------------------- */
/* --------------------------------------------------------------------- */
class SOTMASSAPPARENT_EXPORT MassApparent
:public dg::Entity
{
public:
static const std::string CLASS_NAME;
virtual const std::string& getClassName( void ) const { return CLASS_NAME; }
public: /* --- CONSTRUCTION --- */
MassApparent( const std::string& name );
virtual ~MassApparent( void );
public: /* --- SIGNAL --- */
dg::SignalPtr<dynamicgraph::Matrix,int> jacobianSIN;
dg::SignalPtr<dynamicgraph::Matrix,int> inertiaInverseSIN;
dg::SignalTimeDependent<dynamicgraph::Matrix,int> massInverseSOUT;
dg::SignalTimeDependent<dynamicgraph::Matrix,int> massSOUT;
dg::SignalPtr<dynamicgraph::Matrix,int> inertiaSIN;
dg::SignalTimeDependent<dynamicgraph::Matrix,int> inertiaInverseSOUT;
public: /* --- FUNCTIONS --- */
dynamicgraph::Matrix& computeMassInverse( dynamicgraph::Matrix& res,const int& time );
dynamicgraph::Matrix& computeMass( dynamicgraph::Matrix& res,const int& time );
dynamicgraph::Matrix& computeInertiaInverse( dynamicgraph::Matrix& res,const int& time );
};
} // namespace sot
} // namespace dynamicgraph
#endif // #ifndef __SOT_SOTMASSAPPARENT_H__
/* --------------------------------------------------------------------- */
/* --- CLASS ----------------------------------------------------------- */
/* --------------------------------------------------------------------- */
class SOTMASSAPPARENT_EXPORT MassApparent : public dg::Entity {
public:
static const std::string CLASS_NAME;
virtual const std::string& getClassName(void) const { return CLASS_NAME; }
public: /* --- CONSTRUCTION --- */
MassApparent(const std::string& name);
virtual ~MassApparent(void);
public: /* --- SIGNAL --- */
dg::SignalPtr<dynamicgraph::Matrix, int> jacobianSIN;
dg::SignalPtr<dynamicgraph::Matrix, int> inertiaInverseSIN;
dg::SignalTimeDependent<dynamicgraph::Matrix, int> massInverseSOUT;
dg::SignalTimeDependent<dynamicgraph::Matrix, int> massSOUT;
dg::SignalPtr<dynamicgraph::Matrix, int> inertiaSIN;
dg::SignalTimeDependent<dynamicgraph::Matrix, int> inertiaInverseSOUT;
public: /* --- FUNCTIONS --- */
dynamicgraph::Matrix& computeMassInverse(dynamicgraph::Matrix& res, const int& time);
dynamicgraph::Matrix& computeMass(dynamicgraph::Matrix& res, const int& time);
dynamicgraph::Matrix& computeInertiaInverse(dynamicgraph::Matrix& res, const int& time);
};
} // namespace sot
} // namespace dynamicgraph
#endif // #ifndef __SOT_SOTMASSAPPARENT_H__
......@@ -14,71 +14,63 @@
#include "dynamic-graph/linear-algebra.h"
#include <sot/core/matrix-geometry.hh>
/* --------------------------------------------------------------------- */
/* --- API ------------------------------------------------------------- */
/* --------------------------------------------------------------------- */
#if defined (WIN32)
# if defined (matrix_inertia_EXPORTS)
# define SOTMATRIXINERTIA_EXPORT __declspec(dllexport)
# else
# define SOTMATRIXINERTIA_EXPORT __declspec(dllimport)
# endif
#if defined(WIN32)
#if defined(matrix_inertia_EXPORTS)
#define SOTMATRIXINERTIA_EXPORT __declspec(dllexport)
#else
# define SOTMATRIXINERTIA_EXPORT
#define SOTMATRIXINERTIA_EXPORT __declspec(dllimport)
#endif
#else
#define SOTMATRIXINERTIA_EXPORT
#endif
namespace dynamicgraph { namespace sot {
namespace dynamicgraph {
namespace sot {
namespace dg = dynamicgraph;
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
class SOTMATRIXINERTIA_EXPORT MatrixInertia
{
public:
class SOTMATRIXINERTIA_EXPORT MatrixInertia {
public:
private:
MatrixInertia( void ) {}
MatrixInertia(void) {}
void initParents( void );
void initDofTable( void );
void initParents(void);
void initDofTable(void);
public:
MatrixInertia( CjrlHumanoidDynamicRobot* aHDR );
~MatrixInertia( void );
void init( CjrlHumanoidDynamicRobot* aHDR );
MatrixInertia(CjrlHumanoidDynamicRobot* aHDR);
~MatrixInertia(void);
void init(CjrlHumanoidDynamicRobot* aHDR);
public:
void update( void );
public:
void update(void);
void computeInertiaMatrix();
void getInertiaMatrix(double* A);
const maal::boost::Matrix& getInertiaMatrix( void );
const maal::boost::Matrix& getInertiaMatrix(void);
size_t getDoF() { return joints_.size(); }
private:
CjrlHumanoidDynamicRobot* aHDR_;
dynamicsJRLJapan::HumanoidDynamicMultiBody* aHDMB_;
std::vector<CjrlJoint*> joints_;
std::vector<int> parentIndex_;
std::vector< dynamicgraph::Matrix > Ic;
std::vector< dynamicgraph::Vector > phi;
std::vector< MatrixTwist > iVpi;
std::vector< MatrixForce > iVpiT;
private:
CjrlHumanoidDynamicRobot* aHDR_;
dynamicsJRLJapan::HumanoidDynamicMultiBody* aHDMB_;
std::vector<CjrlJoint*> joints_;
std::vector<int> parentIndex_;
std::vector<dynamicgraph::Matrix> Ic;
std::vector<dynamicgraph::Vector> phi;