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
Humanoid Path Planner
hpp-affordance
Commits
13d85602
Commit
13d85602
authored
May 13, 2016
by
Akseppal
Browse files
remove useless function and add neighbouringTriangleMargin as member of OperationBase class
parent
5935307c
Changes
3
Hide whitespace changes
Inline
Side-by-side
include/hpp/affordance/affordance-extraction.hh
View file @
13d85602
...
...
@@ -173,10 +173,7 @@ namespace hpp {
std
::
vector
<
CollisionObjects_t
>
getAffordanceObjects
(
const
SemanticsDataPtr_t
&
sData
);
/// Free helper function that creates a vector of operation objects.
OperationBases_t
createOperations
();
/// \}
/// \}
}
// namespace affordance
}
// namespace hpp
...
...
include/hpp/affordance/operations.hh
View file @
13d85602
...
...
@@ -36,16 +36,19 @@ namespace hpp {
/// affordance type called "noAffordance" is created as default,
/// with certain default values for its member variables. This
/// constructor should not be used..!
OperationBase
()
:
zWorld_
(
0
,
0
,
1
),
margin_
(
0.3
),
minArea
_
(
0.
05
),
affordance_
(
"noAffordance"
)
{}
OperationBase
()
:
zWorld_
(
0
,
0
,
1
),
margin_
(
0.3
),
neighbouringTriangleMargin
_
(
0.
3
),
minArea_
(
0.05
),
affordance_
(
"noAffordance"
)
{}
/// Constructor that allows for user-defined parameters. Default values are given for
/// parameters that are not defined by the user.
/// \param margin Margin needed for the evaluation of the requirement function
/// \param minArea Minimum area needed for the formation of an affordance object
/// \param affordanceName The name of the affordance type
explicit
OperationBase
(
const
double
margin
=
0.3
,
const
double
minArea
=
0.05
,
const
char
*
affordanceName
=
"noAffordance"
)
:
zWorld_
(
0
,
0
,
1
),
margin_
(
margin
),
minArea_
(
minArea
),
affordance_
(
affordanceName
)
{}
explicit
OperationBase
(
const
double
margin
=
0.3
,
const
double
nbTriMargin
=
0.3
,
const
double
minArea
=
0.05
,
const
char
*
affordanceName
=
"noAffordance"
)
:
zWorld_
(
0
,
0
,
1
),
margin_
(
margin
),
neighbouringTriangleMargin_
(
nbTriMargin
),
minArea_
(
minArea
),
affordance_
(
affordanceName
)
{}
/// Fully virtual function that will determine whether or not a given
/// triangle normal fullfils the requirement of a child class. If yes,
/// the tested triangle forms part of a potential affordance.
...
...
@@ -55,6 +58,9 @@ namespace hpp {
const
fcl
::
Vec3f
zWorld_
;
/// The error margin within which the requirement function must be fullfilled.
const
double
margin_
;
/// The margin for the deviation of the normal of neighbouring triangles.
/// Used to determine affordance objects comprising more than one triangle.
const
double
neighbouringTriangleMargin_
;
/// The minimum area required for an affordance object. The total area may
/// comprise multiple triangles.
const
double
minArea_
;
...
...
@@ -70,9 +76,10 @@ namespace hpp {
/// \param margin Margin needed for the evaluation of the requirement function
/// \param minArea Minimum area needed for the formation of an affordance object
/// \param affordanceName The name of the affordance type
explicit
SupportOperation
(
const
double
margin
=
0.3
,
const
double
minArea
=
0.05
,
explicit
SupportOperation
(
const
double
margin
=
0.3
,
const
double
nbTriMargin
=
0.3
,
const
double
minArea
=
0.05
,
const
char
*
affordanceName
=
"Support"
)
:
OperationBase
(
margin
,
minArea
,
affordanceName
)
{}
OperationBase
(
margin
,
nbTriMargin
,
minArea
,
affordanceName
)
{}
/// The implementation of the requirement function for Support affordances
/// overrides the virtual function in class OperationBase.
/// \param nromal Normal vector of the tested triangle.
...
...
@@ -90,9 +97,10 @@ namespace hpp {
/// \param margin Margin needed for the evaluation of the requirement function
/// \param minArea Minimum area needed for the formation of an affordance object
/// \param affordanceName The name of the affordance type
explicit
LeanOperation
(
const
double
margin
=
0.3
,
const
double
minArea
=
0.05
,
explicit
LeanOperation
(
const
double
margin
=
0.3
,
const
double
nbTriMargin
=
0.3
,
const
double
minArea
=
0.05
,
const
char
*
affordanceName
=
"Lean"
)
:
OperationBase
(
margin
,
minArea
,
affordanceName
)
{}
OperationBase
(
margin
,
nbTriMargin
,
minArea
,
affordanceName
)
{}
/// The implementation of the requirement function for Lean affordances
/// overrides the virtual function in class OperationBase.
/// \param nromal Normal vector of the tested triangle.
...
...
src/affordance-extraction.cc
View file @
13d85602
...
...
@@ -62,7 +62,7 @@ namespace hpp {
||
(
refPoints
[
vertIdx
]
-
searchTri
.
points
.
p2
).
sqrLength
()
<
margin
||
(
refPoints
[
vertIdx
]
-
searchTri
.
points
.
p3
).
sqrLength
()
<
margin
)
{
if
(
refOp
->
requirement
(
searchTri
.
normal
))
{
if
((
searchTri
.
normal
-
refTri
.
normal
).
sqrLength
()
<
m
argin
Rad
)
{
if
((
searchTri
.
normal
-
refTri
.
normal
).
sqrLength
()
<
refOp
->
neighbouringTriangleM
argin
_
)
{
area
+=
searchTri
.
area
;
listPotential
.
push_back
(
searchIdx
);
searchLinkedTriangles
(
listPotential
,
refOp
,
allTris
,
...
...
@@ -203,18 +203,6 @@ namespace hpp {
return
affObjs
;
}
OperationBases_t
createOperations
()
{
affordance
::
SupportOperationPtr_t
support
(
new
affordance
::
SupportOperation
());
affordance
::
LeanOperationPtr_t
lean
(
new
affordance
::
LeanOperation
(
0.1
));
affordance
::
OperationBases_t
operations
;
operations
.
push_back
(
support
);
operations
.
push_back
(
lean
);
return
operations
;
}
}
// namespace affordance
}
// namespace hpp
...
...
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