Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RobotAPI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lennard Hofmann
RobotAPI
Commits
05381979
Commit
05381979
authored
9 years ago
by
Joshua Alexander Haustein
Browse files
Options
Downloads
Patches
Plain Diff
Temporarily removed load test from RobotIKTest
parent
70ca4157
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/RobotAPI/components/RobotIK/test/RobotIKTest.cpp
+60
-60
60 additions, 60 deletions
source/RobotAPI/components/RobotIK/test/RobotIKTest.cpp
with
60 additions
and
60 deletions
source/RobotAPI/components/RobotIK/test/RobotIKTest.cpp
+
60
−
60
View file @
05381979
...
...
@@ -37,8 +37,8 @@
#include
<iostream>
#include
<thread>
#include
<chrono>
#include
<ctime>
//
#include <chrono>
//
#include <ctime>
#include
<ratio>
#include
<random>
...
...
@@ -587,61 +587,61 @@ BOOST_AUTO_TEST_CASE(RobotIKLoadReachabilitySpaceTest)
BOOST_CHECK
(
testEnv
.
_robotIK
->
hasReachabilitySpace
(
nodeSetName
));
}
BOOST_AUTO_TEST_CASE
(
RobotIKLoadTest
)
{
RobotIKTestEnvironment
testEnv
(
"RobotIKLoadTest"
);
// set up time stuff
std
::
chrono
::
steady_clock
::
time_point
startPoint
=
std
::
chrono
::
steady_clock
::
now
();
std
::
chrono
::
duration
<
double
>
time_span
=
std
::
chrono
::
duration_cast
<
std
::
chrono
::
duration
<
double
>
>
(
std
::
chrono
::
steady_clock
::
now
()
-
startPoint
);
// set up random generators
std
::
default_random_engine
generator
;
//1234567890
// std::uniform_int_distribution<int> uniDistribution(0, 5);
std
::
uniform_int_distribution
<
int
>
uniDistribution
(
0
,
5
);
// some bookkeeping data structures
std
::
vector
<
std
::
thread
>
threads
;
bool
hikStarted
=
false
;
bool
hikFinished
=
false
;
bool
dummyFinished
=
false
;
while
(
time_span
.
count
()
<
120.0
)
{
int
testNumber
=
uniDistribution
(
generator
);
switch
(
testNumber
)
{
case
0
:
threads
.
push_back
(
std
::
thread
(
doGlobalPoseTests
,
std
::
ref
(
testEnv
),
std
::
ref
(
dummyFinished
)));
break
;
case
1
:
threads
.
push_back
(
std
::
thread
(
doFramedPoseTests
,
std
::
ref
(
testEnv
),
std
::
ref
(
dummyFinished
)));
break
;
case
2
:
threads
.
push_back
(
std
::
thread
(
doLoadReachabilityTest
,
std
::
ref
(
testEnv
),
std
::
ref
(
dummyFinished
)));
break
;
case
3
:
threads
.
push_back
(
std
::
thread
(
doDefineNodeSetTests
,
std
::
ref
(
testEnv
),
std
::
ref
(
dummyFinished
)));
break
;
case
4
:
threads
.
push_back
(
std
::
thread
(
doRobotIKComputeCoMIKTests
,
std
::
ref
(
testEnv
),
std
::
ref
(
dummyFinished
)));
break
;
case
5
:
if
(
!
hikStarted
)
{
hikStarted
=
true
;
// threads.push_back(std::thread(doRobotIKComputeHierarchicalDeltaIKTests, std::ref(testEnv), std::ref(hikFinished)));
}
break
;
}
if
(
hikFinished
)
{
hikStarted
=
false
;
hikFinished
=
false
;
}
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
seconds
(
uniDistribution
(
generator
)));
time_span
=
std
::
chrono
::
duration_cast
<
std
::
chrono
::
duration
<
double
>
>
(
std
::
chrono
::
steady_clock
::
now
()
-
startPoint
);
}
for
(
size_t
i
=
0
;
i
<
threads
.
size
();
++
i
)
{
threads
[
i
].
join
();
}
}
//
BOOST_AUTO_TEST_CASE(RobotIKLoadTest)
//
{
//
RobotIKTestEnvironment testEnv("RobotIKLoadTest");
//
// set up time stuff
//
std::chrono::steady_clock::time_point startPoint = std::chrono::steady_clock::now();
//
std::chrono::duration<double> time_span = std::chrono::duration_cast< std::chrono::duration<double> >(std::chrono::steady_clock::now() - startPoint);
//
// set up random generators
//
std::default_random_engine generator; //1234567890
//
// std::uniform_int_distribution<int> uniDistribution(0, 5);
//
std::uniform_int_distribution<int> uniDistribution(0, 5);
//
// some bookkeeping data structures
//
std::vector<std::thread> threads;
//
bool hikStarted = false;
//
bool hikFinished = false;
//
bool dummyFinished = false;
//
while (time_span.count() < 120.0)
//
{
//
int testNumber = uniDistribution(generator);
//
switch (testNumber)
//
{
//
case 0:
//
threads.push_back(std::thread(doGlobalPoseTests, std::ref(testEnv), std::ref(dummyFinished)));
//
break;
//
case 1:
//
threads.push_back(std::thread(doFramedPoseTests, std::ref(testEnv), std::ref(dummyFinished)));
//
break;
//
case 2:
//
threads.push_back(std::thread(doLoadReachabilityTest, std::ref(testEnv), std::ref(dummyFinished)));
//
break;
//
case 3:
//
threads.push_back(std::thread(doDefineNodeSetTests, std::ref(testEnv), std::ref(dummyFinished)));
//
break;
//
case 4:
//
threads.push_back(std::thread(doRobotIKComputeCoMIKTests, std::ref(testEnv), std::ref(dummyFinished)));
//
break;
//
case 5:
//
if (!hikStarted)
//
{
//
hikStarted = true;
//
// threads.push_back(std::thread(doRobotIKComputeHierarchicalDeltaIKTests, std::ref(testEnv), std::ref(hikFinished)));
//
}
//
break;
//
}
//
if (hikFinished)
//
{
//
hikStarted = false;
//
hikFinished = false;
//
}
//
std::this_thread::sleep_for(std::chrono::seconds(uniDistribution(generator)));
//
time_span = std::chrono::duration_cast< std::chrono::duration<double> >(std::chrono::steady_clock::now() - startPoint);
//
}
//
for (size_t i = 0; i < threads.size(); ++i)
//
{
//
threads[i].join();
//
}
//
}
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