Skip to content
Snippets Groups Projects
Commit ed7ff1c8 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

Inner optimizers in GraphOptimizer uses the GraphSteeringMethod

parent 8a0dda20
No related branches found
No related tags found
No related merge requests found
...@@ -16,22 +16,12 @@ ...@@ -16,22 +16,12 @@
#include <hpp/manipulation/graph-optimizer.hh> #include <hpp/manipulation/graph-optimizer.hh>
#include <hpp/core/steering-method-straight.hh>
#include <hpp/manipulation/graph/edge.hh> #include <hpp/manipulation/graph/edge.hh>
namespace hpp { namespace hpp {
namespace manipulation { namespace manipulation {
PathVectorPtr_t GraphOptimizer::optimize (const PathVectorPtr_t& path) PathVectorPtr_t GraphOptimizer::optimize (const PathVectorPtr_t& path)
{ {
core::Problem& p = const_cast <core::Problem&> (this->problem ());
core::SteeringMethodPtr_t sm = p.steeringMethod ();
core::ConstraintSetPtr_t oldC = p.constraints ();
core::SteeringMethodStraightPtr_t smS = core::SteeringMethodStraight::
create (p.robot ());
p.steeringMethod (smS);
PathVectorPtr_t opted = PathVector::create PathVectorPtr_t opted = PathVector::create
(path->outputSize(), path->outputDerivativeSize()), (path->outputSize(), path->outputDerivativeSize()),
expanded = PathVector::create expanded = PathVector::create
...@@ -46,7 +36,6 @@ namespace hpp { ...@@ -46,7 +36,6 @@ namespace hpp {
toOpt->appendPath (current); toOpt->appendPath (current);
graph::EdgePtr_t edge; graph::EdgePtr_t edge;
c = HPP_DYNAMIC_PTR_CAST (ConstraintSet, current->constraints ()); c = HPP_DYNAMIC_PTR_CAST (ConstraintSet, current->constraints ());
p.constraints(c);
if (c) edge = c->edge (); if (c) edge = c->edge ();
std::size_t i_e = i_s + 1; std::size_t i_e = i_s + 1;
for (; i_e < expanded->numberPaths (); ++i_e) { for (; i_e < expanded->numberPaths (); ++i_e) {
...@@ -61,8 +50,6 @@ namespace hpp { ...@@ -61,8 +50,6 @@ namespace hpp {
i_s = i_e; i_s = i_e;
opted->concatenate (*toConcat); opted->concatenate (*toConcat);
} }
p.steeringMethod (sm);
p.constraints (oldC);
pathOptimizer_.reset (); pathOptimizer_.reset ();
return opted; return opted;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment