Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
sot-pattern-generator
Commits
8889ecd1
Commit
8889ecd1
authored
Jun 10, 2020
by
NoelieRamuzat
Committed by
Olivier Stasse
Jun 12, 2020
Browse files
[Phase Signal] Remove useless variable m_DoubleSupportPhaseState
Add comment on a if that might be useless
parent
8467d216
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/sot/pattern-generator/pg.h
View file @
8889ecd1
...
...
@@ -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
;
...
...
src/pg.cpp
View file @
8889ecd1
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment