Skip to content
Snippets Groups Projects
Commit ea40a4a2 authored by Olivier Stasse's avatar Olivier Stasse
Browse files

Add new structure to handle data related to constraints on feet.

parent c70d569f
No related branches found
No related tags found
No related merge requests found
/*
* Copyright 2010,
*
* Olivier Stasse
*
*
* JRL, CNRS/AIST
*
* This file is part of walkGenJrl.
* walkGenJrl is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* walkGenJrl is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Lesser Public License for more details.
* 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
* Joint Japanese-French Robotics Laboratory (JRL)
*/
#include <Mathematics/FootHalfSize.hh>
using namespace PatternGeneratorJRL;
FootHalfSize::FootHalfSize()
{
m_HalfWidth = -1.0;
m_HalfHeight = -1.0;
m_HalfWidthInit = -1.0;
m_HalfHeightInit = -1.0;
m_HalfHeightDS = -1.0;
// Variation around X < 1 cm by default.
m_ConstraintsOnX = 0.01;
// Variation around Y < 2 cm by default.
m_ConstraintsOnY = 0.02;
}
FootHalfSize::~FootHalfSize()
{
}
void FootHalfSize::setHalfSizeInit(double lHalfWidthInit,
double lHalfHeightInit)
{
m_HalfHeightInit = lHalfHeightInit;
m_HalfWidthInit = lHalfWidthInit;
updateHalfSize();
updateHalfHeightDS();
}
void FootHalfSize::updateHalfSize()
{
m_HalfWidth = 0.5 * m_HalfWidthInit;
m_HalfHeight = 0.5 * m_HalfHeightInit;
m_HalfWidth -= m_ConstraintsOnX;
m_HalfHeight -= m_ConstraintsOnY;
}
void FootHalfSize::updateHalfHeightDS()
{
double DSFeetDistance = 0.2;
m_HalfHeightDS = m_HalfHeight-m_ConstraintsOnX+DSFeetDistance/2.0;
}
void FootHalfSize::setConstraints(double OnX, double OnY)
{
m_ConstraintsOnX = OnX;
m_ConstraintsOnX = OnY;
updateHalfSize();
updateHalfHeightDS();
}
double FootHalfSize::getHalfHeight() const
{
return m_HalfHeight;
}
double FootHalfSize::getHalfWidth() const
{
return m_HalfWidth;
}
double FootHalfSize::getHalfHeightDS() const
{
return m_HalfHeightDS;
}
/*
* Copyright 2010,
*
* Olivier Stasse
*
*
* JRL, CNRS/AIST
*
* This file is part of walkGenJrl.
* walkGenJrl is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* walkGenJrl is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Lesser Public License for more details.
* 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
* Joint Japanese-French Robotics Laboratory (JRL)
*/
#ifndef _FOOT_HALF_SIZE_H_
#define _FOOT_HALF_SIZE_H_
namespace PatternGeneratorJRL
{
/*! This class handles the size and the constraints related to the feet
*/
class FootHalfSize
{
public:
FootHalfSize();
~FootHalfSize();
void setHalfSizeInit(double lHalfWidth,
double lHalfHeight);
void setConstraints(double OnX,
double OnY);
protected:
void updateHalfHeightDS();
void updateHalfSize();
private:
double m_HalfHeight;
double m_HalfWidth;
double m_HalfHeightDS;
double m_HalfHeightInit;
double m_HalfWidthInit;
double m_ConstraintsOnX;
double m_ConstraintsOnY;
public:
double getHalfHeight() const;
double getHalfWidth() const;
double getHalfHeightDS() const;
};
};
#endif /* _FOOT_HALF_SIZE_H_*/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment