Skip to content
Snippets Groups Projects
Commit 59f915c1 authored by Francois Keith's avatar Francois Keith
Browse files

Add a patch preventing wrong memory access.

Please check if this patch corrects or destroys the realization of others PGs.
parent a6928b26
No related branches found
No related tags found
No related merge requests found
......@@ -162,7 +162,10 @@ int LinearizedInvertedPendulum2D::Interpolation(deque<COMState> &COMStates,
int lCurrentPosition = CurrentPosition;
// Fill the queues with the interpolated CoM values.
for(int lk=0;lk<=m_InterpolationInterval;lk++,lCurrentPosition++)
//TODO: with TestHerdt, it is mandatory to use COMStates.size()-1, or it will crash.
// Is it the same for the other PG ? Please check.
int loopEnd = std::min<int>( m_InterpolationInterval, ((int)COMStates.size())-1-CurrentPosition);
for(int lk=0;lk<=loopEnd;lk++,lCurrentPosition++)
{
ODEBUG("lCurrentPosition: "<< lCurrentPosition);
COMState & aCOMPos = COMStates[lCurrentPosition];
......
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