Libbarrett  1.2.4
include/barrett/units.h
Go to the documentation of this file.
00001 /*
00002         Copyright 2009-2014 Barrett Technology <support@barrett.com>
00003 
00004         This file is part of libbarrett.
00005 
00006         This version of libbarrett is free software: you can redistribute it
00007         and/or modify it under the terms of the GNU General Public License as
00008         published by the Free Software Foundation, either version 3 of the
00009         License, or (at your option) any later version.
00010 
00011         This version of libbarrett is distributed in the hope that it will be
00012         useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
00013         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014         GNU General Public License for more details.
00015 
00016         You should have received a copy of the GNU General Public License along
00017         with this version of libbarrett.  If not, see
00018         <http://www.gnu.org/licenses/>.
00019 
00020 */
00021 
00061 #ifndef BARRETT_UNITS_H_
00062 #define BARRETT_UNITS_H_
00063 
00064 
00079 #define BARRETT_UNITS_FIXED_SIZE_TYPEDEFS  \
00080         typedef ::barrett::units::CartesianForce::type cf_type;  \
00081         typedef ::barrett::units::CartesianTorque::type ct_type;  \
00082         typedef ::barrett::units::CartesianPosition::type cp_type;  \
00083         typedef ::barrett::units::CartesianVelocity::type cv_type;  \
00084         typedef ::barrett::units::CartesianAcceleration::type ca_type;  \
00085         typedef ::boost::tuple<cp_type, ::Eigen::Quaterniond> pose_type
00086 
00105 #define BARRETT_UNITS_TYPEDEFS(dimension)  \
00106         typedef ::barrett::math::Matrix<dimension,dimension> sqm_type;  \
00107         typedef ::barrett::math::Vector<dimension>::type v_type;  \
00108         typedef ::barrett::units::JointTorques<dimension>::type jt_type;  \
00109         typedef ::barrett::units::JointPositions<dimension>::type jp_type;  \
00110         typedef ::barrett::units::JointVelocities<dimension>::type jv_type;  \
00111         typedef ::barrett::units::JointAccelerations<dimension>::type ja_type;  \
00112         BARRETT_UNITS_FIXED_SIZE_TYPEDEFS
00113 
00120 #define BARRETT_UNITS_TEMPLATE_TYPEDEFS(dimension)  \
00121         typedef typename ::barrett::math::Matrix<dimension,dimension> sqm_type;  \
00122         typedef typename ::barrett::math::Vector<dimension>::type v_type;  \
00123         typedef typename ::barrett::units::JointTorques<dimension>::type jt_type;  \
00124         typedef typename ::barrett::units::JointPositions<dimension>::type jp_type;  \
00125         typedef typename ::barrett::units::JointVelocities<dimension>::type jv_type;  \
00126         typedef typename ::barrett::units::JointAccelerations<dimension>::type ja_type;  \
00127         BARRETT_UNITS_FIXED_SIZE_TYPEDEFS
00128 
00129 
00130 #include <boost/tuple/tuple.hpp>
00131 #include <Eigen/Geometry>
00132 
00133 #include <barrett/math/matrix.h>
00134 
00135 
00136 namespace barrett {
00137 namespace units {
00138 
00139 
00143 template<int R> struct JointTorques {
00145         typedef typename math::Vector<R, JointTorques<R> >::type type;
00146 };
00147 
00151 template<int R> struct JointPositions {
00153         typedef typename math::Vector<R, JointPositions<R> >::type type;
00154 };
00155 
00159 template<int R> struct JointVelocities {
00161         typedef typename math::Vector<R, JointVelocities<R> >::type type;
00162 };
00163 
00167 template<int R> struct JointAccelerations {
00169         typedef typename math::Vector<R, JointAccelerations<R> >::type type;
00170 };
00171 
00172 
00174 struct CartesianForce {
00176         typedef math::Vector<3, CartesianForce>::type type;
00177 };
00178 
00180 struct CartesianTorque {
00182         typedef math::Vector<3, CartesianTorque>::type type;
00183 };
00184 
00186 struct CartesianPosition {
00188         typedef math::Vector<3, CartesianPosition>::type type;
00189 };
00190 
00192 struct CartesianVelocity {
00194         typedef math::Vector<3, CartesianVelocity>::type type;
00195 };
00196 
00198 struct CartesianAcceleration {
00200         typedef math::Vector<3, CartesianAcceleration>::type type;
00201 };
00202 
00203 
00204 }
00205 }
00206 
00207 
00208 #endif /* BARRETT_UNITS_H_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Defines