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

Revert "Change output of test results"

This reverts commit 2bf22e71.
parent 80d0ecad
No related branches found
No related tags found
No related merge requests found
......@@ -46,20 +46,20 @@ public:
{
m_TestProfile = TestProfile;
};
protected:
void startOnLineWalking(PatternGeneratorInterface &aPGI)
{
CommonInitialization(aPGI);
{
istringstream strm2(":SetAlgoForZmpTrajectory Herdt");
aPGI.ParseCmd(strm2);
}
{
istringstream strm2(":singlesupporttime 0.7");
......@@ -85,7 +85,7 @@ protected:
void chooseTestProfile()
{
switch(m_TestProfile)
{
......@@ -97,7 +97,7 @@ protected:
break;
}
}
void generateEvent()
{
unsigned int StoppingTime = 11*200;
......@@ -112,11 +112,10 @@ protected:
int PerformTests(int argc, char *argv[])
{
const unsigned int NbTests = 1;
std::string TestNames[NbTests] = { "TestHerdt2010OnLine" };
int TestProfiles[NbTests] = { PROFIL_HERDT_ONLINE_WALKING };
std::string TestNames[1] = { "TestHerdt2010OnLine"};
int TestProfiles[1] = { PROFIL_HERDT_ONLINE_WALKING};
for (unsigned int i=0;i<NbTests;i++)
for (unsigned int i=0;i<1;i++)
{
TestHerdt2010 aTH2010(argc,argv,
TestNames[i],
......@@ -125,11 +124,11 @@ int PerformTests(int argc, char *argv[])
{
if (!aTH2010.doTest(std::cout))
{
cout << "Test nb. " << i+1 <<" (of " << NbTests <<" test(s)) failed!!!"<< endl;
cout << "Failed test " << i << endl;
return -1;
}
else
cout << "Test nb. " << i+1 <<" (of " << NbTests <<" test(s)) passed."<< endl;
cout << "Passed test " << i << endl;
}
catch (const char * astr)
{ cerr << "Failed on following error " << astr << std::endl;
......
......@@ -46,8 +46,8 @@ namespace PatternGeneratorJRL
double filterprecision(double adb)
{
if (fabs(adb)<1e-7)
return 0.0;
return 0.0;
double ladb2 = adb * 1e7;
double lintadb2 = trunc(ladb2);
return lintadb2/1e7;
......@@ -55,8 +55,8 @@ namespace PatternGeneratorJRL
TestObject::TestObject(int argc, char *argv[],
string &aTestName,
int lPGIInterface)
string &aTestName,
int lPGIInterface)
{
m_TestName = aTestName;
m_PGIInterface = lPGIInterface;
......@@ -81,28 +81,28 @@ namespace PatternGeneratorJRL
/*! Extract options and fill in members. */
getOptions(argc,argv,
VRMLPath,
VRMLFileName,
SpecificitiesFileName,
LinkJointRank,
InitConfig,
m_TestProfile);
VRMLPath,
VRMLFileName,
SpecificitiesFileName,
LinkJointRank,
InitConfig,
m_TestProfile);
// Instanciate and initialize.
string RobotFileName = VRMLPath + VRMLFileName;
bool fileExist = false;
{
std::ifstream file (RobotFileName.c_str ());
fileExist = !file.fail ();
std::ifstream file (RobotFileName.c_str ());
fileExist = !file.fail ();
}
if (!fileExist)
throw std::string ("failed to open robot model");
throw std::string ("failed to open robot model");
CreateAndInitializeHumanoidRobot(RobotFileName,
SpecificitiesFileName,
LinkJointRank,
InitConfig,
SpecificitiesFileName,
LinkJointRank,
InitConfig,
m_HDR, m_DebugHDR, m_PGI);
// Specify the walking mode: here the default one.
......@@ -123,13 +123,13 @@ namespace PatternGeneratorJRL
{
if (m_HDR!=0)
delete m_HDR;
delete m_HDR;
if (m_DebugHDR!=0)
delete m_DebugHDR;
delete m_DebugHDR;
if (m_PGI!=0)
delete m_PGI;
delete m_PGI;
}
......@@ -137,23 +137,23 @@ namespace PatternGeneratorJRL
{
if (m_DebugZMP2)
{
{
ofstream aofzmpmb2;
string aFileName = m_TestName;
aFileName += "ZMPMBSTAGE2.dat";
aofzmpmb2.open(aFileName.c_str(),ofstream::out);
}
}
if (m_DebugFGPI)
{
{
ofstream aof;
string aFileName = m_TestName;
aFileName += "TestFGPI_description.dat";
aof.open(aFileName.c_str(),ofstream::out);
string Titles[26] =
{ "Time",
{ "Time",
"Com X",
"Com Y" ,
"Com Z" ,
......@@ -188,13 +188,13 @@ namespace PatternGeneratorJRL
aFileName += "TestFGPI.dat";
aof.open(aFileName.c_str(),ofstream::out);
aof.close();
}
}
}
void TestObject::fillInDebugFiles( )
{
if (m_DebugFGPI)
{
{
ofstream aof;
string aFileName;
aFileName = m_TestName;
......@@ -225,16 +225,16 @@ namespace PatternGeneratorJRL
<< filterprecision(m_OneStep.RightFootPosition.omega ) << " "
<< filterprecision(m_OneStep.RightFootPosition.omega2 ) << " "
<< filterprecision(m_OneStep.ZMPTarget(0)*cos(m_CurrentConfiguration(5)) -
m_OneStep.ZMPTarget(1)*sin(m_CurrentConfiguration(5))
+m_CurrentConfiguration(0) ) << " "
m_OneStep.ZMPTarget(1)*sin(m_CurrentConfiguration(5))
+m_CurrentConfiguration(0) ) << " "
<< filterprecision(m_OneStep.ZMPTarget(0)*sin(m_CurrentConfiguration(5)) +
m_OneStep.ZMPTarget(1)*cos(m_CurrentConfiguration(5))
+m_CurrentConfiguration(1) ) << " "
m_OneStep.ZMPTarget(1)*cos(m_CurrentConfiguration(5))
+m_CurrentConfiguration(1) ) << " "
<< filterprecision(m_CurrentConfiguration(0) ) << " "
<< filterprecision(m_CurrentConfiguration(1) ) << " "
<< endl;
aof.close();
}
}
}
......@@ -242,7 +242,7 @@ namespace PatternGeneratorJRL
{
bool SameFile= false;
if (m_DebugFGPI)
{
{
SameFile = true;
ifstream alif;
string aFileName;
......@@ -270,18 +270,14 @@ namespace PatternGeneratorJRL
for (unsigned int i=0;i<70;i++)
{
if (fabs(LocalInput[i]-
ReferenceInput[i])>=1e-5)
{
cout<<"... failed with: "<< "LocalInput["<<i<<"]: "<<LocalInput[i]<<
" ReferenceInput["<<i<<"]: "<<ReferenceInput[i]<<endl;
return false;
}
ReferenceInput[i])>=1e-6)
return false;
}
}
alif.close();
arif.close();
}
}
return SameFile;
}
......@@ -295,9 +291,9 @@ namespace PatternGeneratorJRL
prepareDebugFiles();
for (unsigned int lNbIt=0;lNbIt<m_OuterLoopNbItMax;lNbIt++)
{
{
os << "<===============================================================>"<<endl;
os << "Test iteration nb: " << lNbIt+1 << endl;
os << "Iteration nb: " << lNbIt << endl;
m_clock.startPlanning();
......@@ -360,9 +356,9 @@ namespace PatternGeneratorJRL
}
os << endl << "End of test iteration " << lNbIt+1 << endl;
os << endl << "End of iteration " << lNbIt << endl;
os << "<===============================================================>"<<endl;
}
}
string lProfileOutput= m_TestName;
lProfileOutput +="TimeProfile.dat";
......
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