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
e99cfc7e
Commit
e99cfc7e
authored
5 years ago
by
Joseph Mirabel
Browse files
Options
Downloads
Patches
Plain Diff
Check that the order of the state is good.
parent
fb36b4ed
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
+27
-1
27 additions, 1 deletion
src/graph/validation.cc
with
27 additions
and
1 deletion
src/graph/validation.cc
+
27
−
1
View file @
e99cfc7e
...
...
@@ -37,6 +37,17 @@
namespace
hpp
{
namespace
manipulation
{
namespace
graph
{
bool
stateAIncludedInStateB
(
const
StatePtr_t
&
A
,
const
StatePtr_t
&
B
)
{
const
NumericalConstraints_t
&
Ancs
=
A
->
numericalConstraints
();
const
NumericalConstraints_t
&
Bncs
=
B
->
numericalConstraints
();
for
(
NumericalConstraints_t
::
const_iterator
_nc
=
Ancs
.
begin
();
_nc
!=
Ancs
.
end
();
++
_nc
)
if
(
std
::
find
(
Bncs
.
begin
(),
Bncs
.
end
(),
*
_nc
)
==
Bncs
.
end
())
return
false
;
return
true
;
}
std
::
ostream
&
Validation
::
print
(
std
::
ostream
&
os
)
const
{
for
(
std
::
size_t
i
=
0
;
i
<
warnings_
.
size
();
++
i
)
{
...
...
@@ -164,10 +175,25 @@ namespace hpp {
if
(
!
graph
)
return
false
;
bool
success
=
true
;
States_t
states
=
graph
->
stateSelector
()
->
getStates
();
for
(
std
::
size_t
i
=
1
;
i
<
graph
->
nbComponents
();
++
i
)
if
(
!
validate
(
graph
->
get
(
i
).
lock
()))
success
=
false
;
// Check that no state is included in a state which has a higher priority.
States_t
states
=
graph
->
stateSelector
()
->
getStates
();
for
(
States_t
::
const_iterator
_state
=
states
.
begin
();
_state
!=
states
.
end
();
++
_state
)
{
for
(
States_t
::
const_iterator
_stateHO
=
states
.
begin
();
_stateHO
!=
_state
;
++
_stateHO
)
{
if
(
stateAIncludedInStateB
(
*
_state
,
*
_stateHO
))
{
std
::
ostringstream
oss
;
oss
<<
"State "
<<
(
*
_state
)
->
name
()
<<
" is included in state "
<<
(
*
_stateHO
)
->
name
()
<<
" but the latter has a higher priority."
;
addError
(
*
_state
,
oss
.
str
());
success
=
false
;
}
}
}
return
success
;
}
}
// namespace graph
...
...
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