hpp-constraints  4.9.1
Definition of basic geometric constraints for motion planning
implicit-function.hh
Go to the documentation of this file.
1 // Copyright (c) 2015 - 2018 LAAS-CNRS
2 // Authors: Florent Lamiraux, Joseph Mirabel
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 #ifndef HPP_CONSTRAINTS_EXPLICIT_IMPLICIT_FUNCTION_HH
18 # define HPP_CONSTRAINTS_EXPLICIT_IMPLICIT_FUNCTION_HH
19 
22 
23 namespace hpp {
24  namespace constraints {
25  namespace explicit_ {
38  {
39  public:
43  typedef boost::shared_ptr <ImplicitFunction> Ptr_t;
44  static Ptr_t create
45  (const DevicePtr_t& robot, const DifferentiableFunctionPtr_t& function,
46  const segments_t& inputConf, const segments_t& outputConf,
47  const segments_t& inputVelocity, const segments_t& outputVelocity)
49 
53  static Ptr_t create
54  (const DevicePtr_t& robot, const DifferentiableFunctionPtr_t& function,
56  const segments_t& inputConf, const segments_t& outputConf,
57  const segments_t& inputVelocity, const segments_t& outputVelocity)
59 
70 
71  static Ptr_t create
72  (const LiegroupSpacePtr_t& configSpace,
73  const DifferentiableFunctionPtr_t& function,
74  const segments_t& inputConf, const segments_t& outputConf,
75  const segments_t& inputVelocity, const segments_t& outputVelocity);
76 
79 
80  protected:
84  ImplicitFunction (const DevicePtr_t& robot,
85  const DifferentiableFunctionPtr_t& function,
86  const segments_t& inputConf,
87  const segments_t& outputConf,
88  const segments_t& inputVelocity,
89  const segments_t& outputVelocity)
91 
100  ImplicitFunction (const LiegroupSpacePtr_t& configSpace,
101  const DifferentiableFunctionPtr_t& function,
102  const segments_t& inputConf,
103  const segments_t& outputConf,
104  const segments_t& inputVelocity,
105  const segments_t& outputVelocity);
107  void impl_compute (LiegroupElementRef result, vectorIn_t argument) const;
108 
110  void impl_jacobian (matrixOut_t jacobian, vectorIn_t arg) const;
111 
112  private:
113  void computeJacobianBlocks ();
114 
115  DevicePtr_t robot_;
116  DifferentiableFunctionPtr_t inputToOutput_;
117  Eigen::RowBlockIndices inputConfIntervals_;
118  Eigen::RowBlockIndices outputConfIntervals_;
119  Eigen::RowBlockIndices inputDerivIntervals_;
120  Eigen::RowBlockIndices outputDerivIntervals_;
121  std::vector <Eigen::MatrixBlocks <false, false> > outJacobian_;
122  std::vector <Eigen::MatrixBlocks <false, false> > inJacobian_;
123  mutable vector_t qIn_;
124  mutable LiegroupElement f_qIn_, qOut_;
125  mutable LiegroupElement result_;
126  // Jacobian of explicit function
127  mutable matrix_t Jf_;
128  }; // class ImplicitFunction
129 
130  } // namespace explicit_
131  } // namespace constraints
132 } // namespace hpp
133 
134 #endif // HPP_CONSTRAINTS_EXPLICIT_IMPLICIT_FUNCTION_HH
pinocchio::vector_t vector_t
Definition: fwd.hh:45
pinocchio::vectorIn_t vectorIn_t
Definition: fwd.hh:46
const DifferentiableFunctionPtr_t & inputToOutput() const
Get function f that maps input variables to output variables.
pinocchio::LiegroupSpacePtr_t LiegroupSpacePtr_t
Definition: fwd.hh:54
pinocchio::DevicePtr_t DevicePtr_t
Definition: fwd.hh:91
void impl_jacobian(matrixOut_t jacobian, vectorIn_t arg) const
Compute Jacobian of g (q_out) - f (q_in) with respect to q.
static Ptr_t create(const DevicePtr_t &robot, const DifferentiableFunctionPtr_t &function, const segments_t &inputConf, const segments_t &outputConf, const segments_t &inputVelocity, const segments_t &outputVelocity) HPP_CONSTRAINTS_DEPRECATED
std::vector< segment_t > segments_t
Definition: fwd.hh:69
pinocchio::matrix_t matrix_t
Definition: fwd.hh:42
boost::shared_ptr< ImplicitFunction > Ptr_t
Definition: implicit-function.hh:43
Definition: implicit-function.hh:37
void jacobian(matrixOut_t jacobian, vectorIn_t argument) const
Definition: differentiable-function.hh:78
Definition: differentiable-function.hh:50
boost::shared_ptr< DifferentiableFunction > DifferentiableFunctionPtr_t
Definition: fwd.hh:95
Eigen::Ref< matrix_t > matrixOut_t
Definition: fwd.hh:44
DifferentiableFunctionSet DifferentiableFunctionStack HPP_CONSTRAINTS_DEPRECATED
Definition: fwd.hh:99
void impl_compute(LiegroupElementRef result, vectorIn_t argument) const
Compute g (q_out) - f (q_in)
ImplicitFunction(const DevicePtr_t &robot, const DifferentiableFunctionPtr_t &function, const segments_t &inputConf, const segments_t &outputConf, const segments_t &inputVelocity, const segments_t &outputVelocity) HPP_CONSTRAINTS_DEPRECATED