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
fVec4::operator=
fVec4 operator=(const fVec4 &vec)
Definition: fMatrix4.cpp:196
fEulerPara::Ang
friend double & Ang(fEulerPara &ep)
Access the scalar part (cos(theta/2))
Definition: fEulerPara.h:47
fVec3
3-element vector class.
Definition: fMatrix3.h:206
mat2ep
fEulerPara mat2ep(const fMat33 &_mat)
Definition: fEulerPara.cpp:119
fVec4::set
void set(const fVec3 &v, double s)
Definition: fMatrix4.h:127
HRPBASE_EXPORT
#define HRPBASE_EXPORT
Definition: hrpModelExportDef.h:22
fEulerPara::Axis
const fVec3 & Axis() const
Access the vector part (a*sin(theta/2))
Definition: fEulerPara.h:67
unit
png_infop int * unit
Definition: png.h:2448
fMat33
3x3 matrix class.
Definition: fMatrix3.h:29
fMatrix4.h
angvel2epdot
fEulerPara angvel2epdot(const fEulerPara &_epara, const fVec3 &vel)
Definition: fEulerPara.cpp:269
fEulerPara::identity
void identity()
Set identity (no rotation).
Definition: fEulerPara.h:90
s2
png_voidp png_voidp s2
Definition: png.h:2107
s1
png_voidp s1
Definition: png.h:2107
fVec4::operator-
friend fVec4 operator-(const fVec4 &)
Definition: fMatrix4.cpp:233
fEulerPara::set
void set(double s1, double s2, double s3, double s4)
Set the elements; scalar part is s4.
Definition: fEulerPara.h:80
fVec4::operator*
friend double operator*(const fVec4 &, const fVec4 &)
Definition: fMatrix4.cpp:241
epddot2angacc
fVec3 epddot2angacc(const fEulerPara &_e, const fEulerPara &_de, const fEulerPara &_dde)
Definition: fEulerPara.cpp:287
fEulerPara::Axis
friend fVec3 & Axis(fEulerPara &ep)
Access the vector part (a*sin(theta/2))
Definition: fEulerPara.h:59
fEulerPara::~fEulerPara
~fEulerPara()
Definition: fEulerPara.h:35
fVec4::m_scalar
double m_scalar
Definition: fMatrix4.h:161
fEulerPara::fEulerPara
fEulerPara(double s1, double s2, double s3, double s4)
Constructor specifying the four elements; scalar part is s4.
Definition: fEulerPara.h:42
ep2mat
fMat33 ep2mat(const fEulerPara &_epara)
Definition: fEulerPara.cpp:225
epdot2angvel
fVec3 epdot2angvel(const fEulerPara &_epara, const fEulerPara &_edot)
Definition: fEulerPara.cpp:278
fEulerPara::fEulerPara
fEulerPara(const fVec3 &v, double s)
Constructor specifying vector and scalar parts.
Definition: fEulerPara.h:38
fVec4::m_vec
fVec3 m_vec
Definition: fMatrix4.h:160
hrpModelExportDef.h
fEulerPara
Euler parameter class.
Definition: fEulerPara.h:28
fVec4
Definition: fMatrix4.h:90
fEulerPara::set
void set(const fVec3 &v, double s)
Set the elements.
Definition: fEulerPara.h:75
fEulerPara::Ang
double Ang() const
Access the scalar part (cos(theta/2))
Definition: fEulerPara.h:55
fEulerPara::Axis
fVec3 & Axis()
Access the vector part (a*sin(theta/2))
Definition: fEulerPara.h:63
fEulerPara::Ang
double & Ang()
Access the scalar part (cos(theta/2))
Definition: fEulerPara.h:51
fEulerPara::fEulerPara
fEulerPara()
Default constructor.
Definition: fEulerPara.h:33


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Wed Sep 7 2022 02:51:02