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
5c975724
Commit
5c975724
authored
10 years ago
by
Joseph Mirabel
Committed by
Joseph Mirabel
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add assert and remove try/catch in GraphPathValidation
parent
0ed2895f
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-path-validation.cc
+24
-19
24 additions, 19 deletions
src/graph-path-validation.cc
with
24 additions
and
19 deletions
src/graph-path-validation.cc
+
24
−
19
View file @
5c975724
...
...
@@ -32,7 +32,11 @@ namespace hpp {
const
PathPtr_t
&
path
,
bool
reverse
,
PathPtr_t
&
validPart
)
{
assert
(
path
);
return
impl_validate
(
path
,
reverse
,
validPart
);
bool
success
=
impl_validate
(
path
,
reverse
,
validPart
);
assert
(
constraintGraph_
);
assert
(
constraintGraph_
->
getNode
((
*
validPart
)
(
validPart
->
timeRange
().
first
)));
assert
(
constraintGraph_
->
getNode
((
*
validPart
)
(
validPart
->
timeRange
().
second
)));
return
success
;
}
bool
GraphPathValidation
::
impl_validate
(
...
...
@@ -86,24 +90,25 @@ namespace hpp {
return
true
;
}
const
Path
&
newPath
(
*
pathNoCollision
);
value_type
newTmin
=
pathNoCollision
->
timeRange
().
first
,
newTmax
=
pathNoCollision
->
timeRange
().
second
,
oldTmin
=
path
->
timeRange
().
first
,
oldTmax
=
path
->
timeRange
().
second
;
graph
::
NodePtr_t
origNode
,
destNode
;
try
{
origNode
=
constraintGraph_
->
getNode
(
newPath
(
newTmin
));
destNode
=
constraintGraph_
->
getNode
(
newPath
(
newTmax
));
const
Path
&
oldPath
(
*
path
);
const
core
::
interval_t
&
newTR
=
newPath
.
timeRange
(),
oldTR
=
oldPath
.
timeRange
();
Configuration_t
q
(
newPath
.
outputSize
());
if
(
!
newPath
(
q
,
newTR
.
first
))
throw
std
::
logic_error
(
"Initial configuration of the valid part cannot be projected."
);
const
graph
::
NodePtr_t
&
origNode
=
constraintGraph_
->
getNode
(
q
);
if
(
!
newPath
(
q
,
newTR
.
second
))
throw
std
::
logic_error
(
"End configuration of the valid part cannot be projected."
);
const
graph
::
NodePtr_t
&
destNode
=
constraintGraph_
->
getNode
(
q
);
if
(
!
oldPath
(
q
,
oldTR
.
first
))
throw
std
::
logic_error
(
"Initial configuration of the path to be validated cannot be projected."
);
const
graph
::
NodePtr_t
&
oldOnode
=
constraintGraph_
->
getNode
(
q
);
if
(
!
oldPath
(
q
,
oldTR
.
second
))
throw
std
::
logic_error
(
"End configuration of the path to be validated cannot be projected."
);
const
graph
::
NodePtr_t
&
oldDnode
=
constraintGraph_
->
getNode
(
q
);
if
(
origNode
==
constraintGraph_
->
getNode
((
*
path
)
(
oldTmin
))
&&
destNode
==
constraintGraph_
->
getNode
((
*
path
)
(
oldTmax
)))
{
validPart
=
pathNoCollision
;
return
false
;
}
}
catch
(
std
::
logic_error
&
e
)
{
/// A configuration has no node, which may be because the path could not be projected.
/// Path should be considered invalid.
validPart
=
path
->
extract
(
std
::
make_pair
(
oldTmin
,
oldTmin
));
if
(
origNode
==
oldOnode
&&
destNode
==
oldDnode
)
{
validPart
=
pathNoCollision
;
return
false
;
}
...
...
@@ -111,7 +116,7 @@ namespace hpp {
// edge of the constraint graph. Two option are possible:
// - Use the steering method to create a new path and validate it.
// - Return a null path.
validPart
=
path
->
extract
(
std
::
make_pair
(
oldT
min
,
oldTmin
));
validPart
=
path
->
extract
(
std
::
make_pair
(
oldT
R
.
first
,
oldTR
.
first
));
return
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