OpenWalker Project
Documentation of the ROS Packages
angular_position_ref.h
Go to the documentation of this file.
1 
34 #ifndef OPEN_WALKER_CORE_ANGULAR_POSITION_REF_H
35 #define OPEN_WALKER_CORE_ANGULAR_POSITION_REF_H
36 
37 #include <ow_core/conversions.h>
38 #include <ow_core/quaternion_ref.h>
39 
40 namespace ow_core
41 {
55 template <typename _Derived>
56 class AngularPositionRef : public QuaternionRef<_Derived>
57 {
58 public:
59  typedef _Derived Derived;
61 
62  // typedef Eigen::internal::traits<Derived>::Scalar Scalar;
63 
64 public:
78  explicit AngularPositionRef(Derived& ref, int startRow = 0, int startCol = 0) :
79  Base(ref, startRow, startCol)
80  {
81  }
82 
86  using Base::operator=;
87 
91  using Base::operator*=;
92 
99  void operator=(const tf::Quaternion& q)
100  {
102  }
103 
108  void operator=(const geometry_msgs::Quaternion& q)
109  {
111  }
112 
117  void operator=(const tf::Matrix3x3& other)
118  {
119  matrixTFToEigenQuaternion(other, *this);
120  }
121 
126  operator tf::Quaternion() const
127  {
128  tf::Quaternion q;
130  return q;
131  }
132 
137  operator geometry_msgs::Quaternion() const
138  {
139  geometry_msgs::Quaternion q;
141  return q;
142  }
143 
148  operator tf::Matrix3x3() const
149  {
150  tf::Matrix3x3 m;
151  quaternionEigenToMatrixTF(*this, m);
152  return m;
153  }
154 
159  tf::Quaternion toQuaternionTF()
160  {
161  return static_cast<tf::Quaternion>(*this);
162  }
163 
168  geometry_msgs::Quaternion toQuaternionMsg()
169  {
170  return static_cast<geometry_msgs::Quaternion>(*this);
171  }
172 
177  tf::Matrix3x3 toMatrixTF()
178  {
179  return static_cast<tf::Matrix3x3>(*this);
180  }
181 
182 private:
187 };
188 
189 } // namespace ow_core
190 
191 #endif // OPEN_WALKER_CORE_ANGULAR_POSITION_REF_H
void quaternionEigenToQuaternionMsg(const Eigen::QuaternionBase< _Derived > &e, geometry_msgs::Quaternion &t)
Converts an Eigen::QuaternionBase to a geometry_msgs::Quaternion.
Definition: conversions.h:201
tf::Quaternion toQuaternionTF()
Conversion to tf::Quaternion.
Definition: angular_position_ref.h:159
tf::Matrix3x3 toMatrixTF()
Conversion to tf::Matrix3x3.
Definition: angular_position_ref.h:177
void quaternionEigenToMatrixTF(const Eigen::QuaternionBase< _Derived > &e, tf::Matrix3x3 &t)
Converts an Eigen::QuaternionBase into a tf::Matrix3x3.
Definition: conversions.h:100
void operator=(const geometry_msgs::Quaternion &q)
Assignment of geometry_msgs::Quaternion.
Definition: angular_position_ref.h:108
geometry_msgs::Quaternion toQuaternionMsg()
Conversion to geometry_msgs::Quaternion.
Definition: angular_position_ref.h:168
void quaternionMsgToEigenQuaternion(const geometry_msgs::Quaternion &t, Eigen::QuaternionBase< _Derived > &e)
Converts a geometry_msgs::Quaternion into an Eigen::QuaternionBase.
Definition: conversions.h:172
void operator=(const tf::Quaternion &q)
Assignment of tf::Quaternion.
Definition: angular_position_ref.h:99
Contains global conversion functions.
Get Eigen::QuaternionRef to our namespace.
Definition: quaternion_ref.h:56
Definition: angular_acceleration.h:39
The AngularPositionRef class.
Definition: angular_position_ref.h:56
void quaternionTFToEigenQuaternion(const tf::Quaternion &t, Eigen::QuaternionBase< _Derived > &e)
Converts a tf::Quaternion into an Eigen::QuaternionBase.
Definition: conversions.h:123
void matrixTFToEigenQuaternion(const tf::Matrix3x3 &t, Eigen::QuaternionBase< _Derived > &e)
Converts a tf::Matrix3x3 into an Eigen::QuaternionBase.
Definition: conversions.h:70
void quaternionEigenToQuaternionTF(const Eigen::QuaternionBase< _Derived > &e, tf::Quaternion &t)
Converts a tf::Quaternion into an Eigen::QuaternionBase.
Definition: conversions.h:147
AngularPositionRef(Derived &ref, int startRow=0, int startCol=0)
Default Constructor.
Definition: angular_position_ref.h:78
void operator=(const tf::Matrix3x3 &other)
Assignment of tf::Matrix3x3.
Definition: angular_position_ref.h:117