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
fb36b4ed
Commit
fb36b4ed
authored
5 years ago
by
Joseph Mirabel
Browse files
Options
Downloads
Patches
Plain Diff
Graph validation checks that State constraints are not parameterizable.
parent
37e8bae9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/graph/validation.cc
+25
-7
25 additions, 7 deletions
src/graph/validation.cc
with
25 additions
and
7 deletions
src/graph/validation.cc
+
25
−
7
View file @
fb36b4ed
...
...
@@ -22,6 +22,8 @@
#include
<hpp/util/indent.hh>
#include
<hpp/constraints/differentiable-function.hh>
#include
<hpp/core/collision-validation.hh>
#include
<hpp/core/configuration-shooter.hh>
#include
<hpp/core/relative-motion.hh>
...
...
@@ -64,11 +66,21 @@ namespace hpp {
bool
Validation
::
validateState
(
const
StatePtr_t
&
state
)
{
std
::
ostringstream
oss
;
oss
<<
incindent
;
bool
success
=
true
;
// 1. try to generate a configuration in this state.
// 1. Check that all the constraint are not parameterizable.
const
NumericalConstraints_t
&
ncs
=
state
->
numericalConstraints
();
for
(
NumericalConstraints_t
::
const_iterator
_nc
=
ncs
.
begin
();
_nc
!=
ncs
.
end
();
++
_nc
)
if
((
*
_nc
)
->
parameterSize
()
>
0
)
{
std
::
ostringstream
oss
;
oss
<<
incindent
<<
"Constraint "
<<
(
*
_nc
)
->
function
().
name
()
<<
" has a varying right hand side while constraints of a state must"
" have a constant one."
;
addError
(
state
,
oss
.
str
());
}
// 2. try to generate a configuration in this state.
bool
projOk
;
Configuration_t
q
;
std
::
size_t
i
,
Nrand
=
100
;
...
...
@@ -79,17 +91,21 @@ namespace hpp {
if
(
projOk
)
break
;
}
if
(
!
projOk
)
{
oss
<<
"Failed to apply the constraints to "
<<
Nrand
<<
"random configurations."
;
std
::
ostringstream
oss
;
oss
<<
incindent
<<
"Failed to apply the constraints to "
<<
Nrand
<<
"random configurations."
;
addError
(
state
,
oss
.
str
());
return
false
;
}
if
(
4
*
i
>
3
*
Nrand
)
{
oss
<<
"Success rate of constraint projection is "
<<
i
/
Nrand
<<
'.'
;
std
::
ostringstream
oss
;
oss
<<
incindent
<<
"Success rate of constraint projection is "
<<
i
/
Nrand
<<
'.'
;
addWarning
(
state
,
oss
.
str
());
oss
.
clear
();
}
//
2
. check the collision pairs which will be disabled because of the
//
3
. check the collision pairs which will be disabled because of the
// constraint.
core
::
CollisionValidationPtr_t
colValidation
(
core
::
CollisionValidation
::
create
(
problem_
->
robot
()));
...
...
@@ -128,7 +144,9 @@ namespace hpp {
bool
colOk
=
colValidation
->
validate
(
q
,
colReport
);
if
(
!
colOk
)
{
oss
<<
"The following collision pairs will always collide."
<<
incendl
<<
*
colReport
<<
decindent
;
std
::
ostringstream
oss
;
oss
<<
incindent
<<
"The following collision pairs will always "
"collide."
<<
incendl
<<
*
colReport
<<
decindent
;
addError
(
state
,
oss
.
str
());
success
=
false
;
}
...
...
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