hpp-core  4.9.0
Implement basic classes for canonical path planning for kinematic chains.
dichotomy.hh
Go to the documentation of this file.
1 // Copyright (c) 2014, LAAS-CNRS
2 // Authors: Joseph Mirabel (joseph.mirabel@laas.fr)
3 //
4 // This file is part of hpp-core.
5 // hpp-core is free software: you can redistribute it
6 // and/or modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation, either version
8 // 3 of the License, or (at your option) any later version.
9 //
10 // hpp-core is distributed in the hope that it will be
11 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
12 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // General Lesser Public License for more details. You should have
14 // received a copy of the GNU Lesser General Public License along with
15 // hpp-core. If not, see <http://www.gnu.org/licenses/>.
16 
17 #ifndef HPP_CORE_PATHPROJECTOR_DICHOTOMY_HH
18 # define HPP_CORE_PATHPROJECTOR_DICHOTOMY_HH
19 
21 
22 # include "hpp/core/problem.hh"
23 
24 namespace hpp {
25  namespace core {
26  namespace pathProjector {
27  class HPP_CORE_DLLAPI Dichotomy : public PathProjector
28  {
29  public:
32  static DichotomyPtr_t create
34  const SteeringMethodPtr_t& steeringMethod,
35  value_type maxPathLength)
36  {
37  return DichotomyPtr_t (new Dichotomy (distance, steeringMethod,
38  maxPathLength));
39  }
40 
41  static DichotomyPtr_t create
42  (const Problem& problem,
43  value_type maxPathLength)
44  {
45  return create (problem.distance(), problem.steeringMethod(), maxPathLength);
46  }
47 
48  protected:
49  bool impl_apply (const PathPtr_t& path,
50  PathPtr_t& projection) const;
51 
52  Dichotomy (const DistancePtr_t& distance,
53  const SteeringMethodPtr_t& steeringMethod,
54  value_type maxPathLength);
55 
56  bool applyToStraightPath (const StraightPathPtr_t& path,
57  PathPtr_t& projection) const;
58 
59  private:
60  value_type maxPathLength_;
61  };
62  } // namespace pathProjector
63  } // namespace core
64 } // namespace hpp
65 #endif // HPP_CORE_PATHPROJECTOR_DICHOTOMY_HH
hpp::core::PathPtr_t PathPtr_t
Definition: path-projector.hh:30
void steeringMethod(const SteeringMethodPtr_t &sm)
Definition: problem.hh:103
Definition: problem.hh:48
Definition: dichotomy.hh:27
ObjectFactory * create(ObjectFactory *parent=NULL, const XMLElement *element=NULL)
This class projects a path using constraints.
Definition: path-projector.hh:26
boost::shared_ptr< StraightPath > StraightPathPtr_t
Definition: fwd.hh:182
boost::shared_ptr< Dichotomy > DichotomyPtr_t
Definition: fwd.hh:311
pinocchio::value_type value_type
Definition: fwd.hh:157
Definition: straight-path.hh:42
hpp::core::StraightPathPtr_t StraightPathPtr_t
Definition: dichotomy.hh:31
hpp::core::StraightPath StraightPath
Definition: dichotomy.hh:30
void distance(const DistancePtr_t &distance)
Set distance between configurations.
Definition: problem.hh:114
boost::shared_ptr< SteeringMethod > SteeringMethodPtr_t
Definition: fwd.hh:194
boost::shared_ptr< Distance > DistancePtr_t
Definition: fwd.hh:122
FCL_REAL distance(const KDOP< N > &other, Vec3f *P=NULL, Vec3f *Q=NULL) const