hpp-constraints  4.9.1
Definition of basic geometric constraints for motion planning
relative-com.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) 2014 CNRS
3 // Authors: Florent Lamiraux
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_RELATIVE_COM_HH
21 # define HPP_CONSTRAINTS_RELATIVE_COM_HH
22 
23 # include <boost/assign/list_of.hpp>
25 # include <hpp/constraints/config.hh>
26 # include <hpp/constraints/fwd.hh>
27 
28 namespace hpp {
29  namespace constraints {
30 
33 
57  class HPP_CONSTRAINTS_DLLAPI RelativeCom : public DifferentiableFunction
58  {
59  public:
60  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
62  static RelativeComPtr_t create (const DevicePtr_t& robot,
63  const JointPtr_t& joint,
64  const vector3_t reference,
65  std::vector <bool> mask = std::vector<bool>(3, true))
66  { return create ("RelativeCom", robot, joint, reference, mask); }
67  static RelativeComPtr_t create (const std::string& name,
68  const DevicePtr_t& robot,
69  const JointPtr_t& joint,
70  const vector3_t reference,
71  std::vector <bool> mask = std::vector<bool>(3, true));
72  static RelativeComPtr_t create (const DevicePtr_t& robot,
73  const CenterOfMassComputationPtr_t& comc,
74  const JointPtr_t& joint,
75  const vector3_t reference,
76  std::vector <bool> mask = std::vector<bool>(3, true));
77  static RelativeComPtr_t create (const std::string& name,
78  const DevicePtr_t& robot,
79  const CenterOfMassComputationPtr_t& comc,
80  const JointPtr_t& joint,
81  const vector3_t reference,
82  std::vector <bool> mask = std::vector<bool> (3, true));
83  virtual ~RelativeCom () {}
84  RelativeCom (const DevicePtr_t& robot,
85  const CenterOfMassComputationPtr_t& comc,
86  const JointPtr_t& joint, const vector3_t reference,
87  std::vector <bool> mask,
88  const std::string& name);
89 
90  virtual std::ostream& print (std::ostream& o) const;
91  protected:
96  virtual void impl_compute (LiegroupElementRef result,
97  ConfigurationIn_t argument)
98  const;
99  virtual void impl_jacobian (matrixOut_t jacobian,
100  ConfigurationIn_t arg) const;
101  private:
102  DevicePtr_t robot_;
104  JointPtr_t joint_;
105  vector3_t reference_;
106  std::vector <bool> mask_;
107  bool nominalCase_;
108  mutable ComJacobian_t jacobian_;
109  }; // class RelativeCom
111  } // namespace constraints
112 } // namespace hpp
113 #endif // HPP_CONSTRAINTS_RELATIVE_COM_HH
pinocchio::DevicePtr_t DevicePtr_t
Definition: fwd.hh:91
ObjectFactory * create(ObjectFactory *parent=NULL, const XMLElement *element=NULL)
pinocchio::ComJacobian_t ComJacobian_t
Definition: fwd.hh:48
pinocchio::vector3_t vector3_t
Definition: fwd.hh:39
pinocchio::ConfigurationIn_t ConfigurationIn_t
Definition: fwd.hh:88
pinocchio::JointPtr_t JointPtr_t
Definition: fwd.hh:37
Definition: differentiable-function.hh:50
virtual ~RelativeCom()
Definition: relative-com.hh:83
Definition: relative-com.hh:57
Eigen::Ref< matrix_t > matrixOut_t
Definition: fwd.hh:44
boost::shared_ptr< RelativeCom > RelativeComPtr_t
Definition: fwd.hh:106
static EIGEN_MAKE_ALIGNED_OPERATOR_NEW RelativeComPtr_t create(const DevicePtr_t &robot, const JointPtr_t &joint, const vector3_t reference, std::vector< bool > mask=std::vector< bool >(3, true))
Return a shared pointer to a new instance.
Definition: relative-com.hh:62
pinocchio::CenterOfMassComputationPtr_t CenterOfMassComputationPtr_t
Definition: fwd.hh:93
Vec3f o