$search
00001 /****************************************************************************** 00002 * This file is part of the KDL project * 00003 * * 00004 * (C) 2004 Peter Soetens * 00005 * peter.soetens@mech.kuleuven.be * 00006 * Department of Mechanical Engineering, * 00007 * Katholieke Universiteit Leuven, Belgium. * 00008 * * 00009 * You may redistribute this software and/or modify it under either the * 00010 * terms of the GNU Lesser General Public License version 2.1 (LGPLv2.1 * 00011 * <http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html>) or (at your * 00012 * discretion) of the Modified BSD License: * 00013 * Redistribution and use in source and binary forms, with or without * 00014 * modification, are permitted provided that the following conditions * 00015 * are met: * 00016 * 1. Redistributions of source code must retain the above copyright * 00017 * notice, this list of conditions and the following disclaimer. * 00018 * 2. Redistributions in binary form must reproduce the above copyright * 00019 * notice, this list of conditions and the following disclaimer in the * 00020 * documentation and/or other materials provided with the distribution. * 00021 * 3. The name of the author may not be used to endorse or promote * 00022 * products derived from this software without specific prior written * 00023 * permission. * 00024 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * 00025 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * 00026 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * 00027 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,* 00028 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * 00029 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * 00030 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * 00031 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * 00032 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING * 00033 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * 00034 * POSSIBILITY OF SUCH DAMAGE. * 00035 * * 00036 *******************************************************************************/ 00037 /* @Description: 00038 * @brief KDL typekit for Orocos RTT 00039 * @Author: Peter Soetens 00040 */ 00041 00042 #ifndef MOTIONPROPERTIES_HPP 00043 #define MOTIONPROPERTIES_HPP 00044 00045 #include <kdl/frames.hpp> 00046 #include <rtt/Property.hpp> 00047 #include <rtt/PropertyBag.hpp> 00048 #include <rtt/extras/MultiVector.hpp> 00049 #include <rtt/types/TemplateTypeInfo.hpp> 00050 #include <rtt/typekit/RealTimeTypekit.hpp> 00051 00052 #include <sstream> 00053 00054 namespace RTT 00055 { 00056 using namespace KDL; 00057 // /** 00058 // * Additional functionality for handling a Property<JntArray> 00059 // */ 00060 // void decomposeProperty(const JntArray &v, PropertyBag& targetbag ); 00061 // 00062 // /** 00063 // * Aim of this kind of functions : given a Property<PropertyBag> with one of the 00064 // * properties being a bag containing a JntArray, fill the given non primitive Property<T>. 00065 // */ 00066 // bool composeProperty(const PropertyBag& bag, JntArray &v); 00067 // 00068 00072 void decomposeProperty(const Vector &v, PropertyBag& targetbag ); 00073 00078 bool composeProperty(const PropertyBag& bag, Vector &v); 00079 00080 00084 void decomposeProperty(const Rotation &b, PropertyBag& targetbag); 00085 00090 bool composeProperty(const PropertyBag& bag, Rotation &r); 00091 00101 void decomposeProperty(const KDL::Twist &t, PropertyBag& targetbag); 00102 00107 bool composeProperty(const PropertyBag& bag, KDL::Twist &t); 00108 00118 void decomposeProperty( const KDL::Wrench &b, PropertyBag& targetbag); 00119 00124 bool composeProperty(const PropertyBag& bag, KDL::Wrench &w); 00125 00135 void decomposeProperty(const KDL::Frame &f, PropertyBag& target); 00136 00141 bool composeProperty(const PropertyBag& bag, KDL::Frame &f); 00142 } 00143 00144 namespace RTT 00145 { 00146 extern template class Property<KDL::Frame>; 00147 //extern template class Property<KDL::JntArray>; 00148 extern template class Property<KDL::Wrench>; 00149 extern template class Property<KDL::Twist>; 00150 extern template class Property<KDL::Rotation>; 00151 extern template class Property<KDL::Vector>; 00152 } 00153 00154 #endif