Commit 7d15b517 authored by Olivier Stasse's avatar Olivier Stasse
Browse files

Simplify PatternGenerator Interface through one structure.

First step: need to be tested and strongify.
parent 6ad43e0e
...@@ -193,6 +193,13 @@ public: ...@@ -193,6 +193,13 @@ public:
FootAbsolutePosition &RightFootPosition, FootAbsolutePosition &RightFootPosition,
ZMPPosition &ZMPRefPos, ZMPPosition &ZMPRefPos,
COMPosition &COMRefPos) = 0; COMPosition &COMRefPos) = 0;
/*! \brief Rune One Step of the global control loop
*/
virtual bool
RunOneStepOfTheControlLoop(
ControlLoopOneStepArgs &aControlLoopOneStepArgs) =0;
/*! @} */ /*! @} */
/*! Set the current joint values of the robot. /*! Set the current joint values of the robot.
......
...@@ -60,6 +60,7 @@ struct WALK_GEN_JRL_EXPORT COMPosition_s { ...@@ -60,6 +60,7 @@ struct WALK_GEN_JRL_EXPORT COMPosition_s {
struct COMPosition_s &operator=(const COMState_s &aCS); struct COMPosition_s &operator=(const COMState_s &aCS);
}; };
inline std::ostream &operator<<(std::ostream &os, const COMPosition_s &aCp) { inline std::ostream &operator<<(std::ostream &os, const COMPosition_s &aCp) {
for (size_t i = 0; i < 3; ++i) { for (size_t i = 0; i < 3; ++i) {
os << "x[" << i << "] " << aCp.x[i] << " y[" << i << "] " << aCp.y[i] os << "x[" << i << "] " << aCp.x[i] << " y[" << i << "] " << aCp.y[i]
...@@ -270,5 +271,16 @@ inline std::ostream &operator<<(std::ostream &os, const Circle_t &circle) { ...@@ -270,5 +271,16 @@ inline std::ostream &operator<<(std::ostream &os, const Circle_t &circle) {
return os; return os;
} }
struct ControlLoopOneStepArgs {
Eigen::VectorXd CurrentConfiguration;
Eigen::VectorXd CurrentVelocity;
Eigen::VectorXd CurrentAcceleration;
Eigen::VectorXd ZMPTarget;
COMState finalCOMState;
FootAbsolutePosition LeftFootPosition;
FootAbsolutePosition RightFootPosition;
Eigen::VectorXd Momentum;
};
} // namespace PatternGeneratorJRL } // namespace PatternGeneratorJRL
#endif #endif
...@@ -201,9 +201,9 @@ public: ...@@ -201,9 +201,9 @@ public:
inline Eigen::VectorXd &currentRPYAcceleration() { return m_arpy; } inline Eigen::VectorXd &currentRPYAcceleration() { return m_arpy; }
inline Eigen::VectorXd &currentTau() { return m_tau; } inline Eigen::VectorXd &currentTau() { return m_tau; }
inline unsigned numberDof() { return m_robotModel->nq; } inline unsigned numberDof() { return (unsigned)m_robotModel->nq; }
inline unsigned numberVelDof() { return m_robotModel->nv; } inline unsigned numberVelDof() { return (unsigned)m_robotModel->nv; }
inline void zeroMomentumPoint(Eigen::Vector3d &zmp) { inline void zeroMomentumPoint(Eigen::Vector3d &zmp) {
m_externalForces = m_robotData->liMi[1].act(m_robotData->f[1]); m_externalForces = m_robotData->liMi[1].act(m_robotData->f[1]);
......
...@@ -258,6 +258,9 @@ public: ...@@ -258,6 +258,9 @@ public:
FootAbsolutePosition &RightFootPosition, FootAbsolutePosition &RightFootPosition,
ZMPPosition &ZMPRefPos, ZMPPosition &ZMPRefPos,
COMPosition &COMRefPos); COMPosition &COMRefPos);
bool RunOneStepOfTheControlLoop(ControlLoopOneStepArgs &aControlLoopStepArgs);
/*! @} */ /*! @} */
/*! Set the current joint values of the robot. /*! Set the current joint values of the robot.
......
Markdown is supported
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