Skip to content
Snippets Groups Projects
Commit be9ecdd8 authored by Olivier Stasse's avatar Olivier Stasse
Browse files

Change test morisawa to reflect new test procedure.

parent f987fb2e
No related branches found
No related tags found
No related merge requests found
......@@ -5,18 +5,18 @@
*
* JRL, CNRS/AIST
*
* This file is part of walkGenJrl.
* walkGenJrl is free software: you can redistribute it and/or modify
* This file is part of jrl-walkgen.
* jrl-walkgen is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* walkGenJrl is distributed in the hope that it will be useful,
* jrl-walkgen is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Lesser Public License for more details.
* You should have received a copy of the GNU Lesser General Public License
* along with walkGenJrl. If not, see <http://www.gnu.org/licenses/>.
* along with jrl-walkgen. If not, see <http://www.gnu.org/licenses/>.
*
* Research carried out within the scope of the
* Joint Japanese-French Robotics Laboratory (JRL)
......@@ -155,61 +155,67 @@ protected:
double r = 100.0*(double)m_OneStep.NbOfIt/(double)StoppingTime;
if (m_OneStep.NbOfIt>StoppingTime) /* Stop after 30 seconds the on-line stepping */
/* Stop after 30 seconds the on-line stepping */
if (m_OneStep.NbOfIt>StoppingTime)
{
StopOnLineWalking(*m_PGI);
}
else{
if (m_OneStep.NbOfIt%200==0)
{
cout << "Progress " << (unsigned int)r << " "<< "\r";
cout.flush();
}
double triggertime = 9.8*200 + m_deltatime*200;
if ((m_OneStep.NbOfIt>triggertime) &&
m_TestChangeFoot)
{
PatternGeneratorJRL::FootAbsolutePosition aFAP;
if (m_NbStepsModified<NBOFPREDEFONLINEFOOTSTEPS)
{
aFAP.x = OnLineFootSteps[m_NbStepsModified][0];
aFAP.y = OnLineFootSteps[m_NbStepsModified][1];
aFAP.theta = OnLineFootSteps[m_NbStepsModified][2];
}
else
{
aFAP.x=0.1;
aFAP.y=0.0;
aFAP.theta=5.0;
}
double newtime;
bool stepHandledCorrectly=true;
try
{
m_PGI->ChangeOnLineStep(0.805,aFAP,newtime);
}
catch(...)
{
cerr << "Step not well handled." << endl;
stepHandledCorrectly=false;
}
if (stepHandledCorrectly)
{
m_deltatime += newtime+0.025;
m_TestChangeFoot=true;
m_NbStepsModified++;
if (m_NbStepsModified==360)
m_TestChangeFoot=false;
}
else
{
m_deltatime += 0.005;
}
}
}
else
{
/* Stay on the spot during 5.0 s before stopping. */
if (m_OneStep.NbOfIt<StoppingTime-200*5.0)
{
if (m_OneStep.NbOfIt%200==0)
{
cout << "Progress " << (unsigned int)r << " "<< "\r";
cout.flush();
}
double triggertime = 9.8*200 + m_deltatime*200;
if ((m_OneStep.NbOfIt>triggertime) &&
m_TestChangeFoot)
{
PatternGeneratorJRL::FootAbsolutePosition aFAP;
if (m_NbStepsModified<NBOFPREDEFONLINEFOOTSTEPS)
{
aFAP.x = OnLineFootSteps[m_NbStepsModified][0];
aFAP.y = OnLineFootSteps[m_NbStepsModified][1];
aFAP.theta = OnLineFootSteps[m_NbStepsModified][2];
}
else
{
aFAP.x=0.1;
aFAP.y=0.0;
aFAP.theta=5.0;
}
double newtime;
bool stepHandledCorrectly=true;
try
{
m_PGI->ChangeOnLineStep(0.805,aFAP,newtime);
}
catch(...)
{
cerr << "Step not well handled." << endl;
stepHandledCorrectly=false;
}
if (stepHandledCorrectly)
{
m_deltatime += newtime+0.025;
m_TestChangeFoot=true;
m_NbStepsModified++;
if (m_NbStepsModified==360)
m_TestChangeFoot=false;
}
else
{
m_deltatime += 0.005;
}
}
}
}
};
};
int PerformTests(int argc, char *argv[])
......
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