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-constraints
Commits
f3dd0444
Commit
f3dd0444
authored
Feb 03, 2022
by
Florent Lamiraux
Browse files
[ConvexShapeContact] Move definition of isEqual to cc file.
parent
f0c6c35b
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/hpp/constraints/convex-shape-contact.hh
View file @
f3dd0444
...
...
@@ -154,21 +154,7 @@ namespace hpp {
const
JointAndShapes_t
&
floorSurfaces
,
const
JointAndShapes_t
&
objectSurfaces
);
bool
isEqual
(
const
DifferentiableFunction
&
other
)
const
{
const
ConvexShapeContact
&
castother
=
dynamic_cast
<
const
ConvexShapeContact
&>
(
other
);
if
(
!
DifferentiableFunction
::
isEqual
(
other
))
return
false
;
if
(
robot_
!=
castother
.
robot_
)
return
false
;
if
(
objectConvexShapes_
.
size
()
!=
castother
.
objectConvexShapes_
.
size
())
return
false
;
for
(
std
::
size_t
i
=
0
;
i
<
objectConvexShapes_
.
size
();
i
++
)
if
(
floorConvexShapes_
[
i
]
!=
castother
.
floorConvexShapes_
[
i
])
return
false
;
return
true
;
}
bool
isEqual
(
const
DifferentiableFunction
&
other
)
const
;
private:
/// Add a ConvexShape as an object.
...
...
@@ -270,12 +256,8 @@ namespace hpp {
const
JointAndShapes_t
&
floorSurfaces
,
const
JointAndShapes_t
&
objectSurfaces
);
bool
isEqual
(
const
DifferentiableFunction
&
other
)
const
{
const
ConvexShapeContactComplement
&
castother
=
dynamic_cast
<
const
ConvexShapeContactComplement
&>
(
other
);
if
(
!
DifferentiableFunction
::
isEqual
(
other
))
return
false
;
return
(
*
sibling_
!=
*
(
castother
.
sibling_
));
}
bool
isEqual
(
const
DifferentiableFunction
&
other
)
const
;
private:
void
impl_compute
(
LiegroupElementRef
result
,
ConfigurationIn_t
argument
)
const
;
...
...
@@ -335,18 +317,8 @@ namespace hpp {
virtual
void
impl_jacobian
(
matrixOut_t
jacobian
,
vectorIn_t
arg
)
const
;
bool
isEqual
(
const
DifferentiableFunction
&
other
)
const
{
const
ConvexShapeContactHold
&
castother
=
dynamic_cast
<
const
ConvexShapeContactHold
&>
(
other
);
if
(
!
DifferentiableFunction
::
isEqual
(
other
))
return
false
;
if
(
constraint_
!=
castother
.
constraint_
)
return
false
;
if
(
complement_
!=
castother
.
complement_
)
return
false
;
return
true
;
}
bool
isEqual
(
const
DifferentiableFunction
&
other
)
const
;
private:
ConvexShapeContactPtr_t
constraint_
;
ConvexShapeContactComplementPtr_t
complement_
;
...
...
src/convex-shape-contact.cc
View file @
f3dd0444
...
...
@@ -58,6 +58,22 @@ namespace hpp {
computeRadius
();
}
bool
ConvexShapeContact
::
isEqual
(
const
DifferentiableFunction
&
other
)
const
{
const
ConvexShapeContact
&
castother
=
dynamic_cast
<
const
ConvexShapeContact
&>
(
other
);
if
(
!
DifferentiableFunction
::
isEqual
(
other
))
return
false
;
if
(
robot_
!=
castother
.
robot_
)
return
false
;
if
(
objectConvexShapes_
.
size
()
!=
castother
.
objectConvexShapes_
.
size
())
return
false
;
for
(
std
::
size_t
i
=
0
;
i
<
objectConvexShapes_
.
size
();
i
++
)
if
(
floorConvexShapes_
[
i
]
!=
castother
.
floorConvexShapes_
[
i
])
return
false
;
return
true
;
}
ConvexShapeContactPtr_t
ConvexShapeContact
::
create
(
const
std
::
string
&
name
,
DevicePtr_t
robot
,
const
JointAndShapes_t
&
floorSurfaces
,
...
...
@@ -339,6 +355,16 @@ namespace hpp {
{
}
bool
ConvexShapeContactComplement
::
isEqual
(
const
DifferentiableFunction
&
other
)
const
{
const
ConvexShapeContactComplement
&
castother
=
dynamic_cast
<
const
ConvexShapeContactComplement
&>
(
other
);
if
(
!
DifferentiableFunction
::
isEqual
(
other
))
return
false
;
return
(
*
sibling_
!=
*
(
castother
.
sibling_
));
}
std
::
pair
<
ConvexShapeContactPtr_t
,
ConvexShapeContactComplementPtr_t
>
ConvexShapeContactComplement
::
createPair
...
...
@@ -495,5 +521,19 @@ namespace hpp {
complement_
->
impl_jacobian
(
jacobian
.
bottomRows
<
3
>
(),
arg
);
}
bool
ConvexShapeContactHold
::
isEqual
(
const
DifferentiableFunction
&
other
)
const
{
const
ConvexShapeContactHold
&
castother
=
dynamic_cast
<
const
ConvexShapeContactHold
&>
(
other
);
if
(
!
DifferentiableFunction
::
isEqual
(
other
))
return
false
;
if
(
constraint_
!=
castother
.
constraint_
)
return
false
;
if
(
complement_
!=
castother
.
complement_
)
return
false
;
return
true
;
}
}
// namespace constraints
}
// 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