Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guilhem Saurel
hpp-affordance
Commits
1998c652
Commit
1998c652
authored
Jun 29, 2018
by
t steve
Browse files
no longer considers shared ptr but pointers to fcl objects
parent
28e4555e
Changes
7
Hide whitespace changes
Inline
Side-by-side
include/hpp/affordance/affordance-extraction.hh
View file @
1998c652
...
...
@@ -70,7 +70,7 @@ namespace hpp {
};
// helper function to extract mesh model of an fcl::collisionObstacle
BVHModelOBConst_Ptr_t
GetModel
(
const
fcl
::
CollisionObject
Const
Ptr_t
&
object
);
BVHModelOBConst_Ptr_t
GetModel
(
FclConst
CollisionObjectPtr_t
object
);
/// \addtogroup affordance
/// \{
...
...
@@ -91,14 +91,14 @@ namespace hpp {
/// \param colObj reference to pointer to fcl::collisionObject
/// containing the found affordance objects.
Affordance
(
const
std
::
vector
<
unsigned
int
>&
idxVec
,
const
fcl
::
CollisionObjectPtr_t
&
colObj
)
:
FclConst
CollisionObjectPtr_t
colObj
)
:
indices_
(
idxVec
),
colObj_
(
colObj
)
{}
/// Triangle indices that correspond to the triangles of the reference
/// collisionObstacle, and form the affordance object.
std
::
vector
<
unsigned
int
>
indices_
;
/// Reference to the collisionObstacle the surfaces of which are used to
/// create the affordance object.
f
cl
::
CollisionObjectPtr_t
colObj_
;
F
cl
Const
CollisionObjectPtr_t
colObj_
;
};
/// Class containing a vector of vectors of Affordance objects.
/// The length of the outer vector corresponds to the amount of different
...
...
@@ -163,7 +163,7 @@ namespace hpp {
/// \param opVec vector of operation objects that determine which requirements
/// are set for which affordance type. The length of this vector
/// corresponds to the amount of different affordance types considered.
SemanticsDataPtr_t
affordanceAnalysis
(
const
fcl
::
CollisionObjectPtr_t
&
colObj
,
SemanticsDataPtr_t
affordanceAnalysis
(
FclConst
CollisionObjectPtr_t
colObj
,
const
OperationBases_t
&
opVec
);
/// Free function that, given a semanticsData pointer, creates one
...
...
include/hpp/affordance/fwd.hh
View file @
1998c652
...
...
@@ -49,6 +49,9 @@ namespace hpp {
typedef
boost
::
shared_ptr
<
SemanticsData
>
SemanticsDataPtr_t
;
typedef
boost
::
shared_ptr
<
Affordance
>
AffordancePtr_t
;
typedef
boost
::
shared_ptr
<
AffordanceExtraction
>
AffordanceExtractionPtr_t
;
typedef
fcl
::
CollisionObject
FclCollisionObject
;
typedef
fcl
::
CollisionObject
*
FclCollisionObjectPtr_t
;
typedef
const
fcl
::
CollisionObject
*
FclConstCollisionObjectPtr_t
;
}
// namespace affordance
}
// namespace hpp
...
...
src/affordance-extraction.cc
View file @
1998c652
...
...
@@ -27,7 +27,7 @@
namespace
hpp
{
namespace
affordance
{
BVHModelOBConst_Ptr_t
GetModel
(
const
fcl
::
CollisionObject
Const
Ptr_t
&
object
)
BVHModelOBConst_Ptr_t
GetModel
(
FclConst
CollisionObjectPtr_t
object
)
{
assert
(
object
->
collisionGeometry
()
->
getNodeType
()
==
fcl
::
BV_OBBRSS
);
const
BVHModelOBConst_Ptr_t
model
=
boost
::
static_pointer_cast
<
const
BVHModelOB
>
...
...
@@ -78,7 +78,7 @@ namespace hpp {
}
}
SemanticsDataPtr_t
affordanceAnalysis
(
const
fcl
::
CollisionObjectPtr_t
&
colObj
,
SemanticsDataPtr_t
affordanceAnalysis
(
FclConst
CollisionObjectPtr_t
colObj
,
const
OperationBases_t
&
opVec
)
{
BVHModelOBConst_Ptr_t
model
=
GetModel
(
colObj
);
...
...
tests/test-one-triangle1.cc
View file @
1998c652
...
...
@@ -61,7 +61,7 @@ BOOST_AUTO_TEST_CASE (one_triangle1)
model
->
addSubModel
(
vertices
,
triangles
);
model
->
endModel
();
boost
::
shared_ptr
<
fcl
::
CollisionObject
>
obj
(
new
fcl
::
CollisionObject
(
model
,
pose
));
fcl
::
CollisionObject
*
obj
(
new
fcl
::
CollisionObject
(
model
,
pose
));
hpp
::
affordance
::
SemanticsDataPtr_t
h
=
hpp
::
affordance
::
affordanceAnalysis
(
obj
,
operations
);
...
...
tests/test-one-triangle2.cc
View file @
1998c652
...
...
@@ -62,7 +62,7 @@ BOOST_AUTO_TEST_CASE (one_triangle2)
model
->
addSubModel
(
vertices
,
triangles
);
model
->
endModel
();
boost
::
shared_ptr
<
fcl
::
CollisionObject
>
obj
(
new
fcl
::
CollisionObject
(
model
,
pose
));
fcl
::
CollisionObject
*
obj
(
new
fcl
::
CollisionObject
(
model
,
pose
));
hpp
::
affordance
::
SemanticsDataPtr_t
h
=
hpp
::
affordance
::
affordanceAnalysis
(
obj
,
operations
);
...
...
tests/test-oriented-triangles1.cc
View file @
1998c652
...
...
@@ -67,7 +67,7 @@ BOOST_AUTO_TEST_CASE (oriented_triangles1)
model
->
addSubModel
(
vertices
,
triangles
);
model
->
endModel
();
boost
::
shared_ptr
<
fcl
::
CollisionObject
>
obj
(
new
fcl
::
CollisionObject
(
model
,
pose
));
fcl
::
CollisionObject
*
obj
(
new
fcl
::
CollisionObject
(
model
,
pose
));
hpp
::
affordance
::
SemanticsDataPtr_t
h
=
hpp
::
affordance
::
affordanceAnalysis
(
obj
,
operations
);
...
...
tests/test-oriented-triangles2.cc
View file @
1998c652
...
...
@@ -67,7 +67,7 @@ BOOST_AUTO_TEST_CASE (oriented_triangles2)
model
->
addSubModel
(
vertices
,
triangles
);
model
->
endModel
();
boost
::
shared_ptr
<
fcl
::
CollisionObject
>
obj
(
new
fcl
::
CollisionObject
(
model
,
pose
));
fcl
::
CollisionObject
*
obj
(
new
fcl
::
CollisionObject
(
model
,
pose
));
hpp
::
affordance
::
SemanticsDataPtr_t
h
=
hpp
::
affordance
::
affordanceAnalysis
(
obj
,
operations
);
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment