Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
J
jrl-walkgen
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Guilhem Saurel
jrl-walkgen
Commits
51ae5ce1
Commit
51ae5ce1
authored
10 years ago
by
mnaveau
Browse files
Options
Downloads
Patches
Plain Diff
fix bug in the test
parent
eefa9613
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/ZMPRefTrajectoryGeneration/ZMPVelocityReferencedQP.cpp
+1
-1
1 addition, 1 deletion
src/ZMPRefTrajectoryGeneration/ZMPVelocityReferencedQP.cpp
tests/TestHerdt2010DynamicFilter.cpp
+120
-18
120 additions, 18 deletions
tests/TestHerdt2010DynamicFilter.cpp
with
121 additions
and
19 deletions
src/ZMPRefTrajectoryGeneration/ZMPVelocityReferencedQP.cpp
+
1
−
1
View file @
51ae5ce1
...
...
@@ -597,7 +597,7 @@ void ZMPVelocityReferencedQP::OnLine(double time,
RightFootTraj_deq_
,
deltaCOMTraj_deq_
);
#define DEBUG
//
#define DEBUG
#ifdef DEBUG
dynamicFilter_
->
Debug
(
FinalCOMTraj_deq
,
FinalLeftFootTraj_deq
,
...
...
This diff is collapsed.
Click to expand it.
tests/TestHerdt2010DynamicFilter.cpp
+
120
−
18
View file @
51ae5ce1
...
...
@@ -115,6 +115,99 @@ public:
localeventHandler_t
Handler
;
};
bool
doTest
(
ostream
&
os
)
{
// Set time reference.
m_clock
.
startingDate
();
/*! Open and reset appropriatly the debug files. */
prepareDebugFiles
();
for
(
unsigned
int
lNbIt
=
0
;
lNbIt
<
m_OuterLoopNbItMax
;
lNbIt
++
)
{
os
<<
"<===============================================================>"
<<
endl
;
os
<<
"Iteration nb: "
<<
lNbIt
<<
endl
;
m_clock
.
startPlanning
();
/*! According to test profile initialize the current profile. */
chooseTestProfile
();
m_clock
.
endPlanning
();
if
(
m_DebugHDR
!=
0
)
{
m_DebugHDR
->
currentConfiguration
(
m_PreviousConfiguration
);
m_DebugHDR
->
currentVelocity
(
m_PreviousVelocity
);
m_DebugHDR
->
currentAcceleration
(
m_PreviousAcceleration
);
m_DebugHDR
->
computeForwardKinematics
();
}
bool
ok
=
true
;
while
(
ok
)
{
m_clock
.
startOneIteration
();
if
(
m_PGIInterface
==
0
)
{
ok
=
m_PGI
->
RunOneStepOfTheControlLoop
(
m_CurrentConfiguration
,
m_CurrentVelocity
,
m_CurrentAcceleration
,
m_OneStep
.
ZMPTarget
,
m_OneStep
.
finalCOMPosition
,
m_OneStep
.
LeftFootPosition
,
m_OneStep
.
RightFootPosition
);
}
else
if
(
m_PGIInterface
==
1
)
{
ok
=
m_PGI
->
RunOneStepOfTheControlLoop
(
m_CurrentConfiguration
,
m_CurrentVelocity
,
m_CurrentAcceleration
,
m_OneStep
.
ZMPTarget
);
}
m_OneStep
.
NbOfIt
++
;
m_clock
.
stopOneIteration
();
m_PreviousConfiguration
=
m_CurrentConfiguration
;
m_PreviousVelocity
=
m_CurrentVelocity
;
m_PreviousAcceleration
=
m_CurrentAcceleration
;
/*! Call the reimplemented method to generate events. */
if
(
ok
)
{
m_clock
.
startModification
();
generateEvent
();
m_clock
.
stopModification
();
m_clock
.
fillInStatistics
();
/*! Fill the debug files with appropriate information. */
fillInDebugFiles
();
}
else
{
cerr
<<
"Nothing to dump after "
<<
m_OneStep
.
NbOfIt
<<
endl
;
}
}
os
<<
endl
<<
"End of iteration "
<<
lNbIt
<<
endl
;
os
<<
"<===============================================================>"
<<
endl
;
}
string
lProfileOutput
=
m_TestName
;
lProfileOutput
+=
"TimeProfile.dat"
;
m_clock
.
writeBuffer
(
lProfileOutput
);
m_clock
.
displayStatistics
(
os
,
m_OneStep
);
// Compare debugging files
return
compareDebugFiles
();
}
void
init
()
{
// Instanciate and initialize.
...
...
@@ -295,7 +388,7 @@ protected:
/// \brief Create file .hip .pos .zmp
/// --------------------
ofstream
aof
;
string
root
=
"/opt/grx/HRP2LAAS/etc/mnaveau
/
"
;
string
root
=
"/opt/grx/HRP2LAAS/etc/mnaveau"
;
string
aFileName
=
root
+
m_TestName
+
".pos"
;
if
(
iteration
==
0
)
{
...
...
@@ -504,6 +597,13 @@ protected:
aPGI
.
ParseCmd
(
strm2
);
}
}
void
walkForward1m_s
(
PatternGeneratorInterface
&
aPGI
)
{
{
istringstream
strm2
(
":setVelReference 0.1 0.0 0.0"
);
aPGI
.
ParseCmd
(
strm2
);
}
}
void
walkForward3m_s
(
PatternGeneratorInterface
&
aPGI
)
{
{
...
...
@@ -525,6 +625,13 @@ protected:
aPGI
.
ParseCmd
(
strm2
);
}
}
void
walkSidewards1m_s
(
PatternGeneratorInterface
&
aPGI
)
{
{
istringstream
strm2
(
":setVelReference 0.0 -0.1 0.0"
);
aPGI
.
ParseCmd
(
strm2
);
}
}
void
walkSidewards
(
PatternGeneratorInterface
&
aPGI
)
{
{
...
...
@@ -532,6 +639,13 @@ protected:
aPGI
.
ParseCmd
(
strm2
);
}
}
void
startWalkInDiagonal1m_s
(
PatternGeneratorInterface
&
aPGI
)
{
{
istringstream
strm2
(
":setVelReference 0.1 0.1 0.0"
);
aPGI
.
ParseCmd
(
strm2
);
}
}
void
startWalkInDiagonal2m_s
(
PatternGeneratorInterface
&
aPGI
)
{
{
...
...
@@ -587,23 +701,11 @@ protected:
#define localNbOfEvents 12
struct
localEvent
events
[
localNbOfEvents
]
=
{
{
5
*
200
,
&
TestHerdt2010
::
startWalkInDiagonal3m_s
},
{
8
*
200
,
&
TestHerdt2010
::
startWalkInDiagonal3m_s
},
{
10
*
200
,
&
TestHerdt2010
::
walkSidewards
},
{
12
*
200
,
&
TestHerdt2010
::
walkSidewards3m_s
},
{
15
*
200
,
&
TestHerdt2010
::
walkSidewards
},
{
20
*
200
,
&
TestHerdt2010
::
startTurningRightOnSpot
},
/* {25*200,&TestHerdt2010::startTurningRightOnSpot},
{35*200,&TestHerdt2010::walkForward},
{45*200,&TestHerdt2010::startTurningLeftOnSpot},*//*
{55*200,&TestHerdt2010::walkForward},
{65*200,&TestHerdt2010::startTurningRightOnSpot},
{75*200,&TestHerdt2010::walkForward},
{85*200,&TestHerdt2010::startTurningLeft},
{95*200,&TestHerdt2010::startTurningRight},*/
// {105*200,&TestHerdt2010::stop},
// {110*200,&TestHerdt2010::stopOnLineWalking}};
{
25
*
200
,
&
TestHerdt2010
::
stop
},
{
30
*
200
,
&
TestHerdt2010
::
stopOnLineWalking
}};
{
15
*
200
,
&
TestHerdt2010
::
startTurningRightOnSpot
},
{
25
*
200
,
&
TestHerdt2010
::
walkSidewards1m_s
},
{
35
*
200
,
&
TestHerdt2010
::
walkSidewards3m_s
},
{
50
*
200
,
&
TestHerdt2010
::
stop
},
{
55
*
200
,
&
TestHerdt2010
::
stopOnLineWalking
}};
// Test when triggering event.
for
(
unsigned
int
i
=
0
;
i
<
localNbOfEvents
;
i
++
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment