hpp-constraints 4.15.1
Definition of basic geometric constraints for motion planning
Loading...
Searching...
No Matches
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
5// Redistribution and use in source and binary forms, with or without
6// modification, are permitted provided that the following conditions are
7// met:
8//
9// 1. Redistributions of source code must retain the above copyright
10// notice, this list of conditions and the following disclaimer.
11//
12// 2. Redistributions in binary form must reproduce the above copyright
13// notice, this list of conditions and the following disclaimer in the
14// documentation and/or other materials provided with the distribution.
15//
16// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
27// DAMAGE.
28
29#ifndef HPP_CONSTRAINTS_LOCKED_JOINT_HH
30#define HPP_CONSTRAINTS_LOCKED_JOINT_HH
31
33#include <hpp/pinocchio/joint.hh>
34
35namespace hpp {
36namespace constraints {
37
40
67 public:
69 virtual ImplicitPtr_t copy() const;
70
74 static LockedJointPtr_t create(const JointPtr_t& joint,
75 const LiegroupElement& value);
76
83 static LockedJointPtr_t create(const JointPtr_t& joint, const size_type index,
84 vectorIn_t value);
85
91 static LockedJointPtr_t create(const DevicePtr_t& dev, const size_type index,
92 vectorIn_t value);
93
97
100
103
106
109
112
115
117 void value(vectorIn_t value);
118
124 ConfigurationIn_t config);
125
127 const JointPtr_t& joint() { return joint_; }
129 const std::string& jointName() const { return jointName_; }
131 std::ostream& print(std::ostream& os) const;
132
141 virtual std::pair<JointConstPtr_t, JointConstPtr_t>
143
144 protected:
148 LockedJoint(const JointPtr_t& joint, const LiegroupElement& value);
155 LockedJoint(const JointPtr_t& joint, const size_type index, vectorIn_t value);
161 LockedJoint(const DevicePtr_t& robot, const size_type index,
162 vectorIn_t value);
168 virtual bool isEqual(const Implicit& other, bool swapAndTest) const;
169
170 void init(const LockedJointPtr_t& self);
171
172 private:
173 std::string jointName_;
174 JointPtr_t joint_;
175 LiegroupSpacePtr_t configSpace_;
177 LockedJointWkPtr_t weak_;
178
179 LockedJoint() {}
180 HPP_SERIALIZABLE();
181}; // class LockedJoint
182
184inline std::ostream& operator<<(std::ostream& os, const LockedJoint& lj) {
185 return lj.print(os);
186}
187} // namespace constraints
188} // namespace hpp
189
190BOOST_CLASS_EXPORT_KEY(hpp::constraints::LockedJoint)
191#endif // HPP_CONSTRAINTS_LOCKED_JOINT_HH
Definition: explicit.hh:132
Definition: implicit.hh:124
Definition: locked-joint.hh:66
LockedJoint(const JointPtr_t &joint, const size_type index, vectorIn_t value)
size_type rankInConfiguration() const
Get index of locked degree of freedom in robot configuration vector.
static LockedJointPtr_t createCopy(LockedJointConstPtr_t other)
std::ostream & print(std::ostream &os) const
Print object in a stream.
void value(vectorIn_t value)
Set the value of the locked joint.
LockedJoint(const DevicePtr_t &robot, const size_type index, vectorIn_t value)
static LockedJointPtr_t create(const JointPtr_t &joint, const LiegroupElement &value)
virtual ImplicitPtr_t copy() const
Copy object and return shared pointer to copy.
const LiegroupSpacePtr_t & configSpace() const
Get configuration space of locked joint.
void init(const LockedJointPtr_t &self)
LockedJoint(const JointPtr_t &joint, const LiegroupElement &value)
const std::string & jointName() const
Return the joint name.
Definition: locked-joint.hh:129
size_type numberDof() const
Get number of degrees of freedom of the joint.
virtual std::pair< JointConstPtr_t, JointConstPtr_t > doesConstrainRelPoseBetween(DeviceConstPtr_t robot) const
virtual bool isEqual(const Implicit &other, bool swapAndTest) const
size_type rankInVelocity() const
Get index of locked degree of freedom in robot velocity vector.
static LockedJointPtr_t create(const JointPtr_t &joint, const size_type index, vectorIn_t value)
LockedJoint(const LockedJoint &other)
Copy constructor.
vectorIn_t value() const
Get the value of the locked joint.
HPP_CONSTRAINTS_DEPRECATED void rightHandSideFromConfig(ConfigurationIn_t config)
size_type configSize() const
Get the configuration size of the joint.
static LockedJointPtr_t create(const DevicePtr_t &dev, const size_type index, vectorIn_t value)
const JointPtr_t & joint()
Return shared pointer to joint.
Definition: locked-joint.hh:127
#define HPP_CONSTRAINTS_DLLAPI
Definition: config.hh:64
#define HPP_CONSTRAINTS_DEPRECATED
Definition: deprecated.hh:37
pinocchio::LiegroupElement LiegroupElement
Definition: fwd.hh:65
shared_ptr< const LockedJoint > LockedJointConstPtr_t
Definition: fwd.hh:208
pinocchio::DevicePtr_t DevicePtr_t
Definition: fwd.hh:109
pinocchio::DeviceConstPtr_t DeviceConstPtr_t
Definition: fwd.hh:110
pinocchio::LiegroupSpacePtr_t LiegroupSpacePtr_t
Definition: fwd.hh:69
ComparisonTypes_t operator<<(const ComparisonType &a, const ComparisonType &b)
Definition: comparison-types.hh:61
shared_ptr< Implicit > ImplicitPtr_t
Definition: fwd.hh:175
pinocchio::size_type size_type
Definition: fwd.hh:47
pinocchio::vectorIn_t vectorIn_t
Definition: fwd.hh:60
pinocchio::ConfigurationIn_t ConfigurationIn_t
Definition: fwd.hh:106
shared_ptr< LockedJoint > LockedJointPtr_t
Definition: fwd.hh:207
pinocchio::JointPtr_t JointPtr_t
Definition: fwd.hh:49
Definition: active-set-differentiable-function.hh:36