FrameOrientation.hpp
Go to the documentation of this file.
1 /*
2  * RDL - Robot Dynamics Library
3  * Copyright (c) 2017 Jordan Lack <jlack1987@gmail.com>
4  *
5  * Licensed under the zlib license. See LICENSE for more details.
6  */
7 
8 #ifndef __RDL_DYNAMICS_FRAME_ORIENTATION_HPP__
9 #define __RDL_DYNAMICS_FRAME_ORIENTATION_HPP__
10 
20 
21 namespace RobotDynamics
22 {
23 namespace Math
24 {
30 class FrameOrientation : public FrameObject, public Quaternion
31 {
32  public:
33  FrameOrientation() : FrameObject(nullptr), Quaternion(0., 0., 0., 1.)
34  {
35  }
36 
37  explicit FrameOrientation(ReferenceFramePtr referenceFrame) : FrameObject(referenceFrame), Quaternion(0., 0., 0., 1.)
38  {
39  }
40 
42  {
43  }
44 
45  FrameOrientation(ReferenceFramePtr referenceFrame, double x, double y, double z, double w) : FrameObject(referenceFrame), Quaternion(x, y, z, w)
46  {
47  }
48 
57  {
58  }
59 
60  FrameOrientation(ReferenceFramePtr referenceFrame, const AxisAngle& axis_angle) : FrameObject(referenceFrame), Quaternion(axis_angle)
61  {
62  }
63 
64  FrameOrientation(ReferenceFramePtr referenceFrame, Vector3d axis, double angle) : FrameObject(referenceFrame), Quaternion(axis, angle)
65  {
66  }
67 
69  {
70  return this;
71  }
72 
74  {
75  this->referenceFrame = referenceFrame;
76  set(q);
77  }
78 
80  {
81  this->referenceFrame = referenceFrame;
82  set(E);
83  }
84 
86  {
87  setIncludingFrame(axis_angle.axis(), axis_angle.angle(), referenceFrame);
88  }
89 
91  {
92  this->referenceFrame = referenceFrame;
93  set(axis, angle);
94  }
95 
97  {
98  FrameOrientation ret = *this;
99  ret.changeFrame(referenceFrame);
100  return ret;
101  }
102 };
103 } // namespace Math
104 } // namespace RobotDynamics
105 
106 #endif //__RDL_DYNAMICS_FRAME_ORIENTATION_HPP__
void setIncludingFrame(const Quaternion &q, ReferenceFramePtr referenceFrame)
Math::TransformableGeometricObject * getTransformableGeometricObject()
Pure virtual method that FrameObjects are required to implement so the FrameObject::changeFrame metho...
EIGEN_STRONG_INLINE double & w()
Definition: Quaternion.h:106
FrameOrientation(ReferenceFramePtr referenceFrame, const Matrix3d &E)
ReferenceFramePtr referenceFrame
Definition: FrameObject.hpp:81
FrameOrientation(ReferenceFramePtr referenceFrame, const AxisAngle &axis_angle)
FrameOrientation(ReferenceFramePtr referenceFrame)
The TransformableGeometricObject class is an essential interface because it forces all geometric obje...
Definition: rdl_eigenmath.h:43
void setIncludingFrame(Vector3d axis, double angle, ReferenceFramePtr referenceFrame)
std::shared_ptr< ReferenceFrame > ReferenceFramePtr
virtual void changeFrame(ReferenceFramePtr desiredFrame)
Change the ReferenceFrame this FrameObject is expressed in.
Definition: FrameObject.cpp:12
EIGEN_STRONG_INLINE double & y()
Definition: Quaternion.h:86
Quaternion that are used for singularity free joints.
Definition: Quaternion.h:25
FrameOrientation(ReferenceFramePtr referenceFrame, double x, double y, double z, double w)
FrameOrientation(ReferenceFramePtr referenceFrame, Quaternion quat)
EIGEN_STRONG_INLINE double & x()
Definition: Quaternion.h:76
void setIncludingFrame(const AxisAngle &axis_angle, ReferenceFramePtr referenceFrame)
EIGEN_STRONG_INLINE double & z()
Definition: Quaternion.h:96
FrameOrientation(ReferenceFramePtr referenceFrame, Vector3d axis, double angle)
A Frame object that represents an orientation(quaternion) relative to a reference frame...
FrameOrientation changeFrameAndCopy(ReferenceFramePtr referenceFrame) const
void setIncludingFrame(const Matrix3d &E, ReferenceFramePtr referenceFrame)
Eigen::AngleAxisd AxisAngle
Definition: rdl_eigenmath.h:27
An interface that objects with a ReferenceFrame extend to inherit the FrameObject::changeFrame method...
Definition: FrameObject.hpp:28
Namespace for all structures of the RobotDynamics library.
Definition: Body.h:21


rdl_dynamics
Author(s):
autogenerated on Tue Apr 20 2021 02:25:27