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
Humanoid Path Planner
hpp-manipulation
Commits
4e6c453f
Commit
4e6c453f
authored
9 years ago
by
Joseph Mirabel
Committed by
Joseph Mirabel
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add ProblemSolver::createPrePlacementConstraint
parent
bbf4fe06
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/hpp/manipulation/problem-solver.hh
+14
-1
14 additions, 1 deletion
include/hpp/manipulation/problem-solver.hh
src/problem-solver.cc
+39
-0
39 additions, 0 deletions
src/problem-solver.cc
with
53 additions
and
1 deletion
include/hpp/manipulation/problem-solver.hh
+
14
−
1
View file @
4e6c453f
...
@@ -96,13 +96,26 @@ namespace hpp {
...
@@ -96,13 +96,26 @@ namespace hpp {
/// \param name name of the placement constraint,
/// \param name name of the placement constraint,
/// \param triangleName name of the first list of triangles,
/// \param triangleName name of the first list of triangles,
/// \param envContactName name of the second list of triangles.
/// \param envContactName name of the second list of triangles.
/// \param margin see hpp::constraints::
QPStaticStability constructor
/// \param margin see hpp::constraints::
ConvexShapeContact::setNormalMargin
///
///
void
createPlacementConstraint
(
const
std
::
string
&
name
,
void
createPlacementConstraint
(
const
std
::
string
&
name
,
const
std
::
string
&
surface1
,
const
std
::
string
&
surface1
,
const
std
::
string
&
surface2
,
const
std
::
string
&
surface2
,
const
value_type
&
margin
=
1e-4
);
const
value_type
&
margin
=
1e-4
);
/// Create pre-placement constraint
/// \param name name of the placement constraint,
/// \param triangleName name of the first list of triangles,
/// \param envContactName name of the second list of triangles.
/// \param width approaching distance.
/// \param margin see hpp::constraints::ConvexShapeContact::setNormalMargin
///
void
createPrePlacementConstraint
(
const
std
::
string
&
name
,
const
std
::
string
&
surface1
,
const
std
::
string
&
surface2
,
const
value_type
&
width
,
const
value_type
&
margin
=
1e-4
);
/// Reset constraint set and put back the disable collisions
/// Reset constraint set and put back the disable collisions
/// between gripper and handle
/// between gripper and handle
virtual
void
resetConstraints
();
virtual
void
resetConstraints
();
...
...
This diff is collapsed.
Click to expand it.
src/problem-solver.cc
+
39
−
0
View file @
4e6c453f
...
@@ -32,6 +32,7 @@
...
@@ -32,6 +32,7 @@
#include
<hpp/core/path-optimization/partial-shortcut.hh>
#include
<hpp/core/path-optimization/partial-shortcut.hh>
#include
<hpp/core/roadmap.hh>
#include
<hpp/core/roadmap.hh>
#include
<hpp/core/steering-method-straight.hh>
#include
<hpp/core/steering-method-straight.hh>
#include
<hpp/core/comparison-type.hh>
#include
"hpp/manipulation/problem.hh"
#include
"hpp/manipulation/problem.hh"
#include
"hpp/manipulation/device.hh"
#include
"hpp/manipulation/device.hh"
...
@@ -189,6 +190,44 @@ namespace hpp {
...
@@ -189,6 +190,44 @@ namespace hpp {
(
constraints
.
second
,
core
::
Equality
::
create
()));
(
constraints
.
second
,
core
::
Equality
::
create
()));
}
}
void
ProblemSolver
::
createPrePlacementConstraint
(
const
std
::
string
&
name
,
const
std
::
string
&
surface1
,
const
std
::
string
&
surface2
,
const
value_type
&
width
,
const
value_type
&
margin
)
{
if
(
!
robot_
)
throw
std
::
runtime_error
(
"No robot loaded"
);
using
constraints
::
ConvexShape
;
using
constraints
::
ConvexShapeContact
;
using
constraints
::
ConvexShapeContactPtr_t
;
ConvexShapeContactPtr_t
cvxShape
=
ConvexShapeContact
::
create
(
name
,
robot_
);
if
(
!
robot_
->
has
<
JointAndShapes_t
>
(
surface1
))
throw
std
::
runtime_error
(
"First list of triangles not found."
);
JointAndShapes_t
l
=
robot_
->
get
<
JointAndShapes_t
>
(
surface1
);
for
(
JointAndShapes_t
::
const_iterator
it
=
l
.
begin
();
it
!=
l
.
end
();
++
it
)
{
cvxShape
->
addObject
(
ConvexShape
(
it
->
second
,
it
->
first
));
}
// Search first robot triangles
if
(
robot_
->
has
<
JointAndShapes_t
>
(
surface2
))
l
=
robot_
->
get
<
JointAndShapes_t
>
(
surface2
);
// and then environment triangles.
else
if
(
has
<
JointAndShapes_t
>
(
surface2
))
l
=
get
<
JointAndShapes_t
>
(
surface2
);
else
throw
std
::
runtime_error
(
"Second list of triangles not found."
);
for
(
JointAndShapes_t
::
const_iterator
it
=
l
.
begin
();
it
!=
l
.
end
();
++
it
)
{
cvxShape
->
addFloor
(
ConvexShape
(
it
->
second
,
it
->
first
));
}
cvxShape
->
setNormalMargin
(
margin
+
width
);
addNumericalConstraint
(
name
,
NumericalConstraint
::
create
(
cvxShape
));
}
void
ProblemSolver
::
resetConstraints
()
void
ProblemSolver
::
resetConstraints
()
{
{
...
...
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