diff --git a/src/FootTrajectoryGeneration/OnLineFootTrajectoryGeneration.cpp b/src/FootTrajectoryGeneration/OnLineFootTrajectoryGeneration.cpp index ec3ade95699b8d6367235d05b6f46647a9a35f1e..f9bd58c4845128d87fd41ee45675e1d6811edb73 100644 --- a/src/FootTrajectoryGeneration/OnLineFootTrajectoryGeneration.cpp +++ b/src/FootTrajectoryGeneration/OnLineFootTrajectoryGeneration.cpp @@ -231,7 +231,7 @@ OnLineFootTrajectoryGeneration::interpret_solution( double CurrentTime, const so Sign = 1.0; else Sign = -1.0; - if(CurrentSupport.NbStepsLeft > 0) + if(CurrentSupport.NbStepsLeft > 0 && NbSteps > 0 ) { X = Solution.Solution_vec[2*QP_N_]; Y = Solution.Solution_vec[2*QP_N_+NbSteps]; @@ -264,9 +264,13 @@ OnLineFootTrajectoryGeneration::interpolate_feet_positions(double Time, { support_state_t CurrentSupport = PrwSupportStates_deq.front(); - unsigned int NbStepsPrwd = PrwSupportStates_deq.back().StepNumber; + double FPx, FPy; - interpret_solution( Time, Solution, CurrentSupport, NbStepsPrwd, FPx, FPy ); + if(CurrentSupport.Phase != DS) + { + unsigned int NbStepsPrwd = PrwSupportStates_deq.back().StepNumber; + interpret_solution( Time, Solution, CurrentSupport, NbStepsPrwd, FPx, FPy ); + } double LocalInterpolationTime = Time-(CurrentSupport.TimeLimit-(m_TDouble+m_TSingle));