hpp-core: include/hpp/core/path-projector/global.hh Source File

hpp-core 9.0.2 Implement basic classes for canonical path planning for kinematic chains.

Loading...
Searching...
No Matches
global.hh
Go to the documentation of this file.
1
2// Copyright (c) 2014, LAAS-CNRS
3// Authors: Joseph Mirabel (joseph.mirabel@laas.fr)
4//
5
6// Redistribution and use in source and binary forms, with or without
7// modification, are permitted provided that the following conditions are
8// met:
9//
10// 1. Redistributions of source code must retain the above copyright
11// notice, this list of conditions and the following disclaimer.
12//
13// 2. Redistributions in binary form must reproduce the above copyright
14// notice, this list of conditions and the following disclaimer in the
15// documentation and/or other materials provided with the distribution.
16//
17// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
28// DAMAGE.
29
30#ifndef HPP_CORE_PATHPROJECTOR_GLOBAL_HH
31#define HPP_CORE_PATHPROJECTOR_GLOBAL_HH
32
33// lineSearch::FixedSequence
34#include <hpp/constraints/solver/hierarchical-iterative.hh>
35#include <hpp/core/config-projector.hh>
36#include <hpp/core/path-projector.hh>
37
38namespace hpp {
39namespace core {
40namespace pathProjector {
41 class HPP_CORE_DLLAPI Global : public PathProjector {
42 public:
43 typedef hpp::core::StraightPath StraightPath;
44 typedef hpp::core::StraightPathPtr_t StraightPathPtr_t;
45
51 static GlobalPtr_t create(const DistancePtr_t& distance,
52 const SteeringMethodPtr_t& steeringMethod,
53 value_type step);
54
55 static GlobalPtr_t create(const ProblemConstPtr_t& problem,
56 const value_type& step);
57
58 protected:
59 bool impl_apply(const PathPtr_t& path, PathPtr_t& projection) const;
60
61 Global(const DistancePtr_t& distance,
62 const SteeringMethodPtr_t& steeringMethod, value_type step,
63 value_type threshold, value_type hessianBound);
64
65 private:
66 value_type step_;
67
68 const value_type hessianBound_;
69 const value_type thresholdMin_;
70
71 typedef constraints::solver::lineSearch::FixedSequence LineSearch_t;
72 struct Data {
73 Configuration_t q;
74 value_type length; // Length between this config and the previous one
75 LineSearch_t alpha;
76 std::size_t Niter;
77 value_type sigma;
78 bool projected;
79 };
80
81 typedef std::list<Configuration_t, Eigen::aligned_allocator<Configuration_t> >
82 Configs_t;
83 typedef std::list<value_type> Lengths_t;
84 typedef std::list<LineSearch_t> Alphas_t;
85 typedef std::vector<bool> Bools_t;
86 typedef std::list<Data> Datas_t;
87
88 bool projectOneStep(ConfigProjector& p, Configs_t& q,
89 Configs_t::iterator& last, Bools_t& b, Lengths_t& l,
90 Alphas_t& alpha) const;
91
92 bool projectOneStep(ConfigProjector& p, Datas_t& ds,
93 const Datas_t::iterator& last) const;
94
96 size_type reinterpolate(const DevicePtr_t& robot, Configs_t& q,
97 const Configs_t::iterator& last, Bools_t& b,
98 Lengths_t& l, Alphas_t& alpha,
99 const value_type& maxDist) const;
100
102 size_type reinterpolate(const DevicePtr_t& robot, ConfigProjector& p,
103 Datas_t& q, Datas_t::iterator& last) const;
104
105 bool createPath(const DevicePtr_t& robot,
106 const ConstraintSetPtr_t& constraint, const Configs_t& q,
107 const Configs_t::iterator& last, const Bools_t& b,
108 const Lengths_t& l, PathPtr_t& result) const;
109
110 bool createPath(const DevicePtr_t& robot,
111 const ConstraintSetPtr_t& constraint, const Datas_t& ds,
112 const Datas_t::iterator& last, PathPtr_t& result) const;
113
114 bool project(const PathPtr_t& path, PathPtr_t& projection) const;
115
116 bool project2(const PathPtr_t& path, PathPtr_t& projection) const;
117
118 void initialConfigList(const PathPtr_t& path, Configs_t& cfgs) const;
119
120 void initialConfigList(const PathPtr_t& path, ConfigProjector& p,
121 Datas_t& cfgs) const;
122
123 void initData(Data& data, const Configuration_t& q, ConfigProjector& p,
124 bool computeSigma = false, bool projected = false,
125 const Configuration_t& distTo = Configuration_t()) const;
126
127 mutable Configuration_t q_;
128 mutable vector_t dq_;
129};
130} // namespace pathProjector
131} // namespace core
132} // namespace hpp
133
134#endif // HPP_CORE_PATHPROJECTOR_GLOBAL_HH
hpp::core::ConfigProjector
Definition config-projector.hh:66
hpp::core::PathProjector
This class projects a path using constraints.
Definition path-projector.hh:38
hpp::core::PathProjector::PathPtr_t
hpp::core::PathPtr_t PathPtr_t
Definition path-projector.hh:41
hpp::core::StraightPath
Definition straight-path.hh:52
hpp::core::pathProjector::Global
Definition global.hh:41
hpp::core::pathProjector::Global::create
static GlobalPtr_t create(const ProblemConstPtr_t &problem, const value_type &step)
hpp::core::pathProjector::Global::create
static GlobalPtr_t create(const DistancePtr_t &distance, const SteeringMethodPtr_t &steeringMethod, value_type step)
hpp::core::pathProjector::Global::StraightPath
hpp::core::StraightPath StraightPath
Definition global.hh:43
hpp::core::pathProjector::Global::Global
Global(const DistancePtr_t &distance, const SteeringMethodPtr_t &steeringMethod, value_type step, value_type threshold, value_type hessianBound)
hpp::core::pathProjector::Global::StraightPathPtr_t
hpp::core::StraightPathPtr_t StraightPathPtr_t
Definition global.hh:44
hpp::core::pathProjector::Global::impl_apply
bool impl_apply(const PathPtr_t &path, PathPtr_t &projection) const
Method to be reimplemented by inherited class.
config-projector.hh
HPP_CORE_DLLAPI
#define HPP_CORE_DLLAPI
Definition config.hh:88
hierarchical-iterative.hh
hpp
hpp::core::pathProjector::GlobalPtr_t
shared_ptr< Global > GlobalPtr_t
Definition fwd.hh:339
hpp::core::value_type
pinocchio::value_type value_type
Definition fwd.hh:174
hpp::core::StraightPathPtr_t
shared_ptr< StraightPath > StraightPathPtr_t
Definition fwd.hh:200
hpp::core::DistancePtr_t
shared_ptr< Distance > DistancePtr_t
Definition fwd.hh:141
hpp::core::SteeringMethodPtr_t
shared_ptr< SteeringMethod > SteeringMethodPtr_t
Definition fwd.hh:213
hpp::core::vector_t
pinocchio::vector_t vector_t
Definition fwd.hh:220
hpp::core::size_type
pinocchio::size_type size_type
Definition fwd.hh:173
hpp::core::ProblemConstPtr_t
shared_ptr< const Problem > ProblemConstPtr_t
Definition fwd.hh:197
hpp::core::Configuration_t
pinocchio::Configuration_t Configuration_t
Definition fwd.hh:107
hpp::core::DevicePtr_t
pinocchio::DevicePtr_t DevicePtr_t
Definition fwd.hh:134
hpp::core::ConstraintSetPtr_t
shared_ptr< ConstraintSet > ConstraintSetPtr_t
Definition fwd.hh:130
hpp::core::PathPtr_t
shared_ptr< Path > PathPtr_t
Definition fwd.hh:187
path-projector.hh
hpp::constraints::solver::lineSearch::FixedSequence