orocos_kdl
jntarrayacc.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_JNTARRAYACC_HPP
23 #define KDL_JNTARRAYACC_HPP
24 
25 #include "utilities/utility.h"
26 #include "jntarray.hpp"
27 #include "jntarrayvel.hpp"
28 #include "frameacc.hpp"
29 
30 namespace KDL
31 {
32  // Equal is friend function, but default arguments for friends are forbidden (ยง8.3.6.4)
33  class JntArrayAcc;
34  bool Equal(const JntArrayAcc& src1,const JntArrayAcc& src2,double eps=epsilon);
35  void Add(const JntArrayAcc& src1,const JntArrayAcc& src2,JntArrayAcc& dest);
36  void Add(const JntArrayAcc& src1,const JntArrayVel& src2,JntArrayAcc& dest);
37  void Add(const JntArrayAcc& src1,const JntArray& src2,JntArrayAcc& dest);
38  void Subtract(const JntArrayAcc& src1,const JntArrayAcc& src2,JntArrayAcc& dest);
39  void Subtract(const JntArrayAcc& src1,const JntArrayVel& src2,JntArrayAcc& dest);
40  void Subtract(const JntArrayAcc& src1,const JntArray& src2,JntArrayAcc& dest);
41  void Multiply(const JntArrayAcc& src,const double& factor,JntArrayAcc& dest);
42  void Multiply(const JntArrayAcc& src,const doubleVel& factor,JntArrayAcc& dest);
43  void Multiply(const JntArrayAcc& src,const doubleAcc& factor,JntArrayAcc& dest);
44  void Divide(const JntArrayAcc& src,const double& factor,JntArrayAcc& dest);
45  void Divide(const JntArrayAcc& src,const doubleVel& factor,JntArrayAcc& dest);
46  void Divide(const JntArrayAcc& src,const doubleAcc& factor,JntArrayAcc& dest);
47  void SetToZero(JntArrayAcc& array);
48 
50  {
51  public:
55  public:
57  explicit JntArrayAcc(unsigned int size);
58  JntArrayAcc(const JntArray& q,const JntArray& qdot,const JntArray& qdotdot);
59  JntArrayAcc(const JntArray& q,const JntArray& qdot);
60  explicit JntArrayAcc(const JntArray& q);
61 
62  void resize(unsigned int newSize);
63 
64  JntArray value()const;
65  JntArray deriv()const;
66  JntArray dderiv()const;
67 
68  friend void Add(const JntArrayAcc& src1,const JntArrayAcc& src2,JntArrayAcc& dest);
69  friend void Add(const JntArrayAcc& src1,const JntArrayVel& src2,JntArrayAcc& dest);
70  friend void Add(const JntArrayAcc& src1,const JntArray& src2,JntArrayAcc& dest);
71  friend void Subtract(const JntArrayAcc& src1,const JntArrayAcc& src2,JntArrayAcc& dest);
72  friend void Subtract(const JntArrayAcc& src1,const JntArrayVel& src2,JntArrayAcc& dest);
73  friend void Subtract(const JntArrayAcc& src1,const JntArray& src2,JntArrayAcc& dest);
74  friend void Multiply(const JntArrayAcc& src,const double& factor,JntArrayAcc& dest);
75  friend void Multiply(const JntArrayAcc& src,const doubleVel& factor,JntArrayAcc& dest);
76  friend void Multiply(const JntArrayAcc& src,const doubleAcc& factor,JntArrayAcc& dest);
77  friend void Divide(const JntArrayAcc& src,const double& factor,JntArrayAcc& dest);
78  friend void Divide(const JntArrayAcc& src,const doubleVel& factor,JntArrayAcc& dest);
79  friend void Divide(const JntArrayAcc& src,const doubleAcc& factor,JntArrayAcc& dest);
80  friend void SetToZero(JntArrayAcc& array);
81  friend bool Equal(const JntArrayAcc& src1,const JntArrayAcc& src2,double eps);
82 
83  };
84 
85 }
86 
87 #endif
KDL::JntArrayAcc::value
JntArray value() const
Definition: jntarrayacc.cpp:52
KDL::JntArray
Definition: jntarray.hpp:69
KDL::JntArrayAcc::Equal
friend bool Equal(const JntArrayAcc &src1, const JntArrayAcc &src2, double eps)
Definition: jntarrayacc.cpp:171
KDL::JntArrayAcc::qdot
JntArray qdot
Definition: jntarrayacc.hpp:53
KDL::Subtract
void Subtract(const JntArray &src1, const JntArray &src2, JntArray &dest)
Definition: jntarray.cpp:85
jntarray.hpp
KDL::Add
void Add(const JntArray &src1, const JntArray &src2, JntArray &dest)
Definition: jntarray.cpp:80
utility.h
KDL::JntArrayAcc::JntArrayAcc
JntArrayAcc()
Definition: jntarrayacc.hpp:56
KDL::Multiply
void Multiply(const JntArray &src, const double &factor, JntArray &dest)
Definition: jntarray.cpp:90
jntarrayvel.hpp
KDL
Definition: kukaLWR_DHnew.cpp:25
KDL::JntArrayAcc::dderiv
JntArray dderiv() const
Definition: jntarrayacc.cpp:61
KDL::epsilon
double epsilon
default precision while comparing with Equal(..,..) functions. Initialized at 0.0000001.
Definition: utility.cxx:21
KDL::JntArrayAcc::qdotdot
JntArray qdotdot
Definition: jntarrayacc.hpp:54
KDL::JntArrayAcc::deriv
JntArray deriv() const
Definition: jntarrayacc.cpp:57
KDL::Divide
void Divide(const JntArray &src, const double &factor, JntArray &dest)
Definition: jntarray.cpp:95
KDL::doubleVel
Rall1d< double > doubleVel
Definition: framevel.hpp:55
KDL::JntArrayAcc::Multiply
friend void Multiply(const JntArrayAcc &src, const double &factor, JntArrayAcc &dest)
Definition: jntarrayacc.cpp:104
KDL::Rall2d
Definition: rall2d.h:76
KDL::JntArrayAcc::Subtract
friend void Subtract(const JntArrayAcc &src1, const JntArrayAcc &src2, JntArrayAcc &dest)
Definition: jntarrayacc.cpp:85
KDL::JntArrayVel
Definition: jntarrayvel.hpp:45
KDL::Rall1d
Definition: rall1d.h:71
KDL::Equal
IMETHOD bool Equal(const FrameAcc &r1, const FrameAcc &r2, double eps=epsilon)
KDL::doubleAcc
Rall2d< double, double, double > doubleAcc
Definition: frameacc.hpp:65
KDL::JntArrayAcc::q
JntArray q
Definition: jntarrayacc.hpp:52
frameacc.hpp
KDL::JntArrayAcc::Add
friend void Add(const JntArrayAcc &src1, const JntArrayAcc &src2, JntArrayAcc &dest)
Definition: jntarrayacc.cpp:66
KDL::SetToZero
void SetToZero(Jacobian &jac)
Definition: jacobian.cpp:79
KDL::JntArrayAcc::Divide
friend void Divide(const JntArrayAcc &src, const double &factor, JntArrayAcc &dest)
Definition: jntarrayacc.cpp:133
KDL::JntArrayAcc::SetToZero
friend void SetToZero(JntArrayAcc &array)
Definition: jntarrayacc.cpp:164
KDL::JntArrayAcc::resize
void resize(unsigned int newSize)
Definition: jntarrayacc.cpp:45
KDL::JntArrayAcc
Definition: jntarrayacc.hpp:49