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
5c68e034
Commit
5c68e034
authored
8 months ago
by
Florent Lamiraux
Browse files
Options
Downloads
Patches
Plain Diff
[TransitionPlanner] Add a method to validate a configuration with selected edge.
parent
6eaa68a1
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/path-planner/transition-planner.hh
+8
-0
8 additions, 0 deletions
include/hpp/manipulation/path-planner/transition-planner.hh
src/path-planner/transition-planner.cc
+23
-10
23 additions, 10 deletions
src/path-planner/transition-planner.cc
with
31 additions
and
10 deletions
include/hpp/manipulation/path-planner/transition-planner.hh
+
8
−
0
View file @
5c68e034
...
...
@@ -31,6 +31,7 @@
#include
<hpp/core/path-planner.hh>
#include
<hpp/manipulation/fwd.hh>
#include
<hpp/manipulation/graph/fwd.hh>
namespace
hpp
{
namespace
manipulation
{
...
...
@@ -110,6 +111,11 @@ class HPP_MANIPULATION_DLLAPI TransitionPlanner : public core::PathPlanner {
/// continuity.
PathPtr_t
directPath
(
ConfigurationIn_t
q1
,
ConfigurationIn_t
q2
,
bool
validate
,
bool
&
success
,
std
::
string
&
status
);
/// Validate a configuration with the path validation of an edge.
/// \param q configuration to validate,
/// \param id index of the edge in the constraint graph.
bool
validateConfiguration
(
ConfigurationIn_t
q
,
std
::
size_t
id
,
core
::
ValidationReportPtr_t
&
report
)
const
;
/// Optimize path using the selected path optimizers
/// \param path input path
/// \return optimized path
...
...
@@ -156,6 +162,8 @@ class HPP_MANIPULATION_DLLAPI TransitionPlanner : public core::PathPlanner {
void
init
(
TransitionPlannerWkPtr_t
weak
);
private
:
/// Get pointer to edge from an id
graph
::
EdgePtr_t
getEdgeOrThrow
(
std
::
size_t
id
)
const
;
/// Pointer to the problem of the inner planner
core
::
ProblemPtr_t
innerProblem_
;
/// Pointer to the inner path planner
...
...
This diff is collapsed.
Click to expand it.
src/path-planner/transition-planner.cc
+
23
−
10
View file @
5c68e034
...
...
@@ -145,6 +145,13 @@ core::PathPtr_t TransitionPlanner::directPath(ConfigurationIn_t q1,
return
validPart
;
}
bool
TransitionPlanner
::
validateConfiguration
(
ConfigurationIn_t
q
,
std
::
size_t
id
,
core
::
ValidationReportPtr_t
&
report
)
const
{
graph
::
EdgePtr_t
edge
(
getEdgeOrThrow
(
id
));
return
edge
->
pathValidation
()
->
validate
(
q
,
report
);
}
core
::
PathVectorPtr_t
TransitionPlanner
::
optimizePath
(
const
PathPtr_t
&
path
)
{
PathVectorPtr_t
pv
(
HPP_DYNAMIC_PTR_CAST
(
PathVector
,
path
));
if
(
!
pv
)
{
...
...
@@ -164,16 +171,7 @@ core::PathVectorPtr_t TransitionPlanner::timeParameterization(
}
void
TransitionPlanner
::
setEdge
(
std
::
size_t
id
)
{
ProblemConstPtr_t
p
(
HPP_DYNAMIC_PTR_CAST
(
const
Problem
,
problem
()));
assert
(
p
);
graph
::
GraphComponentPtr_t
comp
(
p
->
constraintGraph
()
->
get
(
id
).
lock
());
graph
::
EdgePtr_t
edge
(
HPP_DYNAMIC_PTR_CAST
(
graph
::
Edge
,
comp
));
if
(
!
edge
)
{
std
::
ostringstream
os
;
os
<<
"hpp::manipulation::pathPlanner::TransitionPlanner::setEdge: index "
<<
id
<<
" does not correspond to any edge of the constraint graph."
;
throw
std
::
logic_error
(
os
.
str
().
c_str
());
}
graph
::
EdgePtr_t
edge
(
getEdgeOrThrow
(
id
));
innerProblem_
->
constraints
(
edge
->
pathConstraint
());
innerProblem_
->
pathValidation
(
edge
->
pathValidation
());
innerProblem_
->
steeringMethod
(
edge
->
steeringMethod
());
...
...
@@ -243,6 +241,21 @@ void TransitionPlanner::init(TransitionPlannerWkPtr_t weak) {
weakPtr_
=
weak
;
}
graph
::
EdgePtr_t
TransitionPlanner
::
getEdgeOrThrow
(
std
::
size_t
id
)
const
{
ProblemConstPtr_t
p
(
HPP_DYNAMIC_PTR_CAST
(
const
Problem
,
problem
()));
assert
(
p
);
graph
::
GraphComponentPtr_t
comp
(
p
->
constraintGraph
()
->
get
(
id
).
lock
());
graph
::
EdgePtr_t
edge
(
HPP_DYNAMIC_PTR_CAST
(
graph
::
Edge
,
comp
));
if
(
!
edge
)
{
std
::
ostringstream
os
;
os
<<
"hpp::manipulation::pathPlanner::TransitionPlanner::setEdge: index "
<<
id
<<
" does not correspond to any edge of the constraint graph."
;
throw
std
::
logic_error
(
os
.
str
().
c_str
());
}
return
edge
;
}
}
// namespace pathPlanner
}
// namespace manipulation
}
// namespace hpp
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