orocos_kdl
jntarray.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_JNTARRAY_HPP
23 #define KDL_JNTARRAY_HPP
24 
25 #include "frames.hpp"
26 #include "jacobian.hpp"
27 
28 #include <Eigen/Core>
29 
30 namespace KDL
31 {
69  class JntArray
70  {
71  public:
72  Eigen::VectorXd data;
73 
81  JntArray();
92  explicit JntArray(unsigned int size);
93 
97  JntArray(const JntArray& arg);
98  ~JntArray();
108  void resize(unsigned int newSize);
109 
110  JntArray& operator = ( const JntArray& arg);
119  double operator()(unsigned int i,unsigned int j=0)const;
128  double& operator()(unsigned int i,unsigned int j=0);
133  unsigned int rows()const;
137  unsigned int columns()const;
138 
139  friend void Add(const JntArray& src1,const JntArray& src2,JntArray& dest);
140  friend void Subtract(const JntArray& src1,const JntArray& src2,JntArray& dest);
141  friend void Multiply(const JntArray& src,const double& factor,JntArray& dest);
142  friend void Divide(const JntArray& src,const double& factor,JntArray& dest);
143  friend void MultiplyJacobian(const Jacobian& jac, const JntArray& src, Twist& dest);
144  friend void SetToZero(JntArray& array);
145  friend bool Equal(const JntArray& src1,const JntArray& src2,double eps);
146 
147  friend bool operator==(const JntArray& src1,const JntArray& src2);
148  //friend bool operator!=(const JntArray& src1,const JntArray& src2);
149  };
150 
151  bool operator==(const JntArray& src1,const JntArray& src2);
152  //bool operator!=(const JntArray& src1,const JntArray& src2);
153 
163  void Add(const JntArray& src1,const JntArray& src2,JntArray& dest);
173  void Subtract(const JntArray& src1,const JntArray& src2,JntArray& dest);
183  void Multiply(const JntArray& src,const double& factor,JntArray& dest);
193  void Divide(const JntArray& src,const double& factor,JntArray& dest);
206  void MultiplyJacobian(const Jacobian& jac, const JntArray& src, Twist& dest);
212  void SetToZero(JntArray& array);
223  bool Equal(const JntArray& src1,const JntArray& src2,double eps=epsilon);
224 
225 }
226 
227 #endif
KDL::JntArray::columns
unsigned int columns() const
Definition: jntarray.cpp:75
frames.hpp
KDL::JntArray::operator==
friend bool operator==(const JntArray &src1, const JntArray &src2)
Definition: jntarray.cpp:118
KDL::JntArray
Definition: jntarray.hpp:69
KDL::Subtract
void Subtract(const JntArray &src1, const JntArray &src2, JntArray &dest)
Definition: jntarray.cpp:85
KDL::JntArray::SetToZero
friend void SetToZero(JntArray &array)
Definition: jntarray.cpp:106
KDL::JntArray::resize
void resize(unsigned int newSize)
Definition: jntarray.cpp:53
KDL::Add
void Add(const JntArray &src1, const JntArray &src2, JntArray &dest)
Definition: jntarray.cpp:80
KDL::Multiply
void Multiply(const JntArray &src, const double &factor, JntArray &dest)
Definition: jntarray.cpp:90
KDL
Definition: kukaLWR_DHnew.cpp:25
KDL::operator==
bool operator==(const Rotation &a, const Rotation &b)
Definition: frames.cpp:455
KDL::JntArray::Subtract
friend void Subtract(const JntArray &src1, const JntArray &src2, JntArray &dest)
Definition: jntarray.cpp:85
KDL::epsilon
double epsilon
default precision while comparing with Equal(..,..) functions. Initialized at 0.0000001.
Definition: utility.cxx:21
KDL::Twist
represents both translational and rotational velocities.
Definition: frames.hpp:723
KDL::JntArray::operator()
double operator()(unsigned int i, unsigned int j=0) const
Definition: jntarray.cpp:58
KDL::JntArray::Add
friend void Add(const JntArray &src1, const JntArray &src2, JntArray &dest)
Definition: jntarray.cpp:80
KDL::JntArray::rows
unsigned int rows() const
Definition: jntarray.cpp:70
KDL::Divide
void Divide(const JntArray &src, const double &factor, JntArray &dest)
Definition: jntarray.cpp:95
KDL::JntArray::JntArray
JntArray()
Definition: jntarray.cpp:26
KDL::JntArray::Multiply
friend void Multiply(const JntArray &src, const double &factor, JntArray &dest)
Definition: jntarray.cpp:90
KDL::JntArray::~JntArray
~JntArray()
Definition: jntarray.cpp:49
KDL::JntArray::data
Eigen::VectorXd data
Definition: jntarray.hpp:72
KDL::Equal
IMETHOD bool Equal(const FrameAcc &r1, const FrameAcc &r2, double eps=epsilon)
KDL::JntArray::Equal
friend bool Equal(const JntArray &src1, const JntArray &src2, double eps)
Definition: jntarray.cpp:111
KDL::JntArray::operator=
JntArray & operator=(const JntArray &arg)
Definition: jntarray.cpp:42
KDL::JntArray::Divide
friend void Divide(const JntArray &src, const double &factor, JntArray &dest)
Definition: jntarray.cpp:95
KDL::SetToZero
void SetToZero(Jacobian &jac)
Definition: jacobian.cpp:79
KDL::MultiplyJacobian
void MultiplyJacobian(const Jacobian &jac, const JntArray &src, Twist &dest)
Definition: jntarray.cpp:100
jacobian.hpp
KDL::JntArray::MultiplyJacobian
friend void MultiplyJacobian(const Jacobian &jac, const JntArray &src, Twist &dest)
Definition: jntarray.cpp:100
KDL::Jacobian
Definition: jacobian.hpp:36