Robotics Library  0.7.0
Joint.h
Go to the documentation of this file.
1 //
2 // Copyright (c) 2009, Markus Rickert
3 // All rights reserved.
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are met:
7 //
8 // * Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright notice,
11 // this list of conditions and the following disclaimer in the documentation
12 // and/or other materials provided with the distribution.
13 //
14 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 // POSSIBILITY OF SUCH DAMAGE.
25 //
26 
27 #ifndef RL_MDL_JOINT_H
28 #define RL_MDL_JOINT_H
29 
30 #include <rl/math/Unit.h>
31 #include <rl/math/Vector.h>
32 
33 #include "Transform.h"
34 
35 namespace rl
36 {
37  namespace mdl
38  {
39  class Joint : public Transform
40  {
41  public:
42  Joint(const ::std::size_t& dofPosition, const ::std::size_t& dofVelocity);
43 
44  virtual ~Joint();
45 
46  virtual void clip(::rl::math::Vector& q) const;
47 
49 
50  void forwardAcceleration();
51 
52  void forwardDynamics1();
53 
54  void forwardDynamics2();
55 
56  void forwardDynamics3();
57 
58  void forwardVelocity();
59 
61 
63 
65 
66  const ::Eigen::Matrix< ::rl::math::Unit, ::Eigen::Dynamic, 1>& getAccelerationUnits() const;
67 
68  ::std::size_t getDof() const;
69 
70  ::std::size_t getDofPosition() const;
71 
73 
75 
77 
78  const ::Eigen::Matrix< ::rl::math::Unit, ::Eigen::Dynamic, 1>& getPositionUnits() const;
79 
81 
82  const ::Eigen::Matrix< ::rl::math::Unit, ::Eigen::Dynamic, 1>& getTorqueUnits() const;
83 
85 
86  const ::Eigen::Matrix< ::rl::math::Unit, ::Eigen::Dynamic, 1>& getSpeedUnits() const;
87 
89 
90  const ::Eigen::Matrix< ::rl::math::Unit, ::Eigen::Dynamic, 1>& getVelocityUnits() const;
91 
93 
94  void inverseForce();
95 
96  virtual bool isValid(const ::rl::math::Vector& q) const;
97 
98  virtual void normalize(::rl::math::Vector& q) const;
99 
101 
103 
105 
107 
108  virtual void step(const ::rl::math::Vector& q1, const ::rl::math::Vector& qdot, ::rl::math::Vector& q2) const;
109 
111 
113 
115 
117 
119 
121 
123 
125 
126  ::Eigen::Matrix< ::rl::math::Unit, ::Eigen::Dynamic, 1> qUnits;
127 
129 
130  ::Eigen::Matrix< ::rl::math::Unit, ::Eigen::Dynamic, 1> qdUnits;
131 
133 
134  ::Eigen::Matrix< ::rl::math::Unit, ::Eigen::Dynamic, 1> qddUnits;
135 
137 
139 
140  ::Eigen::Matrix< ::rl::math::Unit, ::Eigen::Dynamic, 1> speedUnits;
141 
143 
144  ::Eigen::Matrix< ::rl::math::Unit, ::Eigen::Dynamic, 1> tauUnits;
145 
147 
149 
151 
152  ::Eigen::Matrix<bool, ::Eigen::Dynamic, 1> wraparound;
153 
154  protected:
155 
156  private:
157 
158  };
159  }
160 }
161 
162 #endif // RL_MDL_JOINT_H
rl::mdl::Joint::S
::rl::math::Matrix S
Definition: Joint.h:136
rl::math::Matrix
::Eigen::Matrix< Real, ::Eigen::Dynamic, ::Eigen::Dynamic > Matrix
Definition: Matrix.h:42
rl::mdl::Joint::qdd
::rl::math::Vector qdd
Definition: Joint.h:132
rl::mdl::Joint::tauUnits
::Eigen::Matrix< ::rl::math::Unit, ::Eigen::Dynamic, 1 > tauUnits
Definition: Joint.h:144
rl::mdl::Joint::transformedDistance
virtual ::rl::math::Real transformedDistance(const ::rl::math::Vector &q1, const ::rl::math::Vector &q2) const
Definition: Joint.cpp:351
rl::mdl::Joint::max
::rl::math::Vector max
Definition: Joint.h:118
rl::mdl::Joint::v
::rl::math::MotionVector v
Definition: Joint.h:150
rl::mdl::Joint::getVelocity
const ::rl::math::Vector & getVelocity() const
Definition: Joint.cpp:273
rl::mdl::Joint::getAcceleration
const ::rl::math::Vector & getAcceleration() const
Definition: Joint.cpp:201
rl::math::ConstVectorRef
::Eigen::Ref< const Vector > ConstVectorRef
Definition: Vector.h:74
rl::mdl::Joint::min
::rl::math::Vector min
Definition: Joint.h:120
rl::mdl::Joint::q
::rl::math::Vector q
Definition: Joint.h:124
rl::mdl::Joint::normalize
virtual void normalize(::rl::math::Vector &q) const
Definition: Joint.cpp:315
rl::mdl::Joint::Joint
Joint(const ::std::size_t &dofPosition, const ::std::size_t &dofVelocity)
Definition: Joint.cpp:34
rl::mdl::Joint::qd
::rl::math::Vector qd
Definition: Joint.h:128
rl::mdl::Joint::step
virtual void step(const ::rl::math::Vector &q1, const ::rl::math::Vector &qdot, ::rl::math::Vector &q2) const
Definition: Joint.cpp:344
rl::mdl::Joint::getTorqueUnits
const ::Eigen::Matrix< ::rl::math::Unit, ::Eigen::Dynamic, 1 > & getTorqueUnits() const
Definition: Joint.cpp:255
rl::mdl::Joint::forwardDynamics1
void forwardDynamics1()
Definition: Joint.cpp:123
rl::mdl::Transform
Definition: Transform.h:43
Transform.h
rl::mdl::Joint::tau
::rl::math::Vector tau
Definition: Joint.h:142
rl::mdl::Joint::forwardVelocity
void forwardVelocity()
Definition: Joint.cpp:166
rl::mdl::Joint::forwardDynamics3
void forwardDynamics3()
Definition: Joint.cpp:152
rl::mdl::Joint::qUnits
::Eigen::Matrix< ::rl::math::Unit, ::Eigen::Dynamic, 1 > qUnits
Definition: Joint.h:126
rl::mdl::Joint::setVelocity
void setVelocity(const ::rl::math::Vector &qd)
Definition: Joint.cpp:335
rl::mdl::Joint::speedUnits
::Eigen::Matrix< ::rl::math::Unit, ::Eigen::Dynamic, 1 > speedUnits
Definition: Joint.h:140
rl::math::Vector
::Eigen::Matrix< Real, ::Eigen::Dynamic, 1 > Vector
Definition: Vector.h:42
rl::mdl::Joint::distance
virtual ::rl::math::Real distance(const ::rl::math::Vector &q1, const ::rl::math::Vector &q2) const
Definition: Joint.cpp:110
rl::mdl::Joint::forwardDynamics2
void forwardDynamics2()
Definition: Joint.cpp:131
Vector.h
rl::mdl::Joint::generatePositionGaussian
virtual ::rl::math::Vector generatePositionGaussian(const ::rl::math::ConstVectorRef &rand, const ::rl::math::ConstVectorRef &mean, const ::rl::math::ConstVectorRef &sigma) const
Definition: Joint.cpp:173
rl::mdl::Joint
Definition: Joint.h:40
rl::mdl::Joint::getSpeed
const ::rl::math::Vector & getSpeed() const
Definition: Joint.cpp:261
rl::mdl::Joint::a
::rl::math::MotionVector a
Definition: Joint.h:112
rl::mdl::Joint::speed
::rl::math::Vector speed
Definition: Joint.h:138
rl::mdl::Joint::generatePositionUniform
virtual ::rl::math::Vector generatePositionUniform(const ::rl::math::ConstVectorRef &rand) const
Definition: Joint.cpp:188
rl::mdl::Joint::getPosition
const ::rl::math::Vector & getPosition() const
Definition: Joint.cpp:237
rl::mdl::Joint::qdUnits
::Eigen::Matrix< ::rl::math::Unit, ::Eigen::Dynamic, 1 > qdUnits
Definition: Joint.h:130
rl::mdl::Joint::isValid
virtual bool isValid(const ::rl::math::Vector &q) const
Definition: Joint.cpp:301
rl::mdl::Joint::setAcceleration
void setAcceleration(const ::rl::math::Vector &qdd)
Definition: Joint.cpp:320
rl::mdl::Joint::interpolate
virtual void interpolate(const ::rl::math::Vector &q1, const ::rl::math::Vector &q2, const ::rl::math::Real &alpha, ::rl::math::Vector &q) const
Definition: Joint.cpp:285
rl::mdl::Joint::getMinimum
const ::rl::math::Vector & getMinimum() const
Definition: Joint.cpp:231
rl::mdl::Joint::offset
::rl::math::Vector offset
Definition: Joint.h:122
rl::mdl::Joint::u
::rl::math::Vector u
Definition: Joint.h:146
rl::mdl::Joint::setTorque
void setTorque(const ::rl::math::Vector &tau)
Definition: Joint.cpp:329
rl::mdl::Joint::forwardAcceleration
void forwardAcceleration()
Definition: Joint.cpp:116
rl::mdl::Joint::wraparound
::Eigen::Matrix< bool, ::Eigen::Dynamic, 1 > wraparound
Definition: Joint.h:152
rl::mdl::Joint::getDof
::std::size_t getDof() const
Definition: Joint.cpp:213
rl::mdl::Joint::getDofPosition
::std::size_t getDofPosition() const
Definition: Joint.cpp:219
rl::mdl::Joint::~Joint
virtual ~Joint()
Definition: Joint.cpp:75
rl::mdl::Joint::D
::rl::math::Matrix D
Definition: Joint.h:116
rl::mdl::Joint::U
::rl::math::Matrix U
Definition: Joint.h:148
rl::mdl::Joint::getTorque
const ::rl::math::Vector & getTorque() const
Definition: Joint.cpp:249
rl::mdl::Joint::setPosition
virtual void setPosition(const ::rl::math::Vector &q)=0
rl::mdl::Joint::clip
virtual void clip(::rl::math::Vector &q) const
Definition: Joint.cpp:80
rl::math::Real
double Real
Definition: Real.h:42
rl::math::spatial::MotionVector
Motion vector.
Definition: MotionVector.h:45
rl::mdl::Joint::getVelocityUnits
const ::Eigen::Matrix< ::rl::math::Unit, ::Eigen::Dynamic, 1 > & getVelocityUnits() const
Definition: Joint.cpp:279
rl::mdl::Joint::c
::rl::math::MotionVector c
Definition: Joint.h:114
rl::mdl::Joint::getSpeedUnits
const ::Eigen::Matrix< ::rl::math::Unit, ::Eigen::Dynamic, 1 > & getSpeedUnits() const
Definition: Joint.cpp:267
rl::mdl::Joint::getMaximum
const ::rl::math::Vector & getMaximum() const
Definition: Joint.cpp:225
Unit.h
rl::mdl::Joint::getAccelerationUnits
const ::Eigen::Matrix< ::rl::math::Unit, ::Eigen::Dynamic, 1 > & getAccelerationUnits() const
Definition: Joint.cpp:207
rl::mdl::Joint::getPositionUnits
const ::Eigen::Matrix< ::rl::math::Unit, ::Eigen::Dynamic, 1 > & getPositionUnits() const
Definition: Joint.cpp:243
rl::mdl::Joint::qddUnits
::Eigen::Matrix< ::rl::math::Unit, ::Eigen::Dynamic, 1 > qddUnits
Definition: Joint.h:134
rl::mdl::Joint::inverseForce
void inverseForce()
Definition: Joint.cpp:291
rl
Robotics Library.
Definition: AnalogInput.cpp:30