Libbarrett  1.2.4
include/barrett/math/detail/dynamics-inl.h
00001 /*
00002  * dynamics-inl.h
00003  *
00004  *  Created on: Nov 9, 2011
00005  *      Author: dc
00006  */
00007 
00008 #include <libconfig.h++>
00009 
00010 #include <barrett/units.h>
00011 #include <barrett/cdlbt/dynamics.h>
00012 
00013 
00014 namespace barrett {
00015 namespace math {
00016 
00017 
00018 template<size_t DOF>
00019 Dynamics<DOF>::Dynamics(const libconfig::Setting& setting)
00020 {
00021         if (bt_dynamics_create(&impl, setting.getCSetting(), DOF)) {
00022                 throw(std::runtime_error("(math::Dynamics::Dynamics): Couldn't initialize Dynamics struct."));
00023         }
00024 }
00025 
00026 template<size_t DOF>
00027 Dynamics<DOF>::~Dynamics()
00028 {
00029         bt_dynamics_destroy(impl);
00030 }
00031 
00032 template<size_t DOF>
00033 const typename units::JointTorques<DOF>::type& Dynamics<DOF>::evalInverse(const Kinematics<DOF>& kin, const jv_type& jv, const ja_type& ja)
00034 {
00035         bt_dynamics_eval_inverse(impl, kin.impl, jv.asGslType(), ja.asGslType(), jt.asGslType());
00036         return jt;
00037 }
00038 
00039 //template<size_t DOF>
00040 //const units::JointTorques<DOF>::type& Dynamics<DOF>::operator() (const boost::tuple<jv_type, ja_type>& jointState)
00041 //{
00042 //      return eval(boost::tuples::get<0>(jointState), boost::tuples::get<1>(jointState));
00043 //}
00044 
00045 
00046 }
00047 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Defines