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
JntArray dderiv() const
Definition: jntarrayacc.cpp:61
void Subtract(const JntArray &src1, const JntArray &src2, JntArray &dest)
Definition: jntarray.cpp:87
void Divide(const JntArray &src, const double &factor, JntArray &dest)
Definition: jntarray.cpp:97
friend void Add(const JntArrayAcc &src1, const JntArrayAcc &src2, JntArrayAcc &dest)
Definition: jntarrayacc.cpp:66
void resize(unsigned int newSize)
Definition: jntarrayacc.cpp:45
JntArray value() const
Definition: jntarrayacc.cpp:52
This class represents an fixed size array containing joint values of a KDL::Chain.
Definition: jntarray.hpp:69
void Add(const JntArray &src1, const JntArray &src2, JntArray &dest)
Definition: jntarray.cpp:82
friend void Subtract(const JntArrayAcc &src1, const JntArrayAcc &src2, JntArrayAcc &dest)
Definition: jntarrayacc.cpp:85
IMETHOD void SetToZero(Vector &v)
Definition: frames.hpp:1062
IMETHOD bool Equal(const FrameAcc &r1, const FrameAcc &r2, double eps=epsilon)
Definition: frameacc.hpp:394
double epsilon
default precision while comparing with Equal(..,..) functions. Initialized at 0.0000001.
friend bool Equal(const JntArrayAcc &src1, const JntArrayAcc &src2, double eps)
Rall2d< double, double, double > doubleAcc
Definition: frameacc.hpp:40
friend void SetToZero(JntArrayAcc &array)
friend void Divide(const JntArrayAcc &src, const double &factor, JntArrayAcc &dest)
friend void Multiply(const JntArrayAcc &src, const double &factor, JntArrayAcc &dest)
JntArray deriv() const
Definition: jntarrayacc.cpp:57
Rall1d< double > doubleVel
Definition: framevel.hpp:36
void Multiply(const JntArray &src, const double &factor, JntArray &dest)
Definition: jntarray.cpp:92


orocos_kdl
Author(s):
autogenerated on Sat Jun 15 2019 19:07:36