hpp-constraints  4.12.0
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 
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 
116  void rightHandSideFromConfig (ConfigurationIn_t config)
118 
120  const JointPtr_t& joint ()
121  {
122  return joint_;
123  }
125  const std::string& jointName () const {
126  return jointName_;
127  }
129  std::ostream& print (std::ostream& os) const;
130  protected:
134  LockedJoint (const JointPtr_t& joint, const LiegroupElement& value);
141  LockedJoint (const JointPtr_t& joint, const size_type index,
142  vectorIn_t value);
148  LockedJoint (const DevicePtr_t& robot, const size_type index,
149  vectorIn_t value);
151  LockedJoint (const LockedJoint& other);
155  virtual bool isEqual (const Implicit& other, bool swapAndTest) const;
156 
157  void init (const LockedJointPtr_t& self);
158 
159  private:
160  std::string jointName_;
161  JointPtr_t joint_;
162  LiegroupSpacePtr_t configSpace_;
164  LockedJointWkPtr_t weak_;
165 
166  LockedJoint() {}
167  HPP_SERIALIZABLE();
168  }; // class LockedJoint
169 
171  inline std::ostream& operator<< (std::ostream& os, const LockedJoint& lj)
172  {
173  return lj.print (os);
174  }
175  } // namespace constraints
176 } // namespace hpp
177 
178 BOOST_CLASS_EXPORT_KEY(hpp::constraints::LockedJoint)
179 #endif // HPP_CONSTRAINTS_LOCKED_JOINT_HH
pinocchio::vectorIn_t vectorIn_t
Definition: fwd.hh:48
Definition: active-set-differentiable-function.hh:24
pinocchio::LiegroupSpacePtr_t LiegroupSpacePtr_t
Definition: fwd.hh:57
Definition: locked-joint.hh:56
pinocchio::DevicePtr_t DevicePtr_t
Definition: fwd.hh:97
pinocchio::LiegroupElement LiegroupElement
Definition: fwd.hh:53
DifferentiableFunctionSet DifferentiableFunctionStack HPP_CONSTRAINTS_DEPRECATED
Definition: fwd.hh:105
Definition: explicit.hh:118
std::ostream & print(std::ostream &os) const
Print object in a stream.
pinocchio::ConfigurationIn_t ConfigurationIn_t
Definition: fwd.hh:94
pinocchio::JointPtr_t JointPtr_t
Definition: fwd.hh:38
const JointPtr_t & joint()
Return shared pointer to joint.
Definition: locked-joint.hh:120
ComparisonTypes_t operator<<(const ComparisonType &a, const ComparisonType &b)
Definition: comparison-types.hh:54
#define HPP_CONSTRAINTS_DLLAPI
Definition: config.hh:64
pinocchio::size_type size_type
Definition: fwd.hh:36
const std::string & jointName() const
Return the joint name.
Definition: locked-joint.hh:125
shared_ptr< const LockedJoint > LockedJointConstPtr_t
Definition: fwd.hh:203
shared_ptr< Implicit > ImplicitPtr_t
Definition: fwd.hh:163
Definition: implicit.hh:114
shared_ptr< LockedJoint > LockedJointPtr_t
Definition: fwd.hh:202