hpp-constraints  4.9.1
Definition of basic geometric constraints for motion planning
locked-joint.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-core.
5 // hpp-core 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-core 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-core. If not, see <http://www.gnu.org/licenses/>.
16 
17 
18 #ifndef HPP_CONSTRAINTS_LOCKED_JOINT_HH
19 # define HPP_CONSTRAINTS_LOCKED_JOINT_HH
20 
21 # include <hpp/pinocchio/joint.hh>
22 
24 
25 namespace hpp {
26  namespace constraints {
27 
30 
56  class HPP_CONSTRAINTS_DLLAPI LockedJoint : public Explicit
57  {
58  public:
60  virtual ImplicitPtr_t copy () const;
61 
65  static LockedJointPtr_t create (const JointPtr_t& joint,
66  const LiegroupElement& value);
67 
74  static LockedJointPtr_t create (const JointPtr_t& joint,
75  const size_type index,
76  vectorIn_t value);
77 
83  static LockedJointPtr_t create (const DevicePtr_t& dev,
84  const size_type index,
85  vectorIn_t value);
86 
89  static LockedJointPtr_t createCopy (LockedJointConstPtr_t other);
90 
92  size_type rankInConfiguration () const;
93 
95  size_type rankInVelocity () const;
96 
98  size_type configSize () const;
99 
101  size_type numberDof () const;
102 
104  const LiegroupSpacePtr_t& configSpace () const;
105 
107  vectorIn_t value () const;
108 
110  void value (vectorIn_t value);
111 
113  void rightHandSideFromConfig (ConfigurationIn_t config);
114 
116  const JointPtr_t& joint ()
117  {
118  return joint_;
119  }
121  const std::string& jointName () const {
122  return jointName_;
123  }
125  std::ostream& print (std::ostream& os) const;
126  protected:
130  LockedJoint (const JointPtr_t& joint, const LiegroupElement& value);
137  LockedJoint (const JointPtr_t& joint, const size_type index,
138  vectorIn_t value);
144  LockedJoint (const DevicePtr_t& robot, const size_type index,
145  vectorIn_t value);
147  LockedJoint (const LockedJoint& other);
151  virtual bool isEqual (const Implicit& other, bool swapAndTest) const;
152 
153  void init (const LockedJointPtr_t& self);
154 
155  private:
156  std::string jointName_;
157  JointPtr_t joint_;
158  LiegroupSpacePtr_t configSpace_;
160  LockedJointWkPtr_t weak_;
161 
162  }; // class LockedJoint
163 
165  inline std::ostream& operator<< (std::ostream& os, const LockedJoint& lj)
166  {
167  return lj.print (os);
168  }
169  } // namespace constraints
170 } // namespace hpp
171 #endif // HPP_CONSTRAINTS_LOCKED_JOINT_HH
pinocchio::vectorIn_t vectorIn_t
Definition: fwd.hh:46
std::ostream & operator<<(std::ostream &os, const DifferentiableFunction &f)
Definition: differentiable-function.hh:228
pinocchio::LiegroupSpacePtr_t LiegroupSpacePtr_t
Definition: fwd.hh:54
Definition: locked-joint.hh:56
pinocchio::DevicePtr_t DevicePtr_t
Definition: fwd.hh:91
ObjectFactory * create(ObjectFactory *parent=NULL, const XMLElement *element=NULL)
Definition: explicit.hh:124
std::ostream & print(std::ostream &os) const
Print object in a stream.
pinocchio::ConfigurationIn_t ConfigurationIn_t
Definition: fwd.hh:88
pinocchio::JointPtr_t JointPtr_t
Definition: fwd.hh:37
const JointPtr_t & joint()
Return shared pointer to joint.
Definition: locked-joint.hh:116
pinocchio::size_type size_type
Definition: fwd.hh:35
boost::shared_ptr< LockedJoint > LockedJointPtr_t
Definition: fwd.hh:200
const std::string & jointName() const
Return the joint name.
Definition: locked-joint.hh:121
Definition: implicit.hh:96
boost::shared_ptr< Implicit > ImplicitPtr_t
Definition: fwd.hh:157
bool isEqual(const Eigen::MatrixBase< Derived > &lhs, const Eigen::MatrixBase< OtherDerived > &rhs, const FCL_REAL tol=std::numeric_limits< FCL_REAL >::epsilon() *100)
boost::shared_ptr< const LockedJoint > LockedJointConstPtr_t
Definition: fwd.hh:201