Skip to content
Snippets Groups Projects
Commit 397ca709 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Florent Lamiraux florent@laas.fr
Browse files

Overwrite path projector factories

parent 394bf7af
No related branches found
No related tags found
No related merge requests found
...@@ -28,6 +28,10 @@ ...@@ -28,6 +28,10 @@
#include <hpp/core/random-shortcut.hh> #include <hpp/core/random-shortcut.hh>
#include <hpp/core/path-optimization/partial-shortcut.hh> #include <hpp/core/path-optimization/partial-shortcut.hh>
#include "hpp/core/path-projector/progressive.hh"
#include "hpp/core/path-projector/dichotomy.hh"
#include "hpp/core/path-projector/global.hh"
#include "hpp/core/path-projector/recursive-hermite.hh"
#include <hpp/core/roadmap.hh> #include <hpp/core/roadmap.hh>
#include <hpp/core/steering-method-straight.hh> #include <hpp/core/steering-method-straight.hh>
#include <hpp/core/comparison-type.hh> #include <hpp/core/comparison-type.hh>
...@@ -72,6 +76,18 @@ namespace hpp { ...@@ -72,6 +76,18 @@ namespace hpp {
createWithTraits <InnerConfigOptimizationTraits> (problem); createWithTraits <InnerConfigOptimizationTraits> (problem);
} }
}; };
template <typename PathProjectorType>
core::PathProjectorPtr_t createPathProjector
(const core::Problem& problem, const value_type& step)
{
GraphSteeringMethodPtr_t gsm =
HPP_DYNAMIC_PTR_CAST (GraphSteeringMethod, problem.steeringMethod());
if (!gsm) throw std::logic_error ("The steering method should be of type"
" GraphSteeringMethod");
return PathProjectorType::create (problem.distance(),
gsm->innerSteeringMethod(), step);
}
} }
std::ostream& operator<< (std::ostream& os, const Device& robot) std::ostream& operator<< (std::ostream& os, const Device& robot)
...@@ -102,6 +118,15 @@ namespace hpp { ...@@ -102,6 +118,15 @@ namespace hpp {
<pathOptimization::ConfigOptimizationTraits> <pathOptimization::ConfigOptimizationTraits>
>); >);
parent_t::add <core::PathProjectorBuilder_t> ("Progressive",
createPathProjector <core::pathProjector::Progressive>);
parent_t::add <core::PathProjectorBuilder_t> ("Dichotomy",
createPathProjector <core::pathProjector::Dichotomy>);
parent_t::add <core::PathProjectorBuilder_t> ("Global",
createPathProjector <core::pathProjector::Global>);
parent_t::add <core::PathProjectorBuilder_t> ("RecursiveHermite",
createPathProjector <core::pathProjector::RecursiveHermite>);
parent_t::add <PathOptimizerBuilder_t> ("SplineGradientBased_cannonical1",pathOptimization::SplineGradientBased<core::path::CanonicalPolynomeBasis, 1>::createFromCore); parent_t::add <PathOptimizerBuilder_t> ("SplineGradientBased_cannonical1",pathOptimization::SplineGradientBased<core::path::CanonicalPolynomeBasis, 1>::createFromCore);
parent_t::add <PathOptimizerBuilder_t> ("SplineGradientBased_cannonical2",pathOptimization::SplineGradientBased<core::path::CanonicalPolynomeBasis, 2>::createFromCore); parent_t::add <PathOptimizerBuilder_t> ("SplineGradientBased_cannonical2",pathOptimization::SplineGradientBased<core::path::CanonicalPolynomeBasis, 2>::createFromCore);
parent_t::add <PathOptimizerBuilder_t> ("SplineGradientBased_cannonical3",pathOptimization::SplineGradientBased<core::path::CanonicalPolynomeBasis, 3>::createFromCore); parent_t::add <PathOptimizerBuilder_t> ("SplineGradientBased_cannonical3",pathOptimization::SplineGradientBased<core::path::CanonicalPolynomeBasis, 3>::createFromCore);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment