Commit ca071a91 authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

Move steeringMethod::Straight::impl_compute to definition file.

parent 5f892304
...@@ -21,12 +21,8 @@ ...@@ -21,12 +21,8 @@
# include <hpp/core/config.hh> # include <hpp/core/config.hh>
# include <hpp/core/fwd.hh> # include <hpp/core/fwd.hh>
# include <hpp/core/problem.hh>
# include <hpp/core/steering-method/fwd.hh> # include <hpp/core/steering-method/fwd.hh>
# include <hpp/core/steering-method.hh> # include <hpp/core/steering-method.hh>
# include <hpp/core/straight-path.hh>
# include <hpp/core/distance.hh>
# include <hpp/core/config-projector.hh>
namespace hpp { namespace hpp {
namespace core { namespace core {
...@@ -64,20 +60,8 @@ namespace hpp { ...@@ -64,20 +60,8 @@ namespace hpp {
/// create a path between two configurations /// create a path between two configurations
virtual PathPtr_t impl_compute (ConfigurationIn_t q1, virtual PathPtr_t impl_compute (ConfigurationIn_t q1,
ConfigurationIn_t q2) const ConfigurationIn_t q2) const;
{
value_type length = (*problem_.distance()) (q1, q2);
ConstraintSetPtr_t c;
if (constraints() && constraints()->configProjector ()) {
c = HPP_STATIC_PTR_CAST (ConstraintSet, constraints()->copy ());
c->configProjector()->rightHandSideFromConfig (q1);
} else {
c = constraints ();
}
PathPtr_t path = StraightPath::create
(problem_.robot(), q1, q2, length, c);
return path;
}
protected: protected:
/// Constructor with robot /// Constructor with robot
/// Weighed distance is created from robot /// Weighed distance is created from robot
......
...@@ -94,6 +94,7 @@ path-validation/no-validation.hh ...@@ -94,6 +94,7 @@ path-validation/no-validation.hh
steering-method/dubins.cc steering-method/dubins.cc
steering-method/snibud.cc steering-method/snibud.cc
steering-method/spline.cc steering-method/spline.cc
steering-method/straight.cc
straight-path.cc straight-path.cc
interpolated-path.cc interpolated-path.cc
visibility-prm-planner.cc visibility-prm-planner.cc
......
// Copyright (c) 2019 CNRS
// Authors: Joseph Mirabel
//
// This file is part of hpp-core
// hpp-core is free software: you can redistribute it
// and/or modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation, either version
// 3 of the License, or (at your option) any later version.
//
// hpp-core is distributed in the hope that it will be
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Lesser Public License for more details. You should have
// received a copy of the GNU Lesser General Public License along with
// hpp-core If not, see
// <http://www.gnu.org/licenses/>.
#include <hpp/core/steering-method/straight.hh>
#include <hpp/core/problem.hh>
#include <hpp/core/straight-path.hh>
#include <hpp/core/distance.hh>
#include <hpp/core/config-projector.hh>
namespace hpp {
namespace core {
namespace steeringMethod {
PathPtr_t Straight::impl_compute (ConfigurationIn_t q1, ConfigurationIn_t q2) const
{
value_type length = (*problem_.distance()) (q1, q2);
ConstraintSetPtr_t c;
if (constraints() && constraints()->configProjector ()) {
c = HPP_STATIC_PTR_CAST (ConstraintSet, constraints()->copy ());
c->configProjector()->rightHandSideFromConfig (q1);
c->configProjector()->lineSearchType (ConfigProjector::Backtracking);
} else {
c = constraints ();
}
PathPtr_t path = StraightPath::create
(problem_.robot(), q1, q2, length, c);
return path;
}
} // namespace steeringMethod
} // namespace core
} // namespace hpp
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment