Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
coal
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
Show more breadcrumbs
Coal
coal
Commits
b83f93ed
Commit
b83f93ed
authored
11 years ago
by
panjia1983
Browse files
Options
Downloads
Patches
Plain Diff
make pd deterministic
parent
19b5703d
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
test/test_fcl_xmldata.cpp
+4
-40
4 additions, 40 deletions
test/test_fcl_xmldata.cpp
with
4 additions
and
40 deletions
test/test_fcl_xmldata.cpp
+
4
−
40
View file @
b83f93ed
...
...
@@ -5,6 +5,7 @@
#include
"fcl/intersect.h"
#include
"fcl/collision.h"
#include
"fcl/math/sampling.h"
#include
"fcl/BVH/BVH_model.h"
#include
<boost/filesystem.hpp>
#include
<sstream>
...
...
@@ -18,6 +19,8 @@
using
namespace
fcl
;
static
void
loadSceneFile
(
const
std
::
string
&
filename
,
std
::
vector
<
std
::
vector
<
Vec3f
>
>&
points_array
,
std
::
vector
<
std
::
vector
<
Triangle
>
>&
triangles_array
,
...
...
@@ -294,46 +297,6 @@ static void scenePenetrationTest(const std::string& filename)
classifier
.
save
(
filename
+
"model.txt"
);
/*
PenetrationDepthRequest request0(&classifier, default_transform_distance_func);
request0.contact_vectors = contact_vectors;
PenetrationDepthResult result0;
penetrationDepth(m1, motions[0].first, m2, motions[0].second, request0, result0);
std::cout << "pd value 1 " << result0.pd_value << std::endl;
std::cout << "resolved tf translation " << result0.resolved_tf.getTranslation() << std::endl;
std::cout << "resolved tf rotation " << result0.resolved_tf.getRotation() << std::endl;
int num_pd_contacts = 1; // only one contact for pd, you can set a larger number if you want more
CollisionRequest pd_contact_request1(num_pd_contacts, true);
CollisionResult pd_contact_result1;
collide(m1, motions[0].first, m2, result0.resolved_tf, pd_contact_request1, pd_contact_result1);
if(pd_contact_result1.numContacts() > 0)
{
Contact contact1 = pd_contact_result1.getContact(0);
std::cout << "contact pos " << contact1.pos << std::endl;
std::cout << "contact normal " << contact1.normal << std::endl;
}
PenetrationDepthRequest request1(&classifier, default_transform_distance_func);
request1.contact_vectors = contact_vectors;
PenetrationDepthResult result1;
penetrationDepth(m1, motions[1].first, m2, motions[1].second, request1, result1);
std::cout << "pd value 2 " << result1.pd_value << std::endl;
std::cout << "resolved tf translation " << result1.resolved_tf.getTranslation() << std::endl;
std::cout << "resolved tf rotation " << result1.resolved_tf.getRotation() << std::endl;
CollisionRequest pd_contact_request2(num_pd_contacts, true);
CollisionResult pd_contact_result2;
collide(m1, motions[1].first, m2, result1.resolved_tf, pd_contact_request2, pd_contact_result2);
if(pd_contact_result2.numContacts() > 0)
{
Contact contact2 = pd_contact_result2.getContact(0);
std::cout << "contact pos " << contact2.pos << std::endl;
std::cout << "contact normal " << contact2.normal << std::endl;
}
*/
for
(
std
::
size_t
frame_id
=
0
;
frame_id
<
motions
.
size
();
++
frame_id
)
{
PenetrationDepthRequest
request
(
&
classifier
,
default_transform_distance_func
);
...
...
@@ -361,6 +324,7 @@ static void scenePenetrationTest(const std::string& filename)
BOOST_AUTO_TEST_CASE
(
scene_test_penetration
)
{
RNG
::
setSeed
(
1
);
boost
::
filesystem
::
path
path
(
TEST_RESOURCES_DIR
);
std
::
cout
<<
"scenario-1-2-3/Model_1_Scenario_1"
<<
std
::
endl
;
...
...
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