From d99c7c1862a9c5024d1b3222374067181de8b720 Mon Sep 17 00:00:00 2001
From: Le Quang Anh <43576719+Toefinder@users.noreply.github.com>
Date: Tue, 7 Jun 2022 17:26:57 +0200
Subject: [PATCH] [ProblemSolver] Allow non-graph steering method in
 createPathProjector

  Path projectors are defined in core::ProblemSolver and overloaded in
  manipulation::ProblemSolver. Formerly, the overloaded method checked that
  the steering method was of type manipulation::SteeringMethod and created
  the path projector with the inner steering of the latter.

  This commit modifies this behavior since calling idl method
  hpp::corbaserver::Problem::createPathPlanner with a core_idl::Problem
  instance as input fails when the problem solver is of type
  manipulation::ProblemSolver.
---
 src/problem-solver.cc | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/problem-solver.cc b/src/problem-solver.cc
index 32ef77b..bdd9e0b 100644
--- a/src/problem-solver.cc
+++ b/src/problem-solver.cc
@@ -105,9 +105,8 @@ core::PathProjectorPtr_t createPathProjector(
   steeringMethod::GraphPtr_t gsm =
       HPP_DYNAMIC_PTR_CAST(steeringMethod::Graph, problem->steeringMethod());
   if (!gsm)
-    throw std::logic_error(
-        "The steering method should be of type"
-        " steeringMethod::Graph");
+    return PathProjectorType::create (problem->distance(),
+        problem->steeringMethod(), step);
   return PathProjectorType::create(problem->distance(),
                                    gsm->innerSteeringMethod(), step);
 }
-- 
GitLab