00001 // Copyright (C) 2009 Dominick Vanthienen <dominick dot vanthienen at mech dot kuleuven dot be> 00002 00003 // Version: 1.0 00004 // Author: Dominick Vanthienen <dominick dot vanthienen at mech dot kuleuven dot be> 00005 // Maintainer: Ruben Smits <ruben dot smits at mech dot kuleuven dot be> 00006 // URL: http://www.orocos.org/kdl 00007 00008 // This library is free software; you can redistribute it and/or 00009 // modify it under the terms of the GNU Lesser General Public 00010 // License as published by the Free Software Foundation; either 00011 // version 2.1 of the License, or (at your option) any later version. 00012 00013 // This library is distributed in the hope that it will be useful, 00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 // Lesser General Public License for more details. 00017 00018 // You should have received a copy of the GNU Lesser General Public 00019 // License along with this library; if not, write to the Free Software 00020 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00021 00022 #ifndef KDLCHAINDYNPARAM_HPP 00023 #define KDLCHAINDYNPARAM_HPP 00024 00025 #include "chainidsolver_recursive_newton_euler.hpp" 00026 #include "articulatedbodyinertia.hpp" 00027 #include "jntspaceinertiamatrix.hpp" 00028 #include <Eigen/StdVector> 00029 00030 namespace KDL { 00031 00047 class ChainDynParam : SolverI 00048 { 00049 public: 00050 ChainDynParam(const Chain& chain, Vector _grav); 00051 virtual ~ChainDynParam(); 00052 00053 virtual int JntToCoriolis(const JntArray &q, const JntArray &q_dot, JntArray &coriolis); 00054 virtual int JntToMass(const JntArray &q, JntSpaceInertiaMatrix& H); 00055 virtual int JntToGravity(const JntArray &q,JntArray &gravity); 00056 00057 private: 00058 const Chain chain; 00059 int nr; 00060 unsigned int nj; 00061 unsigned int ns; 00062 Vector grav; 00063 Vector vectornull; 00064 JntArray jntarraynull; 00065 ChainIdSolver_RNE chainidsolver_coriolis; 00066 ChainIdSolver_RNE chainidsolver_gravity; 00067 std::vector<Wrench> wrenchnull; 00068 std::vector<Frame> X; 00069 std::vector<Twist> S; 00070 //std::vector<RigidBodyInertia> I; 00071 std::vector<ArticulatedBodyInertia, Eigen::aligned_allocator<ArticulatedBodyInertia> > Ic; 00072 Wrench F; 00073 Twist ag; 00074 00075 }; 00076 00077 } 00078 00079 #endif