Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • imaroger/jrl-walkgen
  • lscherrer/jrl-walkgen
2 results
Show changes
Showing
with 6556 additions and 5399 deletions
/*
* Copyright 2011
*
*
*
* Andrei Herdt
* Olivier Stasse
*
......@@ -20,146 +20,135 @@
* You should have received a copy of the GNU Lesser General Public License
* along with walkGenJrl. If not, see <http://www.gnu.org/licenses/>.
*
* Research carried out within the scope of the
* Research carried out within the scope of the
* Joint Japanese-French Robotics Laboratory (JRL)
*/
/*! \file FootTrajectoryGenerationStandard.h
\brief This object generate all the values for the foot trajectories.
@ingroup foottrajectorygeneration */
#ifndef _ONLINE_FOOT_TRAJECTORY_GENERATION_H_
#define _ONLINE_FOOT_TRAJECTORY_GENERATION_H_
#include <FootTrajectoryGeneration/FootTrajectoryGenerationStandard.hh>
namespace PatternGeneratorJRL
{
/// @ingroup foottrajectorygeneration
/// Generate online trajectories for the swinging and the stance foot some amount in the future.
class OnLineFootTrajectoryGeneration : public FootTrajectoryGenerationStandard
{
//
// Public methods:
//
public:
OnLineFootTrajectoryGeneration(SimplePluginManager *lSPM,CjrlFoot *aFoot);
virtual ~OnLineFootTrajectoryGeneration();
/// Interpolate piece of feet trajectories
///
/// \param[in] Time Current time
/// \param[in] CurrentSupport
/// \param[in] FPx Previewed foot position to be interpolated
/// \param[in] FPy Previewed foot position to be interpolated
/// \param[in] PreviewedSupportAngles_deq
/// \param[out] FinalLeftFootTraj_deq Left foot trajectory
/// \param[out] FinalRightFootTraj_deq Right foot trajectory
virtual void interpolate_feet_positions(double Time,
const deque<support_state_t> & PrwSupportStates_deq,
const solution_t & Solution,
const deque<double> & PreviewedSupportAngles_deq,
deque<FootAbsolutePosition> &FinalLeftFootTraj_deq,
deque<FootAbsolutePosition> &FinalRightFootTraj_deq);
virtual void interpolate_feet_positions(double Time, unsigned CurrentIndex,
const PatternGeneratorJRL::support_state_t &CurrentSupport,
std::vector<double> FootStepX,
std::vector<double> FootStepY,
std::vector<double> FootStepYaw,
deque<FootAbsolutePosition> &FinalLeftFootTraj_deq,
deque<FootAbsolutePosition> &FinalRightFootTraj_deq);
/// \name Accessors
/// \{
inline double QPSamplingPeriod() const
{ return QP_T_; };
inline void QPSamplingPeriod( double QP_T )
{ QP_T_ = QP_T; };
inline unsigned int NbSamplingsPreviewed() const
{ return QP_N_; };
inline void NbSamplingsPreviewed( unsigned int QP_N )
{ QP_N_ = QP_N; };
inline double FeetDistance() const
{ return FeetDistanceDS_; };
inline void FeetDistance( double FeetDistance )
{ FeetDistanceDS_ = FeetDistance; };
/// \}
//
// Protected methods:
//
protected:
/// \brief Check if the solution should be used as is and
/// propose alternative if not.
///
/// \param[out] X Solution
/// \param[out] Y Solution
/// \param[in] CurrentSupport
/// \param[in] CurrentTime
virtual void interpret_solution( double CurrentTime, const solution_t & Solution,
const support_state_t & CurrentSupport, unsigned int NbSteps, double & X, double & Y );
/// \brief Compute the position of the swinging and the stance foot.
/// Use polynomials for the X-axis, Y-axis,
/// orientation in the Oy axis, and orientation in the Oz axis.
/// Use a 4th order polynome for the Z-axis.
///
/// \param SupportFootTraj_deq: Queue of positions for the support foot.
/// Set the foot position at index CurrentAbsoluteIndex of the queue.
/// \param StanceFootTraj_deq: Queue of absolute position for the swinging
/// foot. Set the foot position at index NoneSupportFootAbsolutePositions of the queue.
/// \param StartIndex: Index in the queues of the foot position to be set.
/// \param k: Current sampling
/// \param UnlockedSwingPeriod: Amount of time where the swinging foot can move horizontally.
/// \param StepType: Type of steps (for book-keeping).
/// \param LeftOrRight: Specify if it is left (1) or right (-1).
virtual void UpdateFootPosition(deque<FootAbsolutePosition> &SupportFootTraj_deq,
deque<FootAbsolutePosition> &StanceFootTraj_deq,
int StartIndex, int k,
double LocalInterpolationStartTime,
double UnlockedSwingPeriod,
int StepType, int LeftOrRight);
/// \brief Compute the results of the polynome at time "t".
/// And fill the current none support foot absolute positions obect.
///
/// \param t : the time
/// \param curr_NSFAP : absolute position for the swinging
virtual void ComputeXYThetaFootPosition(double t,
FootAbsolutePosition& curr_NSFAP);
//
// Protected members
//
protected:
/// \brief Sampling period of the QP
double QP_T_;
/// \brief Nb previewed samplings
unsigned int QP_N_;
/// \brief Distance between feet centers in ds phase
double FeetDistanceDS_;
/// \brief Half of simple support passed trigger
bool HalfTimePassed_;
/// \brief vector containing the first preview support solution along the foot step
vector<double> FirstPrvSuppFootX_vec, FirstPrvSuppFootY_vec ;
/// \brief final position determined 3 iteration before landing
double FPx_,FPy_ ;
namespace PatternGeneratorJRL {
/// @ingroup foottrajectorygeneration
/// Generate online trajectories for the swinging and the stance foot some
/// amount in the future.
class OnLineFootTrajectoryGeneration : public FootTrajectoryGenerationStandard {
//
// Public methods:
//
public:
OnLineFootTrajectoryGeneration(SimplePluginManager *lSPM, PRFoot *aFoot);
virtual ~OnLineFootTrajectoryGeneration();
/// Interpolate piece of feet trajectories
///
/// \param[in] Time Current time
/// \param[in] CurrentSupport
/// \param[in] FPx Previewed foot position to be interpolated
/// \param[in] FPy Previewed foot position to be interpolated
/// \param[in] PreviewedSupportAngles_deq
/// \param[out] FinalLeftFootTraj_deq Left foot trajectory
/// \param[out] FinalRightFootTraj_deq Right foot trajectory
virtual void interpolate_feet_positions(
double Time, const deque<support_state_t> &PrwSupportStates_deq,
const solution_t &Solution,
const deque<double> &PreviewedSupportAngles_deq,
deque<FootAbsolutePosition> &FinalLeftFootTraj_deq,
deque<FootAbsolutePosition> &FinalRightFootTraj_deq);
virtual void interpolate_feet_positions(
double Time, unsigned CurrentIndex,
const PatternGeneratorJRL::support_state_t &CurrentSupport,
std::vector<double> FootStepX, std::vector<double> FootStepY,
std::vector<double> FootStepYaw,
deque<FootAbsolutePosition> &FinalLeftFootTraj_deq,
deque<FootAbsolutePosition> &FinalRightFootTraj_deq);
/// \name Accessors
/// \{
inline double QPSamplingPeriod() const { return QP_T_; };
inline void QPSamplingPeriod(double QP_T) { QP_T_ = QP_T; };
inline unsigned int NbSamplingsPreviewed() const { return QP_N_; };
inline void NbSamplingsPreviewed(unsigned int QP_N) { QP_N_ = QP_N; };
inline double FeetDistance() const { return FeetDistanceDS_; };
inline void FeetDistance(double FeetDistance) {
FeetDistanceDS_ = FeetDistance;
};
}
/// \}
//
// Protected methods:
//
protected:
/// \brief Check if the solution should be used as is and
/// propose alternative if not.
///
/// \param[out] X Solution
/// \param[out] Y Solution
/// \param[in] CurrentSupport
/// \param[in] CurrentTime
virtual void interpret_solution(double CurrentTime,
const solution_t &Solution,
const support_state_t &CurrentSupport,
unsigned int NbSteps, double &X, double &Y);
/// \brief Compute the position of the swinging and the stance foot.
/// Use polynomials for the X-axis, Y-axis,
/// orientation in the Oy axis, and orientation in the Oz axis.
/// Use a 4th order polynome for the Z-axis.
///
/// \param SupportFootTraj_deq: Queue of positions for the support foot.
/// Set the foot position at index CurrentAbsoluteIndex of the queue.
/// \param StanceFootTraj_deq: Queue of absolute position for the swinging
/// foot. Set the foot position at index NoneSupportFootAbsolutePositions of
/// the queue. \param StartIndex: Index in the queues of the foot position to
/// be set. \param k: Current sampling \param UnlockedSwingPeriod: Amount of
/// time where the swinging foot can move horizontally. \param StepType: Type
/// of steps (for book-keeping). \param LeftOrRight: Specify if it is left (1)
/// or right (-1).
virtual void UpdateFootPosition(
deque<FootAbsolutePosition> &SupportFootTraj_deq,
deque<FootAbsolutePosition> &StanceFootTraj_deq, int StartIndex, int k,
double LocalInterpolationStartTime, double UnlockedSwingPeriod,
int StepType, int LeftOrRight);
/// \brief Compute the results of the polynome at time "t".
/// And fill the current none support foot absolute positions obect.
///
/// \param t : the time
/// \param curr_NSFAP : absolute position for the swinging
virtual void ComputeXYThetaFootPosition(double t,
FootAbsolutePosition &curr_NSFAP);
//
// Protected members
//
protected:
/// \brief Sampling period of the QP
double QP_T_;
/// \brief Nb previewed samplings
unsigned int QP_N_;
/// \brief Distance between feet centers in ds phase
double FeetDistanceDS_;
/// \brief Half of simple support passed trigger
bool HalfTimePassed_;
/// \brief vector containing the first preview support solution along the foot
/// step
vector<double> FirstPrvSuppFootX_vec, FirstPrvSuppFootY_vec;
/// \brief final position determined 3 iteration before landing
double FPx_, FPy_;
};
} // namespace PatternGeneratorJRL
#endif /* _ONLINE_FOOT_TRAJECTORY_GENERATION_H_ */
/*
* Copyright 2009, 2010,
* Copyright 2009, 2010,
*
* Olivier Stasse
*
......@@ -18,32 +18,28 @@
* You should have received a copy of the GNU Lesser General Public License
* along with walkGenJrl. If not, see <http://www.gnu.org/licenses/>.
*
* Research carried out within the scope of the
* Research carried out within the scope of the
* Joint Japanese-French Robotics Laboratory (JRL)
*/
/*! \file GlobalStrategyManager.cpp
\brief This object defines a global strategy abstract object to generate an output
handled by the PatternGeneratorInterface object.
\brief This object defines a global strategy abstract object to generate
an output handled by the PatternGeneratorInterface object.
*/
#include <Debug.hh>
#include <deque>
#include <GlobalStrategyManagers/GlobalStrategyManager.hh>
#include <deque>
using namespace PatternGeneratorJRL;
GlobalStrategyManager::GlobalStrategyManager(SimplePluginManager *aPluginManager):
SimplePlugin(aPluginManager)
{
}
GlobalStrategyManager::GlobalStrategyManager(
SimplePluginManager *aPluginManager)
: SimplePlugin(aPluginManager) {}
void GlobalStrategyManager::SetBufferPositions(deque<ZMPPosition> * aZMPPositions,
deque<COMState> * aCOMBuffer,
deque<FootAbsolutePosition> *aLeftFootAbsolutePositions,
deque<FootAbsolutePosition> *aRightFootAbsolutePositions )
{
void GlobalStrategyManager::SetBufferPositions(
deque<ZMPPosition> *aZMPPositions, deque<COMState> *aCOMBuffer,
deque<FootAbsolutePosition> *aLeftFootAbsolutePositions,
deque<FootAbsolutePosition> *aRightFootAbsolutePositions) {
m_ZMPPositions = aZMPPositions;
m_COMBuffer = aCOMBuffer;
m_LeftFootPositions = aLeftFootAbsolutePositions;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.