jntarrayacc.hpp 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. // Copyright (C) 2007 Ruben Smits <ruben dot smits at mech dot kuleuven dot be>
  2. // Version: 1.0
  3. // Author: Ruben Smits <ruben dot smits at mech dot kuleuven dot be>
  4. // Maintainer: Ruben Smits <ruben dot smits at mech dot kuleuven dot be>
  5. // URL: http://www.orocos.org/kdl
  6. // This library is free software; you can redistribute it and/or
  7. // modify it under the terms of the GNU Lesser General Public
  8. // License as published by the Free Software Foundation; either
  9. // version 2.1 of the License, or (at your option) any later version.
  10. // This library is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. // Lesser General Public License for more details.
  14. // You should have received a copy of the GNU Lesser General Public
  15. // License along with this library; if not, write to the Free Software
  16. // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  17. #ifndef KDL_JNTARRAYACC_HPP
  18. #define KDL_JNTARRAYACC_HPP
  19. #include "utilities/utility.h"
  20. #include "jntarray.hpp"
  21. #include "jntarrayvel.hpp"
  22. #include "frameacc.hpp"
  23. namespace KDL
  24. {
  25. class JntArrayAcc
  26. {
  27. public:
  28. JntArray q;
  29. JntArray qdot;
  30. JntArray qdotdot;
  31. public:
  32. JntArrayAcc(unsigned int size);
  33. JntArrayAcc(const JntArray& q,const JntArray& qdot,const JntArray& qdotdot);
  34. JntArrayAcc(const JntArray& q,const JntArray& qdot);
  35. JntArrayAcc(const JntArray& q);
  36. JntArray value()const;
  37. JntArray deriv()const;
  38. JntArray dderiv()const;
  39. friend void Add(const JntArrayAcc& src1,const JntArrayAcc& src2,JntArrayAcc& dest);
  40. friend void Add(const JntArrayAcc& src1,const JntArrayVel& src2,JntArrayAcc& dest);
  41. friend void Add(const JntArrayAcc& src1,const JntArray& src2,JntArrayAcc& dest);
  42. friend void Subtract(const JntArrayAcc& src1,const JntArrayAcc& src2,JntArrayAcc& dest);
  43. friend void Subtract(const JntArrayAcc& src1,const JntArrayVel& src2,JntArrayAcc& dest);
  44. friend void Subtract(const JntArrayAcc& src1,const JntArray& src2,JntArrayAcc& dest);
  45. friend void Multiply(const JntArrayAcc& src,const double& factor,JntArrayAcc& dest);
  46. friend void Multiply(const JntArrayAcc& src,const doubleVel& factor,JntArrayAcc& dest);
  47. friend void Multiply(const JntArrayAcc& src,const doubleAcc& factor,JntArrayAcc& dest);
  48. friend void Divide(const JntArrayAcc& src,const double& factor,JntArrayAcc& dest);
  49. friend void Divide(const JntArrayAcc& src,const doubleVel& factor,JntArrayAcc& dest);
  50. friend void Divide(const JntArrayAcc& src,const doubleAcc& factor,JntArrayAcc& dest);
  51. friend void SetToZero(JntArrayAcc& array);
  52. friend bool Equal(const JntArrayAcc& src1,const JntArrayAcc& src2,double eps);
  53. };
  54. bool Equal(const JntArrayAcc&, const JntArrayAcc&, double = epsilon);
  55. }
  56. #endif