Commit 9d60d5d3 authored by Francois Bleibel's avatar Francois Bleibel
Browse files

Added support for optimized models (cf StackOfTask)

parent 6b48af12
...@@ -14,6 +14,8 @@ SET(${PROJECT_NAME}_HEADERS ...@@ -14,6 +14,8 @@ SET(${PROJECT_NAME}_HEADERS
integrator-force-rk4.h integrator-force-rk4.h
angle-estimator.h angle-estimator.h
dynamic-hrp2.h dynamic-hrp2.h
dynamic-hrp2_10_old.h
dynamic-hrp2_10.h
) )
# Recreate correct path for the headers # Recreate correct path for the headers
......
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
* Copyright JRL-Japan, 2010
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*
* File: DynamicHrp2_10.h
* Project: SOT
* Author: Olivier Stasse
* Nicolas Mansard
*
* For license see the file License.txt
*
*
* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
#ifndef __SOT_DYNAMIC_HRP2_10_H__
#define __SOT_DYNAMIC_HRP2_10_H__
/* --------------------------------------------------------------------- */
/* --- INCLUDE --------------------------------------------------------- */
/* --------------------------------------------------------------------- */
/* SOT */
#include <sot-dynamic/dynamic.h>
/* JRL dynamic */
#include "hrp2-10-optimized/hrp2-10-small-optimized.hh"
/* --------------------------------------------------------------------- */
/* --- API ------------------------------------------------------------- */
/* --------------------------------------------------------------------- */
#if defined (WIN32)
# if defined (dynamic_hrp2_10_EXPORTS)
# define DYNAMICHRP2_10_EXPORT __declspec(dllexport)
# else
# define DYNAMICHRP2_10_EXPORT __declspec(dllimport)
# endif
#else
# define DYNAMICHRP2_10_EXPORT
#endif
namespace sot {
/* --------------------------------------------------------------------- */
/* --- CLASS ----------------------------------------------------------- */
/* --------------------------------------------------------------------- */
/*! @ingroup signals
\brief Modification of the classic dynamic class to get the
optimized version of the kinematics computations.
*/
class DYNAMICHRP2_10_EXPORT DynamicHrp2_10
:public Dynamic
{
public:
static const std::string CLASS_NAME;
public: /* --- CONSTRUCTION --- */
DynamicHrp2_10( const std::string& name );
virtual ~DynamicHrp2_10( void );
public: /* --- MODEL CREATION --- */
void buildModelHrp2( void );
};
} // namespace sot
#endif // #ifndef __SOT_DYNAMIC_HRP2_H__
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
* Copyright JRL-Japan, 2010
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*
* File: DynamicHrp2_10_old.h
* Project: SOT
* Author: Olivier Stasse
* Nicolas Mansard
*
* For license see the file License.txt
*
*
* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
#ifndef __SOT_DYNAMIC_HRP2_10_old_H__
#define __SOT_DYNAMIC_HRP2_10_old_H__
/* --------------------------------------------------------------------- */
/* --- INCLUDE --------------------------------------------------------- */
/* --------------------------------------------------------------------- */
/* SOT */
#include <sot-dynamic/dynamic.h>
/* JRL dynamic */
#include "hrp2-10-optimized/hrp2-10-small-old-optimized.hh"
/* --------------------------------------------------------------------- */
/* --- API ------------------------------------------------------------- */
/* --------------------------------------------------------------------- */
#if defined (WIN32)
# if defined (dynamic_hrp2_10_old_EXPORTS)
# define DynamicHrp2_10_old_EXPORT __declspec(dllexport)
# else
# define DynamicHrp2_10_old_EXPORT __declspec(dllimport)
# endif
#else
# define DynamicHrp2_10_old_EXPORT
#endif
namespace sot {
/* --------------------------------------------------------------------- */
/* --- CLASS ----------------------------------------------------------- */
/* --------------------------------------------------------------------- */
/*! @ingroup signals
\brief Modification of the classic dynamic class to get the
optimized version of the kinematics computations.
*/
class DynamicHrp2_10_old_EXPORT DynamicHrp2_10_old
:public Dynamic
{
public:
static const std::string CLASS_NAME;
public: /* --- CONSTRUCTION --- */
DynamicHrp2_10_old( const std::string& name );
virtual ~DynamicHrp2_10_old( void );
public: /* --- MODEL CREATION --- */
void buildModelHrp2( void );
};
} // namespace sot
#endif // #ifndef __SOT_DYNAMIC_HRP2_H__
...@@ -50,6 +50,26 @@ IF(${DYNAMICSJRLJAPAN_FOUND}) ...@@ -50,6 +50,26 @@ IF(${DYNAMICSJRLJAPAN_FOUND})
ENDIF(${HRP2DYNAMICS_FOUND}) ENDIF(${HRP2DYNAMICS_FOUND})
ENDIF(${DYNAMICSJRLJAPAN_FOUND}) ENDIF(${DYNAMICSJRLJAPAN_FOUND})
IF(${_hrp210optimized_FOUND})
MESSAGE(STATUS "A MODIFIER")
LIST(APPEND libs dynamic-hrp2_10)
SET (dynamic-hrp2_10_plugins_dependencies dynamic)
SET(dynamic-hrp2_10_plugins_compile_flags
${_dynamicsJRLJapan_CFLAGS} ${_hrp210optimized_CFLAGS})
SET(dynamic-hrp2_10_plugins_link_flags
${_dynamicsJRLJapan_LDFLAGS} ${_hrp210optimized_LDFLAGS})
LIST(APPEND libs dynamic-hrp2_10_old)
SET (dynamic-hrp2_10_plugins_dependencies dynamic)
SET(dynamic-hrp2_10_old_plugins_compile_flags
${_dynamicsJRLJapan_CFLAGS} ${_hrp210optimized_CFLAGS})
SET(dynamic-hrp2_10_old_plugins_link_flags
${_dynamicsJRLJapan_LDFLAGS} ${_hrp210optimized_LDFLAGS})
ENDIF(${_hrp210optimized_FOUND})
SET(integrator-force-rk4_plugins_dependencies integrator-force) SET(integrator-force-rk4_plugins_dependencies integrator-force)
SET(integrator-force-exact_plugins_dependencies integrator-force) SET(integrator-force-exact_plugins_dependencies integrator-force)
...@@ -78,6 +98,10 @@ FOREACH(lib ${libs}) ...@@ -78,6 +98,10 @@ FOREACH(lib ${libs})
LINK_FLAGS "${${PROJECT_NAME}_src_LDFLAGS}" LINK_FLAGS "${${PROJECT_NAME}_src_LDFLAGS}"
) )
ENDIF(WIN32) ENDIF(WIN32)
SET_TARGET_PROPERTIES(${lib}
PROPERTIES
COMPILE_FLAGS "${${lib}_plugins_compile_flags}"
LINK_FLAGS "${${lib}_plugins_link_flags}")
IF(${lib}_plugins_dependencies) IF(${lib}_plugins_dependencies)
ADD_DEPENDENCIES(${lib} "${${lib}_plugins_dependencies}") ADD_DEPENDENCIES(${lib} "${${lib}_plugins_dependencies}")
......
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
* Copyright JRL-Japan, 2010
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*
* File: DynamicHrp2_10.h
* Project: SOT
* Author: Olivier Stasse
* Nicolas Mansard
*
* For license see license.txt
*
* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
#include <MatrixAbstractLayer/MatrixAbstractLayer.h>
#include <sot-dynamic/dynamic-hrp2_10.h>
#include <sot-core/debug.h>
#include <robotDynamics/jrlRobotDynamicsObjectConstructor.h>
#include <dynamic-graph/factory.h>
using namespace dynamicgraph;
using namespace sot;
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(DynamicHrp2_10,"DynamicHrp2_10");
DynamicHrp2_10::
DynamicHrp2_10( const std::string & name )
:Dynamic(name,false)
{
sotDEBUGIN(15);
DynamicHrp2_10::buildModelHrp2();
sotDEBUGOUT(15);
}
void DynamicHrp2_10::
buildModelHrp2( void )
{
sotDEBUGIN(15);
dynamicsJRLJapan::ObjectFactory aRobotDynamicsObjectConstructor;
hrp210Optimized<paramHrp210SmallOptimized> * aHDR =
new hrp210Optimized<paramHrp210SmallOptimized>(&aRobotDynamicsObjectConstructor);
m_HDR = aHDR;
if (aHDR==0)
{
std::cerr<< "Dynamic cast on HDR failed " << std::endl;
exit(-1);
}
sotDEBUGOUT(15);
}
DynamicHrp2_10::
~DynamicHrp2_10( void )
{
sotDEBUGINOUT(5);
return;
}
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
* Copyright JRL-Japan, 2010
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*
* File: DynamicHrp2_10.h
* Project: SOT
* Author: Olivier Stasse
* Nicolas Mansard
*
* For license see license.txt
*
* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
#include <MatrixAbstractLayer/MatrixAbstractLayer.h>
#include <sot-dynamic/dynamic-hrp2_10_old.h>
#include <sot-core/debug.h>
#include <robotDynamics/jrlRobotDynamicsObjectConstructor.h>
#include <dynamic-graph/factory.h>
using namespace dynamicgraph;
using namespace sot;
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(DynamicHrp2_10_old,"DynamicHrp2_10_old");
DynamicHrp2_10_old::
DynamicHrp2_10_old( const std::string & name )
:Dynamic(name,false)
{
sotDEBUGIN(15);
DynamicHrp2_10_old::buildModelHrp2();
sotDEBUGOUT(15);
}
void DynamicHrp2_10_old::
buildModelHrp2( void )
{
sotDEBUGIN(15);
dynamicsJRLJapan::ObjectFactory aRobotDynamicsObjectConstructor;
hrp210Optimized<paramHrp210SmallOldOptimized> * aHDR =
new hrp210Optimized<paramHrp210SmallOldOptimized>(&aRobotDynamicsObjectConstructor);
m_HDR = aHDR;
if (aHDR==0)
{
std::cerr<< "Dynamic cast on HDR failed " << std::endl;
exit(-1);
}
sotDEBUGOUT(15);
}
DynamicHrp2_10_old::
~DynamicHrp2_10_old( void )
{
sotDEBUGINOUT(5);
return;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment