CartesianPose.h

Go to the documentation of this file.
00001 /* ============================================================
00002  *
00003  * This file is a part of RCI project
00004  *
00005  * Copyright (C) 2011 by Arne Nordmann <anordman at cor-lab dot uni-bielefeld dot de>
00006  *
00007  * This file may be licensed under the terms of the
00008  * GNU Lesser General Public License Version 3 (the ``LGPL''),
00009  * or (at your option) any later version.
00010  *
00011  * Software distributed under the License is distributed
00012  * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
00013  * express or implied. See the LGPL for the specific language
00014  * governing rights and limitations.
00015  *
00016  * You should have received a copy of the LGPL along with this
00017  * program. If not, go to http://www.gnu.org/licenses/lgpl.html
00018  * or write to the Free Software Foundation, Inc.,
00019  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  * The development of this software was supported by:
00022  *   CoR-Lab, Research Institute for Cognition and Robotics
00023  *     Bielefeld University
00024  *
00025  * ============================================================ */
00026 
00027 #pragma once
00028 
00029 #include <iostream>
00030 #include <sstream>
00031 
00032 #include <rsc/math/MathUtils.h>
00033 
00034 #include <nemo/Matrix.h>
00035 
00036 #include "rci/dto/CartesianValues.h"
00037 
00038 namespace rci {
00039 
00040 class Pose;
00041 typedef boost::shared_ptr<Pose> PosePtr;
00042 class Orientation;
00043 typedef boost::shared_ptr<Orientation> OrientationPtr;
00044 class Translation;
00045 typedef boost::shared_ptr<Translation> TranslationPtr;
00046 
00047 class CartesianVelocity;
00048 typedef boost::shared_ptr<CartesianVelocity> CartesianVelocityPtr;
00049 class CartesianAcceleration;
00050 typedef boost::shared_ptr<CartesianAcceleration> CartesianAccelerationPtr;
00051 
00057 class Translation: public CartesianTranslational {
00058 
00059 public:
00060     Translation();
00061     Translation(double valx, double valy, double valz);
00062     Translation(const nemo::RealVector& values);
00063     Translation(const Translation& translation);
00064     Translation(const TranslationPtr& translation);
00065 
00066     static TranslationPtr fromMeters(double x, double y, double z);
00067 
00073     virtual std::string print() const;
00074 };
00075 
00082 class Orientation: public CartesianRotational {
00083 
00084 public:
00085     Orientation();
00086     Orientation(double q0, double q1, double q2, double q3);
00087     Orientation(const nemo::RealVector& values);
00088     Orientation(const Orientation& orientation);
00089     Orientation(const OrientationPtr& orientation);
00090     Orientation(const ::boost::math::quaternion<double>& quaternion);
00091     Orientation(double rxx, double rxy, double rxz, double ryx, double ryy,
00092             double ryz, double rzx, double rzy, double rzz);
00093 
00105     static OrientationPtr
00106     fromEulerAngles(double rotX, double rotY, double rotZ);
00107 
00121     static OrientationPtr
00122     fromAxisAngle(double angle, double vexX, double vecY, double vecZ);
00123 
00128     static OrientationPtr
00129     fromCompactAxisAngle(double x, double y, double z);
00130 
00134     static OrientationPtr
00135     fromQuaternion(double q0, double q1, double q2, double q3);
00136 
00140     static OrientationPtr
00141     fromQuaternion(const ::boost::math::quaternion<double>& quaternion);
00142 
00143     static OrientationPtr
00144     fromRotationMatrix(double rxx, double rxy, double rxz, double ryx,
00145             double ryy, double ryz, double rzx, double rzy, double rzz);
00149     virtual OrientationPtr rotateBy(const OrientationPtr& rot) const;
00150 
00155     virtual std::string print() const;
00156 };
00157 
00165 class Pose: public CartesianValue {
00166 
00167 public:
00168     Pose();
00169     Pose(double valx, double valy, double valz, double vala, double valb,
00170             double valc, double vald);
00171     Pose(double valx, double valy, double valz, double a, double b,
00172             double c);
00173     Pose(const nemo::RealVector& values);
00174     Pose(const Pose& pose);
00175     Pose(const TranslationPtr& transl, const OrientationPtr& rot);
00176 
00182     virtual TranslationPtr getTranslation() const;
00183 
00189     virtual OrientationPtr getOrientation() const;
00190 
00196     virtual double x() const;
00197 
00203     virtual double y() const;
00204 
00210     virtual double z() const;
00211 
00216     virtual double q0() const;
00217 
00223     virtual double q1() const;
00224 
00230     virtual double q2() const;
00231 
00237     virtual double q3() const;
00238 
00244     virtual double a() const;
00245 
00251     virtual double b() const;
00252 
00258     virtual double c() const;
00259 
00263     static PosePtr fromMetersAndRadians(double x, double y, double z, double q0,
00264             double q1, double q2, double q3);
00265     static PosePtr fromMetersAndRadians(double x, double y, double z, double a,
00266             double b, double c);
00267 
00281     static PosePtr fromMetersAndRadiansHomogeneous(double rxx, double rxy,
00282             double rxz, double tx, double ryx, double ryy, double ryz,
00283             double ty, double rzx, double rzy, double rzz, double tz);
00284 
00298     static PosePtr fromMetersAndRadiansHomogeneous(
00299             const nemo::RealMatrix& homogeneous);
00300 
00306     virtual std::string print() const;
00307 };
00308 
00309 }
Generated on Thu Aug 2 14:02:49 2012 for RCI by  doxygen 1.6.3