hpp-constraints: include/hpp/constraints/locked-joint.hh Source File

hpp-constraints 9.0.2 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
32#include <hpp/constraints/explicit.hh>
33#include <hpp/pinocchio/joint.hh>
34
35 namespace hpp {
36 namespace constraints {
37
40
66 class HPP_CONSTRAINTS_DLLAPI LockedJoint : public Explicit {
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
96 static LockedJointPtr_t createCopy(LockedJointConstPtr_t other);
97
99 size_type rankInConfiguration() const;
100
102 size_type rankInVelocity() const;
103
105 size_type configSize() const;
106
108 size_type numberDof() const;
109
111 const LiegroupSpacePtr_t& configSpace() const;
112
114 vectorIn_t value() const;
115
117 void value(vectorIn_t value);
118
120 const JointPtr_t& joint() { return joint_; }
122 const std::string& jointName() const { return jointName_; }
124 std::ostream& print(std::ostream& os) const;
125
134 virtual std::pair<JointConstPtr_t, JointConstPtr_t>
135 doesConstrainRelPoseBetween(DeviceConstPtr_t robot) const;
136
137 protected:
141 LockedJoint(const JointPtr_t& joint, const LiegroupElement& value);
148 LockedJoint(const JointPtr_t& joint, const size_type index, vectorIn_t value);
154 LockedJoint(const DevicePtr_t& robot, const size_type index,
155 vectorIn_t value);
157 LockedJoint(const LockedJoint& other);
161 virtual bool isEqual(const Implicit& other, bool swapAndTest) const;
162
163 void init(const LockedJointPtr_t& self);
164
165 private:
166 std::string jointName_;
167 JointPtr_t joint_;
168 LiegroupSpacePtr_t configSpace_;
170 LockedJointWkPtr_t weak_;
171
172 LockedJoint() {}
173 HPP_SERIALIZABLE();
174}; // class LockedJoint
175
177 inline std::ostream& operator<<(std::ostream& os, const LockedJoint& lj) {
178 return lj.print(os);
179}
180} // namespace constraints
181} // namespace hpp
182
183BOOST_CLASS_EXPORT_KEY(hpp::constraints::LockedJoint)
184#endif // HPP_CONSTRAINTS_LOCKED_JOINT_HH
hpp::constraints::Explicit
Definition explicit.hh:143
hpp::constraints::Implicit
Definition implicit.hh:119
hpp::constraints::LockedJoint
Definition locked-joint.hh:66
hpp::constraints::LockedJoint::LockedJoint
LockedJoint(const JointPtr_t &joint, const size_type index, vectorIn_t value)
hpp::constraints::LockedJoint::rankInConfiguration
size_type rankInConfiguration() const
Get index of locked degree of freedom in robot configuration vector.
hpp::constraints::LockedJoint::createCopy
static LockedJointPtr_t createCopy(LockedJointConstPtr_t other)
hpp::constraints::LockedJoint::print
std::ostream & print(std::ostream &os) const
Print object in a stream.
hpp::constraints::LockedJoint::value
void value(vectorIn_t value)
Set the value of the locked joint.
hpp::constraints::LockedJoint::LockedJoint
LockedJoint(const DevicePtr_t &robot, const size_type index, vectorIn_t value)
hpp::constraints::LockedJoint::create
static LockedJointPtr_t create(const JointPtr_t &joint, const LiegroupElement &value)
hpp::constraints::LockedJoint::copy
virtual ImplicitPtr_t copy() const
Copy object and return shared pointer to copy.
hpp::constraints::LockedJoint::configSpace
const LiegroupSpacePtr_t & configSpace() const
Get configuration space of locked joint.
hpp::constraints::LockedJoint::init
void init(const LockedJointPtr_t &self)
hpp::constraints::LockedJoint::LockedJoint
LockedJoint(const JointPtr_t &joint, const LiegroupElement &value)
hpp::constraints::LockedJoint::jointName
const std::string & jointName() const
Return the joint name.
Definition locked-joint.hh:122
hpp::constraints::LockedJoint::numberDof
size_type numberDof() const
Get number of degrees of freedom of the joint.
hpp::constraints::LockedJoint::doesConstrainRelPoseBetween
virtual std::pair< JointConstPtr_t, JointConstPtr_t > doesConstrainRelPoseBetween(DeviceConstPtr_t robot) const
hpp::constraints::LockedJoint::isEqual
virtual bool isEqual(const Implicit &other, bool swapAndTest) const
hpp::constraints::LockedJoint::rankInVelocity
size_type rankInVelocity() const
Get index of locked degree of freedom in robot velocity vector.
hpp::constraints::LockedJoint::create
static LockedJointPtr_t create(const JointPtr_t &joint, const size_type index, vectorIn_t value)
hpp::constraints::LockedJoint::LockedJoint
LockedJoint(const LockedJoint &other)
Copy constructor.
hpp::constraints::LockedJoint::value
vectorIn_t value() const
Get the value of the locked joint.
hpp::constraints::LockedJoint::configSize
size_type configSize() const
Get the configuration size of the joint.
hpp::constraints::LockedJoint::create
static LockedJointPtr_t create(const DevicePtr_t &dev, const size_type index, vectorIn_t value)
hpp::constraints::LockedJoint::joint
const JointPtr_t & joint()
Return shared pointer to joint.
Definition locked-joint.hh:120
hpp::pinocchio::LiegroupElementBase
HPP_CONSTRAINTS_DLLAPI
#define HPP_CONSTRAINTS_DLLAPI
Definition config.hh:88
explicit.hh
joint.hh
hpp::constraints::LockedJointConstPtr_t
shared_ptr< const LockedJoint > LockedJointConstPtr_t
Definition fwd.hh:210
hpp::constraints::DevicePtr_t
pinocchio::DevicePtr_t DevicePtr_t
Definition fwd.hh:111
hpp::constraints::DeviceConstPtr_t
pinocchio::DeviceConstPtr_t DeviceConstPtr_t
Definition fwd.hh:112
hpp::constraints::LiegroupSpacePtr_t
pinocchio::LiegroupSpacePtr_t LiegroupSpacePtr_t
Definition fwd.hh:70
hpp::constraints::operator<<
ComparisonTypes_t operator<<(const ComparisonType &a, const ComparisonType &b)
Definition comparison-types.hh:61
hpp::constraints::ImplicitPtr_t
shared_ptr< Implicit > ImplicitPtr_t
Definition fwd.hh:175
hpp::constraints::size_type
pinocchio::size_type size_type
Definition fwd.hh:48
hpp::constraints::vectorIn_t
pinocchio::vectorIn_t vectorIn_t
Definition fwd.hh:61
hpp::constraints::LockedJointPtr_t
shared_ptr< LockedJoint > LockedJointPtr_t
Definition fwd.hh:209
hpp::constraints::JointPtr_t
pinocchio::JointPtr_t JointPtr_t
Definition fwd.hh:50
hpp
HPP_SERIALIZABLE
#define HPP_SERIALIZABLE()