Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hpp-manipulation
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
Guilhem Saurel
hpp-manipulation
Commits
94157409
Commit
94157409
authored
2 years ago
by
Florent Lamiraux
Browse files
Options
Downloads
Patches
Plain Diff
[ProblemSolver] Do not create explicit constraint for contact surfaces
when robot contact surfaces are not on a freeflying object.
parent
96a3fb55
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/problem-solver.cc
+53
-23
53 additions, 23 deletions
src/problem-solver.cc
with
53 additions
and
23 deletions
src/problem-solver.cc
+
53
−
23
View file @
94157409
...
@@ -244,6 +244,7 @@ namespace hpp {
...
@@ -244,6 +244,7 @@ namespace hpp {
(
const
std
::
string
&
name
,
const
StringList_t
&
surface1
,
(
const
std
::
string
&
name
,
const
StringList_t
&
surface1
,
const
StringList_t
&
surface2
,
const
value_type
&
margin
)
const
StringList_t
&
surface2
,
const
value_type
&
margin
)
{
{
bool
explicit_
(
true
);
if
(
!
robot_
)
throw
std
::
runtime_error
(
"No robot loaded"
);
if
(
!
robot_
)
throw
std
::
runtime_error
(
"No robot loaded"
);
JointAndShapes_t
floorSurfaces
,
objectSurfaces
,
l
;
JointAndShapes_t
floorSurfaces
,
objectSurfaces
,
l
;
for
(
StringList_t
::
const_iterator
it1
=
surface1
.
begin
();
for
(
StringList_t
::
const_iterator
it1
=
surface1
.
begin
();
...
@@ -251,7 +252,19 @@ namespace hpp {
...
@@ -251,7 +252,19 @@ namespace hpp {
if
(
!
robot_
->
jointAndShapes
.
has
(
*
it1
))
if
(
!
robot_
->
jointAndShapes
.
has
(
*
it1
))
throw
std
::
runtime_error
(
"First list of triangles not found."
);
throw
std
::
runtime_error
(
"First list of triangles not found."
);
l
=
robot_
->
jointAndShapes
.
get
(
*
it1
);
l
=
robot_
->
jointAndShapes
.
get
(
*
it1
);
objectSurfaces
.
insert
(
objectSurfaces
.
end
(),
l
.
begin
(),
l
.
end
());
for
(
auto
js
:
l
){
JointPtr_t
j
(
js
.
first
);
// If one robot contact surface is not on a freeflying object,
// The contact constraint cannot be expressed by an explicit
// constraint.
if
((
j
->
parentJoint
())
||
((
*
j
->
configurationSpace
()
!=*
pinocchio
::
LiegroupSpace
::
SE3
())
&&
(
*
j
->
configurationSpace
()
!=*
pinocchio
::
LiegroupSpace
::
R3xSO3
())))
{
explicit_
=
false
;
}
objectSurfaces
.
insert
(
objectSurfaces
.
end
(),
l
.
begin
(),
l
.
end
());
}
}
}
for
(
StringList_t
::
const_iterator
it2
=
surface2
.
begin
();
for
(
StringList_t
::
const_iterator
it2
=
surface2
.
begin
();
...
@@ -266,28 +279,45 @@ namespace hpp {
...
@@ -266,28 +279,45 @@ namespace hpp {
floorSurfaces
.
insert
(
floorSurfaces
.
end
(),
l
.
begin
(),
l
.
end
());
floorSurfaces
.
insert
(
floorSurfaces
.
end
(),
l
.
begin
(),
l
.
end
());
}
}
typedef
hpp
::
constraints
::
explicit_
::
ConvexShapeContact
Constraint_t
;
if
(
explicit_
){
Constraint_t
::
Constraints_t
constraints
typedef
hpp
::
constraints
::
explicit_
::
ConvexShapeContact
Constraint_t
;
(
Constraint_t
::
createConstraintAndComplement
Constraint_t
::
Constraints_t
constraints
(
name
,
robot_
,
floorSurfaces
,
objectSurfaces
,
margin
));
(
Constraint_t
::
createConstraintAndComplement
(
name
,
robot_
,
floorSurfaces
,
objectSurfaces
,
margin
));
addNumericalConstraint
(
std
::
get
<
0
>
(
constraints
)
->
function
().
name
(),
std
::
get
<
0
>
(
constraints
));
addNumericalConstraint
(
std
::
get
<
0
>
(
constraints
)
->
function
().
name
(),
addNumericalConstraint
(
std
::
get
<
1
>
(
constraints
)
->
function
().
name
(),
std
::
get
<
0
>
(
constraints
));
std
::
get
<
1
>
(
constraints
));
addNumericalConstraint
(
std
::
get
<
1
>
(
constraints
)
->
function
().
name
(),
addNumericalConstraint
(
std
::
get
<
2
>
(
constraints
)
->
function
().
name
(),
std
::
get
<
1
>
(
constraints
));
std
::
get
<
2
>
(
constraints
));
addNumericalConstraint
(
std
::
get
<
2
>
(
constraints
)
->
function
().
name
(),
// Set security margin to contact constraint
std
::
get
<
2
>
(
constraints
));
assert
(
HPP_DYNAMIC_PTR_CAST
(
constraints
::
ConvexShapeContact
,
// Set security margin to contact constraint
std
::
get
<
0
>
(
constraints
)
->
functionPtr
()));
assert
(
HPP_DYNAMIC_PTR_CAST
(
constraints
::
ConvexShapeContact
,
constraints
::
ConvexShapeContactPtr_t
contactFunction
std
::
get
<
0
>
(
constraints
)
->
functionPtr
()));
(
HPP_STATIC_PTR_CAST
(
constraints
::
ConvexShapeContact
,
constraints
::
ConvexShapeContactPtr_t
contactFunction
std
::
get
<
0
>
(
constraints
)
->
functionPtr
()));
(
HPP_STATIC_PTR_CAST
(
constraints
::
ConvexShapeContact
,
contactFunction
->
setNormalMargin
(
margin
);
std
::
get
<
0
>
(
constraints
)
->
functionPtr
()));
constraintsAndComplements
.
push_back
(
contactFunction
->
setNormalMargin
(
margin
);
ConstraintAndComplement_t
(
std
::
get
<
0
>
(
constraints
),
constraintsAndComplements
.
push_back
(
std
::
get
<
1
>
(
constraints
),
ConstraintAndComplement_t
(
std
::
get
<
0
>
(
constraints
),
std
::
get
<
2
>
(
constraints
)));
std
::
get
<
1
>
(
constraints
),
std
::
get
<
2
>
(
constraints
)));
}
else
{
using
constraints
::
ComparisonTypes_t
;
using
constraints
::
Implicit
;
using
constraints
::
Equality
;
using
constraints
::
EqualToZero
;
std
::
pair
<
hpp
::
constraints
::
ConvexShapeContactPtr_t
,
hpp
::
constraints
::
ConvexShapeContactComplementPtr_t
>
functions
(
constraints
::
ConvexShapeContactComplement
::
createPair
(
name
,
robot_
,
floorSurfaces
,
objectSurfaces
));
functions
.
first
->
setNormalMargin
(
margin
);
addNumericalConstraint
(
functions
.
first
->
name
(),
Implicit
::
create
(
functions
.
first
,
5
*
EqualToZero
));
addNumericalConstraint
(
functions
.
second
->
name
(),
Implicit
::
create
(
functions
.
second
,
ComparisonTypes_t
(
functions
.
second
->
outputSize
(),
Equality
)));
}
}
}
void
ProblemSolver
::
createPrePlacementConstraint
void
ProblemSolver
::
createPrePlacementConstraint
...
...
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