hpp-constraints  4.9.1
Definition of basic geometric constraints for motion planning
com-between-feet.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) 2015 CNRS
3 // Authors: Joseph Mirabel
4 //
5 //
6 // This file is part of hpp-constraints.
7 // hpp-constraints is free software: you can redistribute it
8 // and/or modify it under the terms of the GNU Lesser General Public
9 // License as published by the Free Software Foundation, either version
10 // 3 of the License, or (at your option) any later version.
11 //
12 // hpp-constraints is distributed in the hope that it will be
13 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
14 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Lesser Public License for more details. You should have
16 // received a copy of the GNU Lesser General Public License along with
17 // hpp-constraints. If not, see
18 // <http://www.gnu.org/licenses/>.
19 
20 #ifndef HPP_CONSTRAINTS_COM_BETWEEN_FEET_HH
21 # define HPP_CONSTRAINTS_COM_BETWEEN_FEET_HH
22 
23 # include <boost/assign/list_of.hpp>
25 # include <hpp/constraints/config.hh>
26 # include <hpp/constraints/fwd.hh>
27 # include <hpp/constraints/tools.hh>
29 
30 namespace hpp {
31  namespace constraints {
32 
57  class HPP_CONSTRAINTS_DLLAPI ComBetweenFeet : public DifferentiableFunction
58  {
59  public:
60  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
61 
64  const std::string& name, const DevicePtr_t& robot,
65  const JointPtr_t& jointLeft, const JointPtr_t& jointRight,
66  const vector3_t pointLeft, const vector3_t pointRight,
67  const JointPtr_t& jointReference, const vector3_t pointRef,
68  std::vector <bool> mask = boost::assign::list_of (true)(true)(true)(true));
69 
71  static ComBetweenFeetPtr_t create (
72  const std::string& name, const DevicePtr_t& robot,
73  const CenterOfMassComputationPtr_t& comc,
74  const JointPtr_t& jointLeft, const JointPtr_t& jointRight,
75  const vector3_t pointLeft, const vector3_t pointRight,
76  const JointPtr_t& jointReference, const vector3_t pointRef,
77  std::vector <bool> mask = boost::assign::list_of (true)(true)(true)(true));
78 
79  virtual ~ComBetweenFeet () {}
80 
81  ComBetweenFeet (const std::string& name, const DevicePtr_t& robot,
82  const CenterOfMassComputationPtr_t& comc,
83  const JointPtr_t& jointLeft, const JointPtr_t& jointRight,
84  const vector3_t pointLeft, const vector3_t pointRight,
85  const JointPtr_t& jointReference, const vector3_t pointRef,
86  std::vector <bool> mask);
87 
88  protected:
93  virtual void impl_compute (LiegroupElementRef result,
94  ConfigurationIn_t argument) const;
95 
96  virtual void impl_jacobian (matrixOut_t jacobian,
97  ConfigurationIn_t arg) const;
98  private:
99  DevicePtr_t robot_;
100  mutable Traits<PointCom>::Ptr_t com_;
101  Traits<PointInJoint>::Ptr_t left_, right_;
102  eigen::vector3_t pointRef_;
103  JointPtr_t jointRef_;
107  typedef CrossProduct < Difference < PointCom,
109  DiffPiJPiJ > ECrossU_t;
110  mutable Traits<DiffPCPiJ>::Ptr_t xmxl_, xmxr_;
111  mutable Traits<DiffPiJPiJ>::Ptr_t u_;
112  mutable Traits<ECrossU_t>::Ptr_t ecrossu_;
113  mutable Traits<RotationMultiply <ECrossU_t> >::Ptr_t expr_;
114  mutable Traits<ScalarProduct<DiffPCPiJ,DiffPiJPiJ> >::Ptr_t xmxlDotu_, xmxrDotu_;
115  std::vector <bool> mask_;
116  mutable eigen::matrix3_t cross_;
117  }; // class ComBetweenFeet
118  } // namespace constraints
119 } // namespace hpp
120 #endif // HPP_CONSTRAINTS_COM_BETWEEN_FEET_HH
Difference of two expressions.
Definition: symbolic-calculus.hh:97
Eigen::Matrix< value_type, 3, 3 > matrix3_t
Definition: fwd.hh:57
Multiplication of an expression by a scalar.
Definition: symbolic-calculus.hh:99
Basic expression representing a COM.
Definition: symbolic-calculus.hh:825
boost::shared_ptr< ComBetweenFeet > ComBetweenFeetPtr_t
Definition: fwd.hh:107
pinocchio::DevicePtr_t DevicePtr_t
Definition: fwd.hh:91
Definition: symbolic-calculus.hh:92
Definition: com-between-feet.hh:57
ObjectFactory * create(ObjectFactory *parent=NULL, const XMLElement *element=NULL)
virtual ~ComBetweenFeet()
Definition: com-between-feet.hh:79
pinocchio::vector3_t vector3_t
Definition: fwd.hh:39
Eigen::Matrix< value_type, 3, 1 > vector3_t
Definition: fwd.hh:58
pinocchio::ConfigurationIn_t ConfigurationIn_t
Definition: fwd.hh:88
Sum of two expressions.
Definition: symbolic-calculus.hh:98
pinocchio::JointPtr_t JointPtr_t
Definition: fwd.hh:37
Definition: differentiable-function.hh:50
Cross product of two expressions.
Definition: symbolic-calculus.hh:95
HPP_CONSTRAINTS_CB_REF< Class > Ptr_t
Definition: symbolic-calculus.hh:107
Eigen::Ref< matrix_t > matrixOut_t
Definition: fwd.hh:44
pinocchio::CenterOfMassComputationPtr_t CenterOfMassComputationPtr_t
Definition: fwd.hh:93