Commit 8889ecd1 authored by NoelieRamuzat's avatar NoelieRamuzat Committed by Olivier Stasse
Browse files

[Phase Signal] Remove useless variable m_DoubleSupportPhaseState

Add comment on a if that might be useless
parent 8467d216
......@@ -175,9 +175,7 @@ class PatternGenerator_EXPORT PatternGenerator : public Entity {
/*! \brief Time step */
double m_TimeStep;
/*! \brief Double support phase detected. */
bool m_DoubleSupportPhaseState;
/*! \brief Current contact phase defined by enum: leftFoot=1, rightFoot=-1, doubleSupport=0. */
/*! \brief Current support/contact phase defined by enum: leftFoot=1, rightFoot=-1, doubleSupport=0. */
SupportPhase m_ContactPhase;
int m_DSStartingTime;
......
......@@ -317,7 +317,6 @@ PatternGenerator::PatternGenerator(const std::string &name)
m_LocalTime = 0;
m_count = 0;
m_TimeStep = 0.005;
m_DoubleSupportPhaseState = true;
m_ContactPhase = DOUBLE_SUPPORT_PHASE;
m_forceFeedBack = false;
m_feedBackControl = false;
......@@ -1523,29 +1522,34 @@ int &PatternGenerator::OneStepOfControl(int &dummy, int time) {
sotDEBUG(25) << "lLeftFootPosition.stepType: " << lLeftFootPosition.stepType
<< " lRightFootPosition.stepType: "
<< lRightFootPosition.stepType << endl;
// Find the support foot feet.
// If stepType = -1 -> single support phase on the dedicated foot
// If stepType = 10 -> double support phase (both feet should have stepType=10)
if ((lLeftFootPosition.stepType == 10) || (lRightFootPosition.stepType == 10)){
m_leftFootContact = true;
m_rightFootContact = true;
m_DoubleSupportPhaseState = true;
m_ContactPhase = DOUBLE_SUPPORT_PHASE;
}
if (lLeftFootPosition.stepType == -1) {
lSupportFoot = 1;
m_leftFootContact = true;
if ((lRightFootPosition.stepType != -1) && (lRightFootPosition.stepType != 10)){
// It is almost certain that when there is single support on a foot
// the other one cannot be in simple support (neither in double support)
// This if is certainly always true -> to be checked
if (lRightFootPosition.stepType != -1){
m_rightFootContact = false;
m_DoubleSupportPhaseState = false;
m_ContactPhase = LEFT_SUPPORT_PHASE;
}
} else if (lRightFootPosition.stepType == -1) {
lSupportFoot = 0;
m_rightFootContact = true;
if ((lLeftFootPosition.stepType != -1) && (lLeftFootPosition.stepType != 10)) {
// It is almost certain that when there is single support on a foot
// the other one cannot be in simple support (neither in double support)
// This if is certainly always true -> to be checked
if (lLeftFootPosition.stepType != -1) {
m_leftFootContact = false;
m_DoubleSupportPhaseState = false;
m_ContactPhase = RIGHT_SUPPORT_PHASE;
}
} else
......
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