Skip to content

Commit 33e9b06

Browse files
authored
Merge pull request #68 from GiulioRomualdi/fix/is_stance_phase
Fix the stance phase machinery
2 parents 9963563 + 578f87d commit 33e9b06

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/TrajectoryPlanner/src/TrajectoryGenerator.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,9 @@ bool TrajectoryGenerator::getIsStancePhase(std::vector<bool>& isStancePhase)
666666
{
667667
// decreased the counter only if it is different from zero.
668668
// it is required to add a delay in the beginning of the stance phase
669-
stancePhaseDelayCounter = stancePhaseDelayCounter == 0 ? 0 : stancePhaseDelayCounter--;
669+
stancePhaseDelayCounter = (stancePhaseDelayCounter == 0)
670+
? 0
671+
: (stancePhaseDelayCounter - 1);
670672

671673
// the delay expired the robot can be considered stance
672674
if(stancePhaseDelayCounter == 0)

src/WalkingModule/src/Module.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ bool WalkingModule::advanceReferenceSignals()
8484
m_comHeightVelocity.pop_front();
8585
m_comHeightVelocity.push_back(m_comHeightVelocity.back());
8686

87+
m_isStancePhase.pop_front();
88+
m_isStancePhase.push_back(m_isStancePhase.back());
89+
8790
// at each sampling time the merge points are decreased by one.
8891
// If the first merge point is equal to 0 it will be dropped.
8992
// A new trajectory will be merged at the first merge point or if the deque is empty

0 commit comments

Comments
 (0)