Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
ddp-actuator-solver
Commits
82773959
Commit
82773959
authored
Jul 26, 2015
by
flforget
Browse files
add time execution measurment
parent
06308f76
Changes
1
Hide whitespace changes
Inline
Side-by-side
qtTmp/main.cpp
View file @
82773959
...
...
@@ -8,14 +8,15 @@
#include
<Eigen/Dense>
#include
<time.h>
#include
<sys/time.h>
using
namespace
std
;
using
namespace
Eigen
;
int
main
()
{
clock_t
t1
,
t2
;
t1
=
clock
()
;
struct
timeval
tbegin
,
tend
;
double
texec
=
0.0
;
stateVec_t
xinit
,
xDes
;
xinit
<<
0.0
,
0.0
,
0.0
,
0.0
;
...
...
@@ -30,13 +31,17 @@ int main()
CostFunctionRomeoActuator
costRomeoActuator
;
ILQRSolver
testSolverRomeoActuator
(
romeoActuatorModel
,
costRomeoActuator
);
testSolverRomeoActuator
.
initSolver
(
xinit
,
xDes
,
T
,
dt
,
iterMax
,
stopCrit
);
gettimeofday
(
&
tbegin
,
NULL
);
testSolverRomeoActuator
.
solveTrajectory
();
gettimeofday
(
&
tend
,
NULL
);
usleep
(
1000000
);
t2
=
clock
();
texec
=
((
double
)(
1000
*
(
tend
.
tv_sec
-
tbegin
.
tv_sec
)
+
((
tend
.
tv_usec
-
tbegin
.
tv_usec
)
/
1000
)))
/
1000.
;
cout
<<
t2
<<
endl
;
cout
<<
t1
<<
endl
;
cout
<<
"temps d'execution total du solveeur "
;
cout
<<
texec
<<
endl
;
cout
<<
"temps d'execution par pas de temps "
;
cout
<<
texec
/
T
<<
endl
;
return
0
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment