fEulerPara.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2008, AIST, the University of Tokyo and General Robotix Inc.
00003  * All rights reserved. This program is made available under the terms of the
00004  * Eclipse Public License v1.0 which accompanies this distribution, and is
00005  * available at http://www.eclipse.org/legal/epl-v10.html
00006  * Contributors:
00007  * The University of Tokyo
00008  */
00016 #ifndef __FEULERPARA_H_
00017 #define __FEULERPARA_H_
00018 
00019 #include "hrpModelExportDef.h"
00020 #include "fMatrix4.h"
00021 
00028 class HRPBASE_EXPORT fEulerPara 
00029         : public fVec4
00030 {
00031 public:
00033         fEulerPara() : fVec4() {
00034         }
00035         ~fEulerPara() {
00036         }
00038         fEulerPara(const fVec3& v, double s) {
00039                 set(v, s);
00040         }
00042         fEulerPara(double s1, double s2, double s3, double s4) {
00043                 set(s1, s2, s3, s4);
00044         }
00045         
00047         friend double& Ang(fEulerPara& ep) {
00048                 return ep.m_scalar;
00049         }
00051         double& Ang() {
00052                 return m_scalar;
00053         }
00055         double Ang() const {
00056                 return m_scalar;
00057         }
00059         friend fVec3& Axis(fEulerPara& ep) {
00060                 return ep.m_vec;
00061         }
00063         fVec3& Axis() {
00064                 return m_vec;
00065         }
00067         const fVec3& Axis() const {
00068                 return m_vec;
00069         }
00071         fEulerPara operator= (const fEulerPara&);
00073         fEulerPara operator= (const fMat33&);
00075         void set(const fVec3& v, double s) {
00076                 m_scalar = s;
00077                 m_vec = v;
00078         }
00080         void set(double s1, double s2, double s3, double s4) {
00081                 m_vec.set(s1, s2, s3);
00082                 m_scalar = s4;
00083         }
00085         void set(const fEulerPara&);
00087         void set(const class fMat33&);
00088 
00090         void identity() {
00091                 m_scalar = 1.0;
00092                 m_vec.zero();
00093         }
00095         void unit();
00097         friend fEulerPara unit(const fEulerPara&);
00098 
00100         friend fEulerPara operator * (double, const fEulerPara&);
00102         friend fEulerPara operator - (const fEulerPara&);
00104         friend fEulerPara mat2ep(const fMat33&);
00106         friend fMat33 ep2mat(const fEulerPara&);
00107 
00109 
00114         void angvel2epdot(const fEulerPara& _ep, const fVec3& _omega);
00116         friend fEulerPara angvel2epdot(const fEulerPara& epara, const fVec3& vel);
00118         friend fVec3 epdot2angvel(const fEulerPara& epara, const fEulerPara& edot);
00120 
00126         friend fVec3 epddot2angacc(const fEulerPara& e, const fEulerPara& de, const fEulerPara& dde);
00127 
00129         void interpolate(const fEulerPara& ep1, const fEulerPara& ep2, double t);
00130 
00132         double rotation(const fEulerPara& ep0, const fVec3& s);
00133 
00134 };
00135 
00136 #endif


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Sun Apr 2 2017 03:43:53