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 00058 virtual void updateInternalDataStructures(); 00059 00060 private: 00061 const Chain& chain; 00062 int nr; 00063 unsigned int nj; 00064 unsigned int ns; 00065 Vector grav; 00066 Vector vectornull; 00067 JntArray jntarraynull; 00068 ChainIdSolver_RNE chainidsolver_coriolis; 00069 ChainIdSolver_RNE chainidsolver_gravity; 00070 std::vector<Wrench> wrenchnull; 00071 std::vector<Frame> X; 00072 std::vector<Twist> S; 00073 //std::vector<RigidBodyInertia> I; 00074 std::vector<ArticulatedBodyInertia, Eigen::aligned_allocator<ArticulatedBodyInertia> > Ic; 00075 Wrench F; 00076 Twist ag; 00077 00078 }; 00079 00080 } 00081 00082 #endif