hpp-constraints  4.9.1
Definition of basic geometric constraints for motion planning
implicit.hh
Go to the documentation of this file.
1 // Copyright (c) 2015 - 2018 CNRS
2 // Authors: Joseph Mirabel (joseph.mirabel@laas.fr), Florent Lamiraux
3 //
4 // This file is part of hpp-constraints.
5 // hpp-constraints 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-constraints 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-constraints. If not, see <http://www.gnu.org/licenses/>.
16 
17 
18 #ifndef HPP_CONSTRAINTS_IMPLICIT_HH
19 # define HPP_CONSTRAINTS_IMPLICIT_HH
20 
21 # include <hpp/constraints/fwd.hh>
22 # include <hpp/constraints/config.hh>
23 
24 namespace hpp {
25  namespace constraints {
96  class HPP_CONSTRAINTS_DLLAPI Implicit {
97  public:
99  bool operator== (const Implicit& other) const
100  {
101  return isEqual (other, true);
102  }
104  virtual ImplicitPtr_t copy () const;
107  static ImplicitPtr_t create
108  (const DifferentiableFunctionPtr_t& function);
109 
112  static ImplicitPtr_t create
113  (const DifferentiableFunctionPtr_t& function, ComparisonTypes_t comp);
114 
117  static ImplicitPtr_t create
118  (const DifferentiableFunctionPtr_t& function,
119  ComparisonTypes_t comp, vectorIn_t rhs);
120 
122  static ImplicitPtr_t createCopy (const ImplicitPtr_t& other);
123 
124  virtual ~Implicit () {};
125 
128 
139  void rightHandSideFromConfig (ConfigurationIn_t config);
140 
143  void rightHandSide (vectorIn_t rhs);
144 
146  vectorIn_t rightHandSide () const;
147 
152  size_type rhsSize () const HPP_CONSTRAINTS_DEPRECATED;
153 
157  size_type parameterSize () const;
158 
162  size_type rightHandSideSize () const;
163 
165  const ComparisonTypes_t& comparisonType () const;
166 
168  void comparisonType (const ComparisonTypes_t& comp);
169 
172  bool constantRightHandSide () const HPP_CONSTRAINTS_DEPRECATED;
173 
177  vectorOut_t rightHandSide ();
178 
181  vectorOut_t nonConstRightHandSide () HPP_CONSTRAINTS_DEPRECATED;
182 
187  void rightHandSideFunction (const DifferentiableFunctionPtr_t& rhsF);
188 
194  {
195  return rhsFunction_;
196  }
197 
200  vectorIn_t rightHandSideAt (const value_type& s);
201 
203 
205  DifferentiableFunction& function () const
206  {
207  return *function_;
208  }
209 
212  {
213  return function_;
214  }
215 
216  protected:
222  Implicit (const DifferentiableFunctionPtr_t& function,
223  ComparisonTypes_t comp);
224 
231  Implicit (const DifferentiableFunctionPtr_t& function,
232  ComparisonTypes_t comp, vectorIn_t rhs);
233 
235  Implicit (const Implicit& other);
236 
240  virtual bool isEqual (const Implicit& other, bool swapAndTest) const;
241 
242  // Store weak pointer to itself
243  void init (const ImplicitWkPtr_t& weak)
244  {
245  weak_ = weak;
246  }
247 
248  friend class ImplicitConstraintSet;
249  private:
250  ComparisonTypes_t comparison_;
251  vector_t rhs_;
252  size_type parameterSize_;
253  DifferentiableFunctionPtr_t function_;
254  DifferentiableFunctionPtr_t rhsFunction_;
255  ImplicitWkPtr_t weak_;
256  }; // class Implicit
258  } // namespace constraints
259 } // namespace hpp
260 
261 #endif // HPP_CONSTRAINTS_IMPLICIT_HH
pinocchio::vector_t vector_t
Definition: fwd.hh:45
pinocchio::vectorIn_t vectorIn_t
Definition: fwd.hh:46
Definition: implicit-constraint-set.hh:34
virtual ~Implicit()
Definition: implicit.hh:124
ObjectFactory * create(ObjectFactory *parent=NULL, const XMLElement *element=NULL)
const DifferentiableFunctionPtr_t & rightHandSideFunction() const
Definition: implicit.hh:193
pinocchio::ConfigurationIn_t ConfigurationIn_t
Definition: fwd.hh:88
std::vector< ComparisonType > ComparisonTypes_t
Definition: fwd.hh:170
Definition: differentiable-function.hh:50
boost::shared_ptr< DifferentiableFunction > DifferentiableFunctionPtr_t
Definition: fwd.hh:95
void init(const ImplicitWkPtr_t &weak)
Definition: implicit.hh:243
const DifferentiableFunctionPtr_t & functionPtr() const
Return a reference to function .
Definition: implicit.hh:211
pinocchio::vectorOut_t vectorOut_t
Definition: fwd.hh:47
pinocchio::size_type size_type
Definition: fwd.hh:35
pinocchio::value_type value_type
Definition: fwd.hh:36
Definition: implicit.hh:96
boost::shared_ptr< Implicit > ImplicitPtr_t
Definition: fwd.hh:157
bool isEqual(const Eigen::MatrixBase< Derived > &lhs, const Eigen::MatrixBase< OtherDerived > &rhs, const FCL_REAL tol=std::numeric_limits< FCL_REAL >::epsilon() *100)
DifferentiableFunctionSet DifferentiableFunctionStack HPP_CONSTRAINTS_DEPRECATED
Definition: fwd.hh:99