hpp-constraints  6.0.0
Definition of basic geometric constraints for motion planning
explicit.hh
Go to the documentation of this file.
1 // Copyright (c) 2015, LAAS-CNRS
2 // Authors: Florent Lamiraux
3 //
4 
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are
7 // met:
8 //
9 // 1. Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 //
12 // 2. Redistributions in binary form must reproduce the above copyright
13 // notice, this list of conditions and the following disclaimer in the
14 // documentation and/or other materials provided with the distribution.
15 //
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
27 // DAMAGE.
28 
29 #ifndef HPP_CONSTRAINTS_EXPLICIT_HH
30 #define HPP_CONSTRAINTS_EXPLICIT_HH
31 
32 #include <exception>
34 
35 namespace hpp {
36 namespace constraints {
39 
41 class FunctionNotDefinedForThisValue : public std::exception {};
42 
144  public:
146  virtual ImplicitPtr_t copy() const;
147 
166  const LiegroupSpacePtr_t& configSpace,
167  const DifferentiableFunctionPtr_t& function, const segments_t& inputConf,
168  const segments_t& outputConf, const segments_t& inputVelocity,
169  const segments_t& outputVelocity,
170  const ComparisonTypes_t& comp = ComparisonTypes_t(),
171  std::vector<bool> mask = std::vector<bool>());
172 
174  static ExplicitPtr_t createCopy(const ExplicitPtr_t& other);
175 
179  return inputToOutput_;
180  }
181 
183  const segments_t& outputConf() const { return outputConf_; }
185  const segments_t& outputVelocity() const { return outputVelocity_; }
187  const segments_t& inputConf() const { return inputConf_; }
189  const segments_t& inputVelocity() const { return inputVelocity_; }
198  virtual void outputValue(LiegroupElementRef result, vectorIn_t qin,
199  LiegroupElementConstRef rhs) const;
200 
211  virtual void jacobianOutputValue(vectorIn_t qin,
212  LiegroupElementConstRef g_value,
214  matrixOut_t jacobian) const;
215 
216  protected:
234  Explicit(const LiegroupSpacePtr_t& configSpace,
235  const DifferentiableFunctionPtr_t& function,
236  const segments_t& inputConf, const segments_t& outputConf,
237  const segments_t& inputVelocity, const segments_t& outputVelocity,
238  const ComparisonTypes_t& comp, std::vector<bool> mask);
239 
249  Explicit(const DifferentiableFunctionPtr_t& implicitFunction,
250  const DifferentiableFunctionPtr_t& function,
251  const segments_t& inputConf, const segments_t& outputConf,
252  const segments_t& inputVelocity, const segments_t& outputVelocity,
253  const ComparisonTypes_t& comp, std::vector<bool> mask);
254 
256  Explicit(const Explicit& other);
257 
258  bool isEqual(const Implicit& other, bool swapAndTest) const;
259 
260  // Store weak pointer to itself
261  void init(const ExplicitWkPtr_t& weak);
262 
263  protected:
264  // Relation between input and output configuration variables
270 
271  Explicit() {}
272 
273  private:
274  ExplicitWkPtr_t weak_;
275 
276  HPP_SERIALIZABLE();
277 }; // class Explicit
279 } // namespace constraints
280 } // namespace hpp
281 
282 BOOST_CLASS_EXPORT_KEY(hpp::constraints::Explicit)
283 
284 #endif // HPP_CONSTRAINTS_EXPLICIT_HH
Definition: explicit.hh:143
Explicit()
Definition: explicit.hh:271
bool isEqual(const Implicit &other, bool swapAndTest) const
const segments_t & outputVelocity() const
Get output degrees of freedom.
Definition: explicit.hh:185
segments_t inputVelocity_
Definition: explicit.hh:268
const segments_t & inputConf() const
Get input configuration variables.
Definition: explicit.hh:187
Explicit(const DifferentiableFunctionPtr_t &implicitFunction, const DifferentiableFunctionPtr_t &function, const segments_t &inputConf, const segments_t &outputConf, const segments_t &inputVelocity, const segments_t &outputVelocity, const ComparisonTypes_t &comp, std::vector< bool > mask)
(const LiegroupSpacePtr_t&, const
const segments_t & inputVelocity() const
Get input degrees of freedom.
Definition: explicit.hh:189
Explicit(const Explicit &other)
Copy constructor.
Explicit(const LiegroupSpacePtr_t &configSpace, const DifferentiableFunctionPtr_t &function, const segments_t &inputConf, const segments_t &outputConf, const segments_t &inputVelocity, const segments_t &outputVelocity, const ComparisonTypes_t &comp, std::vector< bool > mask)
segments_t outputVelocity_
Definition: explicit.hh:269
virtual ImplicitPtr_t copy() const
Copy object and return shared pointer to copy.
segments_t inputConf_
Definition: explicit.hh:266
virtual void jacobianOutputValue(vectorIn_t qin, LiegroupElementConstRef g_value, LiegroupElementConstRef rhs, matrixOut_t jacobian) const
DifferentiableFunctionPtr_t explicitFunction() const
Definition: explicit.hh:178
DifferentiableFunctionPtr_t inputToOutput_
Definition: explicit.hh:265
static ExplicitPtr_t create(const LiegroupSpacePtr_t &configSpace, const DifferentiableFunctionPtr_t &function, const segments_t &inputConf, const segments_t &outputConf, const segments_t &inputVelocity, const segments_t &outputVelocity, const ComparisonTypes_t &comp=ComparisonTypes_t(), std::vector< bool > mask=std::vector< bool >())
const segments_t & outputConf() const
Get output configuration variables.
Definition: explicit.hh:183
virtual void outputValue(LiegroupElementRef result, vectorIn_t qin, LiegroupElementConstRef rhs) const
static ExplicitPtr_t createCopy(const ExplicitPtr_t &other)
Create a copy and return shared pointer.
segments_t outputConf_
Definition: explicit.hh:267
void init(const ExplicitWkPtr_t &weak)
Exception thrown when a function is evaluated outside its definition domain.
Definition: explicit.hh:41
Definition: implicit.hh:119
#define HPP_CONSTRAINTS_DLLAPI
Definition: config.hh:88
std::vector< ComparisonType > ComparisonTypes_t
Definition: fwd.hh:180
shared_ptr< Explicit > ExplicitPtr_t
Definition: fwd.hh:183
pinocchio::LiegroupSpacePtr_t LiegroupSpacePtr_t
Definition: fwd.hh:69
shared_ptr< DifferentiableFunction > DifferentiableFunctionPtr_t
Definition: fwd.hh:113
shared_ptr< Implicit > ImplicitPtr_t
Definition: fwd.hh:173
pinocchio::vectorIn_t vectorIn_t
Definition: fwd.hh:60
Eigen::Ref< matrix_t > matrixOut_t
Definition: fwd.hh:58
std::vector< segment_t > segments_t
Definition: fwd.hh:84
pinocchio::LiegroupElementConstRef LiegroupElementConstRef
Definition: fwd.hh:67
pinocchio::LiegroupElementRef LiegroupElementRef
Definition: fwd.hh:66
Definition: active-set-differentiable-function.hh:36