orocos_kdl
jacobian.hpp
Go to the documentation of this file.
1 // Copyright (C) 2007 Ruben Smits <ruben dot smits at mech dot kuleuven dot be>
2 
3 // Version: 1.0
4 // Author: Ruben Smits <ruben dot smits at mech dot kuleuven dot be>
5 // Maintainer: Ruben Smits <ruben dot smits at mech dot kuleuven dot be>
6 // URL: http://www.orocos.org/kdl
7 
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Lesser General Public
10 // License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
12 
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 
22 #ifndef KDL_JACOBIAN_HPP
23 #define KDL_JACOBIAN_HPP
24 
25 #include "frames.hpp"
26 #include <Eigen/Core>
27 
28 namespace KDL
29 {
30  // Equal is friend function, but default arguments for friends are forbidden (ยง8.3.6.4)
31  class Jacobian;
32  bool Equal(const Jacobian& a,const Jacobian& b,double eps=epsilon);
33  void SetToZero(Jacobian& jac);
34 
35 
36  class Jacobian
37  {
38  public:
39 
40  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
41  Eigen::Matrix<double,6,Eigen::Dynamic> data;
42  Jacobian();
43  explicit Jacobian(unsigned int nr_of_columns);
44  Jacobian(const Jacobian& arg);
45 
47  void resize(unsigned int newNrOfColumns);
48 
50  Jacobian& operator=(const Jacobian& arg);
51 
52  bool operator ==(const Jacobian& arg)const;
53  bool operator !=(const Jacobian& arg)const;
54 
55  friend bool Equal(const Jacobian& a,const Jacobian& b,double eps);
56 
57 
58  ~Jacobian();
59 
60  double operator()(unsigned int i,unsigned int j)const;
61  double& operator()(unsigned int i,unsigned int j);
62  unsigned int rows()const;
63  unsigned int columns()const;
64 
65  friend void SetToZero(Jacobian& jac);
66 
67  friend bool changeRefPoint(const Jacobian& src1, const Vector& base_AB, Jacobian& dest);
68  friend bool changeBase(const Jacobian& src1, const Rotation& rot, Jacobian& dest);
69  friend bool changeRefFrame(const Jacobian& src1,const Frame& frame, Jacobian& dest);
70 
71  Twist getColumn(unsigned int i) const;
72  void setColumn(unsigned int i,const Twist& t);
73 
74  void changeRefPoint(const Vector& base_AB);
75  void changeBase(const Rotation& rot);
76  void changeRefFrame(const Frame& frame);
77 
78 
79  };
80 
81  bool changeRefPoint(const Jacobian& src1, const Vector& base_AB, Jacobian& dest);
82  bool changeBase(const Jacobian& src1, const Rotation& rot, Jacobian& dest);
83  bool changeRefFrame(const Jacobian& src1,const Frame& frame, Jacobian& dest);
84 
85 
86 }
87 
88 #endif
KDL::Jacobian::Jacobian
Jacobian()
Definition: jacobian.cpp:26
frames.hpp
KDL::Jacobian::columns
unsigned int columns() const
Definition: jacobian.cpp:74
KDL::Jacobian::setColumn
void setColumn(unsigned int i, const Twist &t)
Definition: jacobian.cpp:148
KDL::Jacobian::operator()
double operator()(unsigned int i, unsigned int j) const
Definition: jacobian.cpp:59
KDL::Jacobian::changeBase
friend bool changeBase(const Jacobian &src1, const Rotation &rot, Jacobian &dest)
Definition: jacobian.cpp:103
KDL::Jacobian::operator==
bool operator==(const Jacobian &arg) const
Definition: jacobian.cpp:126
KDL::changeRefFrame
bool changeRefFrame(const Jacobian &src1, const Frame &frame, Jacobian &dest)
Definition: jacobian.cpp:117
KDL
Definition: kukaLWR_DHnew.cpp:25
KDL::Jacobian::SetToZero
friend void SetToZero(Jacobian &jac)
Definition: jacobian.cpp:79
KDL::Jacobian::changeRefPoint
friend bool changeRefPoint(const Jacobian &src1, const Vector &base_AB, Jacobian &dest)
Definition: jacobian.cpp:89
KDL::Vector
A concrete implementation of a 3 dimensional vector class.
Definition: frames.hpp:162
KDL::epsilon
double epsilon
default precision while comparing with Equal(..,..) functions. Initialized at 0.0000001.
Definition: utility.cxx:21
KDL::Jacobian::resize
void resize(unsigned int newNrOfColumns)
Allocates memory for new size (can break realtime behavior)
Definition: jacobian.cpp:54
KDL::Twist
represents both translational and rotational velocities.
Definition: frames.hpp:723
KDL::Jacobian::operator!=
bool operator!=(const Jacobian &arg) const
Definition: jacobian.cpp:131
KDL::Jacobian::~Jacobian
~Jacobian()
Definition: jacobian.cpp:49
KDL::Frame
represents a frame transformation in 3D space (rotation + translation)
Definition: frames.hpp:572
KDL::Jacobian::rows
unsigned int rows() const
Definition: jacobian.cpp:69
KDL::changeBase
bool changeBase(const Jacobian &src1, const Rotation &rot, Jacobian &dest)
Definition: jacobian.cpp:103
KDL::Jacobian::data
EIGEN_MAKE_ALIGNED_OPERATOR_NEW Eigen::Matrix< double, 6, Eigen::Dynamic > data
Definition: jacobian.hpp:41
KDL::Equal
IMETHOD bool Equal(const FrameAcc &r1, const FrameAcc &r2, double eps=epsilon)
KDL::changeRefPoint
bool changeRefPoint(const Jacobian &src1, const Vector &base_AB, Jacobian &dest)
Definition: jacobian.cpp:89
KDL::SetToZero
void SetToZero(Jacobian &jac)
Definition: jacobian.cpp:79
KDL::Jacobian::Equal
friend bool Equal(const Jacobian &a, const Jacobian &b, double eps)
Definition: jacobian.cpp:136
KDL::Jacobian::getColumn
Twist getColumn(unsigned int i) const
Definition: jacobian.cpp:144
KDL::Jacobian::changeRefFrame
friend bool changeRefFrame(const Jacobian &src1, const Frame &frame, Jacobian &dest)
Definition: jacobian.cpp:117
KDL::Jacobian::operator=
Jacobian & operator=(const Jacobian &arg)
Allocates memory if size of this and argument is different.
Definition: jacobian.cpp:42
KDL::Rotation
represents rotations in 3 dimensional space.
Definition: frames.hpp:303
KDL::Jacobian
Definition: jacobian.hpp:36