hpp-constraints: include/hpp/constraints/explicit.hh Source File

hpp-constraints 9.0.2 Definition of basic geometric constraints for motion planning

Loading...
Searching...
No Matches
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>
33#include <hpp/constraints/implicit.hh>
34
35 namespace hpp {
36 namespace constraints {
39
41 class FunctionNotDefinedForThisValue : public std::exception {};
42
143 class HPP_CONSTRAINTS_DLLAPI Explicit : public Implicit {
144 public:
146 virtual ImplicitPtr_t copy() const;
147
165 static ExplicitPtr_t create(
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
178 DifferentiableFunctionPtr_t explicitFunction() const {
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,
213 LiegroupElementConstRef rhs,
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
265 DifferentiableFunctionPtr_t inputToOutput_;
266 segments_t inputConf_;
267 segments_t outputConf_;
268 segments_t inputVelocity_;
269 segments_t outputVelocity_;
270
271 Explicit() {}
272
273 private:
274 ExplicitWkPtr_t weak_;
275
276 HPP_SERIALIZABLE();
277}; // class Explicit
279} // namespace constraints
280} // namespace hpp
281
282BOOST_CLASS_EXPORT_KEY(hpp::constraints::Explicit)
283
284#endif // HPP_CONSTRAINTS_EXPLICIT_HH
hpp::constraints::Explicit
Definition explicit.hh:143
hpp::constraints::Explicit::Explicit
Explicit()
Definition explicit.hh:271
hpp::constraints::Explicit::isEqual
bool isEqual(const Implicit &other, bool swapAndTest) const
hpp::constraints::Explicit::inputVelocity_
segments_t inputVelocity_
Definition explicit.hh:268
hpp::constraints::Explicit::Explicit
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&, constDifferentiableFunctionPtr_t&, const segments_t& inputConf,...
hpp::constraints::Explicit::inputConf
const segments_t & inputConf() const
Get input configuration variables.
Definition explicit.hh:187
hpp::constraints::Explicit::outputConf
const segments_t & outputConf() const
Get output configuration variables.
Definition explicit.hh:183
hpp::constraints::Explicit::Explicit
Explicit(const Explicit &other)
Copy constructor.
hpp::constraints::Explicit::Explicit
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)
hpp::constraints::Explicit::outputVelocity_
segments_t outputVelocity_
Definition explicit.hh:269
hpp::constraints::Explicit::copy
virtual ImplicitPtr_t copy() const
Copy object and return shared pointer to copy.
hpp::constraints::Explicit::inputVelocity
const segments_t & inputVelocity() const
Get input degrees of freedom.
Definition explicit.hh:189
hpp::constraints::Explicit::inputConf_
segments_t inputConf_
Definition explicit.hh:266
hpp::constraints::Explicit::jacobianOutputValue
virtual void jacobianOutputValue(vectorIn_t qin, LiegroupElementConstRef g_value, LiegroupElementConstRef rhs, matrixOut_t jacobian) const
hpp::constraints::Explicit::explicitFunction
DifferentiableFunctionPtr_t explicitFunction() const
Definition explicit.hh:178
hpp::constraints::Explicit::inputToOutput_
DifferentiableFunctionPtr_t inputToOutput_
Definition explicit.hh:265
hpp::constraints::Explicit::create
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 >())
hpp::constraints::Explicit::outputValue
virtual void outputValue(LiegroupElementRef result, vectorIn_t qin, LiegroupElementConstRef rhs) const
hpp::constraints::Explicit::createCopy
static ExplicitPtr_t createCopy(const ExplicitPtr_t &other)
Create a copy and return shared pointer.
hpp::constraints::Explicit::outputVelocity
const segments_t & outputVelocity() const
Get output degrees of freedom.
Definition explicit.hh:185
hpp::constraints::Explicit::outputConf_
segments_t outputConf_
Definition explicit.hh:267
hpp::constraints::Explicit::init
void init(const ExplicitWkPtr_t &weak)
hpp::constraints::FunctionNotDefinedForThisValue
Exception thrown when a function is evaluated outside its definition domain.
Definition explicit.hh:41
hpp::constraints::Implicit
Definition implicit.hh:119
hpp::pinocchio::LiegroupElementBase
hpp::pinocchio::LiegroupElementConstBase
HPP_CONSTRAINTS_DLLAPI
#define HPP_CONSTRAINTS_DLLAPI
Definition config.hh:88
implicit.hh
hpp::constraints::ComparisonTypes_t
std::vector< ComparisonType > ComparisonTypes_t
Definition fwd.hh:182
hpp::constraints::ExplicitPtr_t
shared_ptr< Explicit > ExplicitPtr_t
Definition fwd.hh:185
hpp::constraints::LiegroupSpacePtr_t
pinocchio::LiegroupSpacePtr_t LiegroupSpacePtr_t
Definition fwd.hh:70
hpp::constraints::DifferentiableFunctionPtr_t
shared_ptr< DifferentiableFunction > DifferentiableFunctionPtr_t
Definition fwd.hh:115
hpp::constraints::ImplicitPtr_t
shared_ptr< Implicit > ImplicitPtr_t
Definition fwd.hh:175
hpp::constraints::vectorIn_t
pinocchio::vectorIn_t vectorIn_t
Definition fwd.hh:61
hpp::constraints::matrixOut_t
Eigen::Ref< matrix_t > matrixOut_t
Definition fwd.hh:59
hpp::constraints::segments_t
std::vector< segment_t > segments_t
Definition fwd.hh:86
hpp
HPP_SERIALIZABLE
#define HPP_SERIALIZABLE()