fEulerPara.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008, AIST, the University of Tokyo and General Robotix Inc.
3  * All rights reserved. This program is made available under the terms of the
4  * Eclipse Public License v1.0 which accompanies this distribution, and is
5  * available at http://www.eclipse.org/legal/epl-v10.html
6  * Contributors:
7  * The University of Tokyo
8  */
16 #ifndef __FEULERPARA_H_
17 #define __FEULERPARA_H_
18 
19 #include "hrpModelExportDef.h"
20 #include "fMatrix4.h"
21 
29  : public fVec4
30 {
31 public:
33  fEulerPara() : fVec4() {
34  }
36  }
38  fEulerPara(const fVec3& v, double s) {
39  set(v, s);
40  }
42  fEulerPara(double s1, double s2, double s3, double s4) {
43  set(s1, s2, s3, s4);
44  }
45 
47  friend double& Ang(fEulerPara& ep) {
48  return ep.m_scalar;
49  }
51  double& Ang() {
52  return m_scalar;
53  }
55  double Ang() const {
56  return m_scalar;
57  }
59  friend fVec3& Axis(fEulerPara& ep) {
60  return ep.m_vec;
61  }
63  fVec3& Axis() {
64  return m_vec;
65  }
67  const fVec3& Axis() const {
68  return m_vec;
69  }
75  void set(const fVec3& v, double s) {
76  m_scalar = s;
77  m_vec = v;
78  }
80  void set(double s1, double s2, double s3, double s4) {
81  m_vec.set(s1, s2, s3);
82  m_scalar = s4;
83  }
85  void set(const fEulerPara&);
87  void set(const class fMat33&);
88 
90  void identity() {
91  m_scalar = 1.0;
92  m_vec.zero();
93  }
95  void unit();
97  friend fEulerPara unit(const fEulerPara&);
98 
100  friend fEulerPara operator * (double, const fEulerPara&);
102  friend fEulerPara operator - (const fEulerPara&);
104  friend fEulerPara mat2ep(const fMat33&);
106  friend fMat33 ep2mat(const fEulerPara&);
107 
109 
114  void angvel2epdot(const fEulerPara& _ep, const fVec3& _omega);
116  friend fEulerPara angvel2epdot(const fEulerPara& epara, const fVec3& vel);
118  friend fVec3 epdot2angvel(const fEulerPara& epara, const fEulerPara& edot);
120 
126  friend fVec3 epddot2angacc(const fEulerPara& e, const fEulerPara& de, const fEulerPara& dde);
127 
129  void interpolate(const fEulerPara& ep1, const fEulerPara& ep2, double t);
130 
132  double rotation(const fEulerPara& ep0, const fVec3& s);
133 
134 };
135 
136 #endif
3x3 matrix class.
Definition: fMatrix3.h:29
#define HRPBASE_EXPORT
png_voidp s1
Definition: png.h:2110
fVec4 operator=(const fVec4 &vec)
Definition: fMatrix4.cpp:196
png_infop int * unit
Definition: png.h:2451
fEulerPara(double s1, double s2, double s3, double s4)
Constructor specifying the four elements; scalar part is s4.
Definition: fEulerPara.h:42
fVec3 epdot2angvel(const fEulerPara &_epara, const fEulerPara &_edot)
Definition: fEulerPara.cpp:278
fVec3 epddot2angacc(const fEulerPara &_e, const fEulerPara &_de, const fEulerPara &_dde)
Definition: fEulerPara.cpp:287
fEulerPara(const fVec3 &v, double s)
Constructor specifying vector and scalar parts.
Definition: fEulerPara.h:38
friend fVec3 & Axis(fEulerPara &ep)
Access the vector part (a*sin(theta/2))
Definition: fEulerPara.h:59
fEulerPara()
Default constructor.
Definition: fEulerPara.h:33
fMat33 ep2mat(const fEulerPara &_epara)
Definition: fEulerPara.cpp:225
Euler parameter class.
Definition: fEulerPara.h:28
friend double operator*(const fVec4 &, const fVec4 &)
Definition: fMatrix4.cpp:241
double Ang() const
Access the scalar part (cos(theta/2))
Definition: fEulerPara.h:55
friend double & Ang(fEulerPara &ep)
Access the scalar part (cos(theta/2))
Definition: fEulerPara.h:47
fVec3 & Axis()
Access the vector part (a*sin(theta/2))
Definition: fEulerPara.h:63
double m_scalar
Definition: fMatrix4.h:161
Definition: fMatrix4.h:90
t
double & Ang()
Access the scalar part (cos(theta/2))
Definition: fEulerPara.h:51
const fVec3 & Axis() const
Access the vector part (a*sin(theta/2))
Definition: fEulerPara.h:67
friend fVec4 operator-(const fVec4 &)
Definition: fMatrix4.cpp:233
png_voidp png_voidp s2
Definition: png.h:2110
fEulerPara angvel2epdot(const fEulerPara &_epara, const fVec3 &vel)
Definition: fEulerPara.cpp:269
fEulerPara mat2ep(const fMat33 &_mat)
Definition: fEulerPara.cpp:119
3-element vector class.
Definition: fMatrix3.h:206
void identity()
Set identity (no rotation).
Definition: fEulerPara.h:90
fVec3 m_vec
Definition: fMatrix4.h:160


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Thu Sep 8 2022 02:24:03