From ef7d6005bff2f83066903db00c514a8fe67bebed Mon Sep 17 00:00:00 2001 From: Joseph Mirabel <jmirabel@laas.fr> Date: Mon, 14 Dec 2015 17:16:03 +0100 Subject: [PATCH] Problem uses manipulation::WeighedDistance --- include/hpp/manipulation/problem.hh | 7 +------ src/problem.cc | 12 ++++++++++++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/include/hpp/manipulation/problem.hh b/include/hpp/manipulation/problem.hh index ec6ec64f..f7384192 100644 --- a/include/hpp/manipulation/problem.hh +++ b/include/hpp/manipulation/problem.hh @@ -38,12 +38,7 @@ namespace hpp { Problem (DevicePtr_t robot); /// Set the graph of constraints - void constraintGraph (const graph::GraphPtr_t& graph) - { - graph_ = graph; - if (pathValidation ()) - pathValidation ()->constraintGraph (graph); - } + void constraintGraph (const graph::GraphPtr_t& graph); /// Get the graph of constraints graph::GraphPtr_t constraintGraph () const diff --git a/src/problem.cc b/src/problem.cc index ba00d23c..7758f09c 100644 --- a/src/problem.cc +++ b/src/problem.cc @@ -15,6 +15,7 @@ // hpp-manipulation. If not, see <http://www.gnu.org/licenses/>. #include <hpp/manipulation/problem.hh> +#include <hpp/manipulation/weighed-distance.hh> #include <hpp/manipulation/graph-steering-method.hh> namespace hpp { @@ -23,6 +24,17 @@ namespace hpp { : Parent (robot), graph_() { Parent::steeringMethod (GraphSteeringMethod::create (this)); + distance (WeighedDistance::create (robot, graph_)); + } + + void Problem::constraintGraph (const graph::GraphPtr_t& graph) + { + graph_ = graph; + if (pathValidation ()) + pathValidation ()->constraintGraph (graph); + WeighedDistancePtr_t d = HPP_DYNAMIC_PTR_CAST (WeighedDistance, + distance ()); + if (d) d->constraintGraph (graph); } GraphPathValidationPtr_t Problem::pathValidation () const -- GitLab