Commit 7c1d0cf1 authored by mnaveau's avatar mnaveau
Browse files

start including Pinocchio in the PatternGenerator

parent 88bc0a6c
......@@ -43,14 +43,15 @@ ENDIF(SYS_TIME_H)
# Required dependencies
ADD_REQUIRED_DEPENDENCY("jrl-mal >= 1.9.0")
ADD_REQUIRED_DEPENDENCY("abstract-robot-dynamics >= 1.15")
ADD_REQUIRED_DEPENDENCY("jrl-dynamics >= 1.19.1")
ADD_REQUIRED_DEPENDENCY("pinocchio >= 1.1.0")
#ADD_REQUIRED_DEPENDENCY("abstract-robot-dynamics >= 1.15")
#ADD_REQUIRED_DEPENDENCY("jrl-dynamics >= 1.19.1")
################################################################
ADD_OPTIONAL_DEPENDENCY("hrp2-14 >= 1.8-6")
ADD_OPTIONAL_DEPENDENCY("hrp2-dynamics >= 1.0.1")
#ADD_OPTIONAL_DEPENDENCY("pinocchio >= 1.0.1")
ADD_OPTIONAL_DEPENDENCY("metapod >= 1.0.7")
#ADD_OPTIONAL_DEPENDENCY("hrp2-14 >= 1.8-6")
#ADD_OPTIONAL_DEPENDENCY("hrp2-dynamics >= 1.0.1")
#
#ADD_OPTIONAL_DEPENDENCY("metapod >= 1.0.7")
#################################################################
# Search for qpOases
......
......@@ -35,7 +35,7 @@
#define _PATTERN_GENERATOR_INTERFACE_H_
#include <deque>
#include <abstract-robot-dynamics/humanoid-dynamic-robot.hh>
#include <PinocchioRobot.hh>
#include <jrl/walkgen/pgtypes.hh>
namespace PatternGeneratorJRL
......@@ -60,7 +60,7 @@ namespace PatternGeneratorJRL
@param strm: Should provide the file to initialize the preview control,
the path to the VRML model, and the name of the file containing the VRML model.
*/
PatternGeneratorInterface(CjrlHumanoidDynamicRobot *) {};
PatternGeneratorInterface(PinocchioRobot *) {};
/*! Destructor */
virtual ~PatternGeneratorInterface() {};
......@@ -303,7 +303,7 @@ namespace PatternGeneratorJRL
};
/*! Factory of Pattern generator interface. */
WALK_GEN_JRL_EXPORT PatternGeneratorInterface * patternGeneratorInterfaceFactory(CjrlHumanoidDynamicRobot *aHDR);
WALK_GEN_JRL_EXPORT PatternGeneratorInterface * patternGeneratorInterfaceFactory(PinocchioRobot *);
}
......
......@@ -32,6 +32,7 @@ ADD_DEFINITIONS("/DLSSOL_FOUND")
ENDIF(USE_LSSOL)
SET(INCLUDES
PinocchioRobot.hh
PreviewControl/rigid-body.hh
PreviewControl/OptimalControllerSolver.hh
PreviewControl/rigid-body-system.hh
......@@ -112,6 +113,7 @@ ENDIF(${qpOASES_FOUND} STREQUAL "TRUE")
SET(SOURCES
${INCLUDES}
PinocchioRobot.cpp
FootTrajectoryGeneration/FootTrajectoryGenerationAbstract.cpp
FootTrajectoryGeneration/FootTrajectoryGenerationStandard.cpp
FootTrajectoryGeneration/FootTrajectoryGenerationMultiple.cpp
......@@ -207,15 +209,15 @@ ADD_LIBRARY(jrl-walkgen SHARED ${SOURCES} ${${PROJECT_NAME}_ABSOLUTE_HEADERS})
SET_TARGET_PROPERTIES(jrl-walkgen PROPERTIES SOVERSION ${PROJECT_VERSION})
# Define dependencies
TARGET_LINK_LIBRARIES(jrl-walkgen metapod_${model_name} ${Boost_LIBRARIES})
#TARGET_LINK_LIBRARIES(jrl-walkgen metapod_${model_name} ${Boost_LIBRARIES})
SET_TARGET_PROPERTIES(jrl-walkgen PROPERTIES COMPILE_FLAGS "-msse -msse2 -msse3 -march=core2 -mfpmath=sse -fivopts -ftree-loop-im -fipa-pta ")
INSTALL(TARGETS jrl-walkgen DESTINATION ${CMAKE_INSTALL_LIBDIR})
PKG_CONFIG_USE_DEPENDENCY(jrl-walkgen abstract-robot-dynamics)
#PKG_CONFIG_USE_DEPENDENCY(jrl-walkgen abstract-robot-dynamics)
PKG_CONFIG_USE_DEPENDENCY(jrl-walkgen jrl-mal)
PKG_CONFIG_USE_DEPENDENCY(jrl-walkgen jrl-dynamics)
#PKG_CONFIG_USE_DEPENDENCY(jrl-walkgen pinocchio)
#PKG_CONFIG_USE_DEPENDENCY(jrl-walkgen jrl-dynamics)
PKG_CONFIG_USE_DEPENDENCY(jrl-walkgen pinocchio)
IF(USE_LSSOL)
PKG_CONFIG_USE_DEPENDENCY(jrl-walkgen lssol)
......
......@@ -34,7 +34,7 @@
using namespace PatternGeneratorJRL;
FootTrajectoryGenerationAbstract::FootTrajectoryGenerationAbstract(SimplePluginManager *lSPM,
CjrlFoot *aFoot)
PRFoot *aFoot)
: SimplePlugin(lSPM)
{
m_Omega = 0.0;
......
......@@ -38,8 +38,8 @@
/*! MatrixAbstractLayer */
#include <jrl/mal/matrixabstractlayer.hh>
/* dynamics JRL Japan related inclusions */
#include <abstract-robot-dynamics/foot.hh>
/* dynamics pinocchio related inclusions */
#include <PinocchioRobot.hh>
/* Walking pattern generation related inclusions */
......@@ -86,7 +86,7 @@ namespace PatternGeneratorJRL
/*! Constructor: In order to compute some appropriate strategies,
this class needs to extract specific details from the humanoid model. */
FootTrajectoryGenerationAbstract(SimplePluginManager *lSPM,
CjrlFoot *inFoot) ;
PRFoot *inFoot) ;
/*! Default destructor. */
......@@ -229,7 +229,7 @@ namespace PatternGeneratorJRL
double m_TDouble;
/*! Store a pointer to Foot information. */
CjrlFoot * m_Foot;
PRFoot * m_Foot;
/*! Omega the angle for taking off and landing. */
double m_Omega;
......
......@@ -33,7 +33,7 @@
using namespace PatternGeneratorJRL;
FootTrajectoryGenerationMultiple::FootTrajectoryGenerationMultiple(SimplePluginManager *lSPM,
CjrlFoot *aFoot)
PRFoot *aFoot)
: SimplePlugin(lSPM)
{
m_Foot = aFoot;
......
......@@ -77,7 +77,7 @@ namespace PatternGeneratorJRL
/*! Constructor: In order to compute some appropriate strategies,
this class needs to extract specific details from the humanoid model. */
FootTrajectoryGenerationMultiple(SimplePluginManager *lSPM,
CjrlFoot *aFoot);
PRFoot *aFoot);
// Default destructor
~FootTrajectoryGenerationMultiple();
......@@ -222,7 +222,7 @@ namespace PatternGeneratorJRL
std::vector<FootTrajectoryGenerationStandard *> m_SetOfFootTrajectoryGenerationObjects;
/*! \brief Reference of humanoid specificities. */
CjrlFoot * m_Foot;
PRFoot * m_Foot;
/*! \brief Set the absolute reference time for this set of intervals. */
double m_AbsoluteTimeReference;
......
......@@ -34,7 +34,7 @@
using namespace PatternGeneratorJRL;
FootTrajectoryGenerationStandard::FootTrajectoryGenerationStandard(SimplePluginManager *lSPM,
CjrlFoot *aFoot)
PRFoot *aFoot)
: FootTrajectoryGenerationAbstract(lSPM,aFoot)
{
/* Initialize the pointers to polynomes. */
......@@ -55,14 +55,17 @@ FootTrajectoryGenerationStandard::FootTrajectoryGenerationStandard(SimplePluginM
from humanoid specific informations. */
double lWidth,lHeight,lDepth;
if (m_Foot!=0)
m_Foot->getSoleSize(lWidth,lHeight);
{
lWidth = m_Foot->soleWidth ;
lHeight = m_Foot->soleHeight ;
}
else
{
cerr << "Pb no ref Foot." << endl;
}
vector3d AnklePosition;
if (m_Foot!=0)
m_Foot->getAnklePositionInLocalFrame(AnklePosition);
AnklePosition = m_Foot->anklePosition;
else
{
cerr << "Pb no ref Foot." << endl;
......@@ -82,10 +85,11 @@ FootTrajectoryGenerationStandard::FootTrajectoryGenerationStandard(SimplePluginM
/* Compute Left foot coordinates */
if (m_Foot!=0)
{
m_Foot->getAnklePositionInLocalFrame(AnklePosition);
m_Foot->getSoleSize(lWidth,lHeight);
}
{
lWidth = m_Foot->soleWidth ;
lHeight = m_Foot->soleHeight ;
AnklePosition = m_Foot->anklePosition;
}
else
{
cerr << "Pb no ref Foot." << endl;
......
......@@ -68,7 +68,7 @@ namespace PatternGeneratorJRL
/*! Constructor: In order to compute some appropriate strategies,
this class needs to extract specific details from the humanoid model. */
FootTrajectoryGenerationStandard(SimplePluginManager *lSPM,CjrlFoot *aFoot);
FootTrajectoryGenerationStandard(SimplePluginManager *lSPM,PRFoot *aFoot);
/*! Default destructor. */
virtual ~FootTrajectoryGenerationStandard();
......
......@@ -37,7 +37,7 @@ using namespace PatternGeneratorJRL;
LeftAndRightFootTrajectoryGenerationMultiple::
LeftAndRightFootTrajectoryGenerationMultiple(SimplePluginManager *lSPM,
CjrlFoot * lFoot) : SimplePlugin(lSPM)
PRFoot *lFoot) : SimplePlugin(lSPM)
{
m_Omega = 0.0;
m_Omega2 = 0.0;
......@@ -67,7 +67,7 @@ LeftAndRightFootTrajectoryGenerationMultiple(SimplePluginManager *lSPM,
}
CjrlFoot* LeftAndRightFootTrajectoryGenerationMultiple::getFoot() const
PRFoot* LeftAndRightFootTrajectoryGenerationMultiple::getFoot() const
{
return m_Foot;
}
......
......@@ -33,7 +33,7 @@
#include <jrl/mal/matrixabstractlayer.hh>
/* abstractRobotDynamics inclusion */
#include <abstract-robot-dynamics/foot.hh>
#include <PinocchioRobot.hh>
/* Walking Pattern Generator inclusion */
......@@ -66,7 +66,7 @@ namespace PatternGeneratorJRL
public:
/*! \brief The constructor initialize the plugin part, and the data related to the humanoid. */
LeftAndRightFootTrajectoryGenerationMultiple(SimplePluginManager * lSPM,
CjrlFoot * inFoot);
PRFoot * inFoot);
/*! \brief Copy constructor. */
LeftAndRightFootTrajectoryGenerationMultiple(const LeftAndRightFootTrajectoryGenerationMultiple &);
......@@ -164,7 +164,7 @@ namespace PatternGeneratorJRL
unsigned int ChangedInterval);
/*! Returns foot */
CjrlFoot * getFoot() const;
PRFoot *getFoot() const;
protected:
......@@ -182,7 +182,7 @@ namespace PatternGeneratorJRL
FootTrajectoryGenerationMultiple * m_RightFootTrajectory;
/*! Humanoid specificities object handler */
CjrlFoot * m_Foot;
PRFoot * m_Foot;
/*! Set of time intervals */
std::vector<double> m_DeltaTj;
......
......@@ -36,7 +36,7 @@
using namespace PatternGeneratorJRL;
OnLineFootTrajectoryGeneration::OnLineFootTrajectoryGeneration(SimplePluginManager *lSPM,
CjrlFoot *aFoot)
PRFoot *aFoot)
: FootTrajectoryGenerationStandard(lSPM,aFoot)
{
QP_T_ = 0.0 ;
......@@ -531,4 +531,4 @@ void OnLineFootTrajectoryGeneration::interpolate_feet_positions(
FinalRightFootTraj_deq[CurrentIndex+k].stepType = 10;
}
}
}
\ No newline at end of file
}
......@@ -46,7 +46,7 @@ namespace PatternGeneratorJRL
//
public:
OnLineFootTrajectoryGeneration(SimplePluginManager *lSPM,CjrlFoot *aFoot);
OnLineFootTrajectoryGeneration(SimplePluginManager *lSPM,PRFoot *aFoot);
virtual ~OnLineFootTrajectoryGeneration();
......
......@@ -45,7 +45,7 @@ CoMAndFootOnlyStrategy::~CoMAndFootOnlyStrategy()
{
}
int CoMAndFootOnlyStrategy::InitInterObjects(CjrlHumanoidDynamicRobot * /* aHDR */,
int CoMAndFootOnlyStrategy::InitInterObjects(PinocchioRobot * /* aPR */,
std::vector<ComAndFootRealization *> aCFR,
StepStackHandler * /* aSSH */)
{
......
......@@ -130,7 +130,7 @@ namespace PatternGeneratorJRL
deque<FootAbsolutePosition> & aRightFootAbsolutePositions);
/*! \brief Initialization of the inter objects relationship. */
int InitInterObjects(CjrlHumanoidDynamicRobot * aHDR,
int InitInterObjects(PinocchioRobot * aPR,
std::vector<ComAndFootRealization *> aCFR,
StepStackHandler * aSSH);
......
......@@ -70,12 +70,12 @@ DoubleStagePreviewControlStrategy::~DoubleStagePreviewControlStrategy()
}
int DoubleStagePreviewControlStrategy::InitInterObjects(CjrlHumanoidDynamicRobot *aHDR,
ComAndFootRealization * aCFR,
StepStackHandler * aSSH)
int DoubleStagePreviewControlStrategy::InitInterObjects(PinocchioRobot *aPR,
ComAndFootRealization * aCFR,
StepStackHandler * aSSH)
{
setHumanoidDynamicRobot(aHDR);
m_ZMPpcwmbz->setHumanoidDynamicRobot(m_HumanoidDynamicRobot);
setHumanoidDynamicRobot(aPR);
m_ZMPpcwmbz->setPinocchioRobot(m_PinocchioRobot);
m_ZMPpcwmbz->setComAndFootRealization(aCFR);
m_StepStackHandler = aSSH;
return 1;
......
......@@ -99,7 +99,7 @@ namespace PatternGeneratorJRL
{ m_StepStackHandler = aSSH; }
/*! \brief Initialization of the inter objects relationship. */
int InitInterObjects(CjrlHumanoidDynamicRobot * aHDR,
int InitInterObjects(PinocchioRobot * aPR,
ComAndFootRealization * aCFR,
StepStackHandler * aSSH);
......
......@@ -33,10 +33,9 @@
#include <jrl/mal/matrixabstractlayer.hh>
// Dynamics
#include <abstract-robot-dynamics/humanoid-dynamic-robot.hh>
#include <PinocchioRobot.hh>
// PG
#include <jrl/walkgen/pgtypes.hh>
#include <SimplePlugin.hh>
#include <PreviewControl/PreviewControl.hh>
......@@ -168,20 +167,20 @@ namespace PatternGeneratorJRL
int m_ZMPCoMTrajectoryAlgorithm;
/*! Reference to the humanoid structure. */
CjrlHumanoidDynamicRobot *m_HumanoidDynamicRobot ;
PinocchioRobot *m_PinocchioRobot ;
public:
/*! \name Setter and getter for the jrlHumanoidDynamicRobot object. */
/*! @param[in] aHumanoidDynamicRobot: an object able to compute dynamic parameters
of the robot. */
inline bool setHumanoidDynamicRobot(CjrlHumanoidDynamicRobot *aHumanoidDynamicRobot)
{ m_HumanoidDynamicRobot = aHumanoidDynamicRobot;
inline bool setHumanoidDynamicRobot(PinocchioRobot *aHumanoidDynamicRobot)
{ m_PinocchioRobot = aHumanoidDynamicRobot;
return true;}
/*! \brief Returns the object able to compute the dynamic parameters of the robot. */
inline CjrlHumanoidDynamicRobot * getHumanoidDynamicRobot() const
{ return m_HumanoidDynamicRobot;}
inline PinocchioRobot * getHumanoidDynamicRobot() const
{ return m_PinocchioRobot;}
/** @} */
......
......@@ -41,10 +41,10 @@ using namespace PatternGeneratorJRL;
FootConstraintsAsLinearSystem::FootConstraintsAsLinearSystem(SimplePluginManager *aSPM,
CjrlHumanoidDynamicRobot *aHS) :
PinocchioRobot *aPR) :
SimplePlugin(aSPM)
{
m_HS = aHS;
m_PR = aPR;
//RESETDEBUG5("Constraints-FCSALS.dat");
}
......@@ -271,13 +271,13 @@ int FootConstraintsAsLinearSystem::BuildLinearConstraintInequalities(deque<FootA
lRightFootHalfWidth,lRightFootHalfHeight;
// Read humanoid specificities.
CjrlFoot * lRightFoot = m_HS->rightFoot();
lRightFoot->getSoleSize(lRightFootHalfWidth,lRightFootHalfHeight);
vector3d AnklePosition;
lRightFoot->getAnklePositionInLocalFrame(AnklePosition);
CjrlFoot * lLeftFoot = m_HS->leftFoot();
lLeftFoot->getSoleSize(lLeftFootHalfWidth,lLeftFootHalfHeight);
PRFoot * lRightFoot = m_PR->rightFoot();
lRightFootHalfWidth = lRightFoot->soleWidth ;
lRightFootHalfHeight = lRightFoot->soleHeight;
PRFoot * lLeftFoot = m_PR->leftFoot();
lLeftFootHalfWidth = lLeftFoot->soleWidth ;
lLeftFootHalfHeight = lLeftFoot->soleHeight ;
lRightFootHalfWidth *= 0.5;
lRightFootHalfHeight *= 0.5;
......
......@@ -38,7 +38,7 @@
#include <jrl/mal/matrixabstractlayer.hh>
#include <abstract-robot-dynamics/humanoid-dynamic-robot.hh>
#include <PinocchioRobot.hh>
#include <jrl/walkgen/pgtypes.hh>
......@@ -58,7 +58,7 @@ namespace PatternGeneratorJRL
/*! Constructor */
FootConstraintsAsLinearSystem(SimplePluginManager *aSPM,
CjrlHumanoidDynamicRobot *aHS);
PinocchioRobot *aPR);
/*! Destructor */
~FootConstraintsAsLinearSystem();
......@@ -103,7 +103,7 @@ namespace PatternGeneratorJRL
private:
/* ! Reference on the Humanoid Specificities. */
CjrlHumanoidDynamicRobot * m_HS;
PinocchioRobot * m_PR;
};
}
......
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