base
Eigen.hpp
Go to the documentation of this file.
1 #ifndef __BASE_EIGEN_HH__
2 #define __BASE_EIGEN_HH__
3 
4 #include <Eigen/Core>
5 #include <Eigen/Geometry>
6 
7 
8 namespace base
9 {
10 
11  // We define these typedefs to workaround alignment requirements for normal
12  // Eigen types. This reduces the amount of knowledge people have to have to
13  // manipulate these types -- as well as the structures that use them -- and
14  // make them usable in Orocos dataflow.
15  //
16  // Eigen supports converting them to "standard" eigen types in a
17  // straightforward way. Moreover, vectorization does not help for small
18  // sizes
19  typedef Eigen::Matrix<double, 2, 1, Eigen::DontAlign> Vector2d;
20  typedef Eigen::Matrix<double, 3, 1, Eigen::DontAlign> Vector3d;
21  typedef Eigen::Matrix<double, 4, 1, Eigen::DontAlign> Vector4d;
22  typedef Eigen::Matrix<double, 6, 1, Eigen::DontAlign> Vector6d;
23  typedef Eigen::Matrix<double, Eigen::Dynamic, 1, Eigen::DontAlign>
25 
26  typedef Eigen::Matrix<double, 2, 2, Eigen::DontAlign> Matrix2d;
27  typedef Eigen::Matrix<double, 3, 3, Eigen::DontAlign> Matrix3d;
28  typedef Eigen::Matrix<double, 4, 4, Eigen::DontAlign> Matrix4d;
29  typedef Eigen::Matrix<double, 6, 6, Eigen::DontAlign> Matrix6d;
30  typedef Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::DontAlign>
32 
33  typedef Eigen::Quaternion<double, Eigen::DontAlign> Quaterniond;
34  typedef Eigen::AngleAxis<double> AngleAxisd;
35  typedef Eigen::Transform<double, 3, Eigen::Affine, Eigen::DontAlign> Affine3d;
36  typedef Eigen::Transform<double, 3, Eigen::Isometry, Eigen::DontAlign> Isometry3d;
37 
38  // alias for backward compatibility
39  typedef Affine3d Transform3d;
40 
44  template<typename _Derived>
45  static inline bool isnotnan(const Eigen::MatrixBase<_Derived>& x)
46  {
47  return ((x.array() == x.array())).all();
48  };
49 
50  template<typename _Derived>
51  static inline bool isfinite(const Eigen::MatrixBase<_Derived>& x)
52  {
53  return isnotnan(x - x);
54  };
55 
56 }
57 
58 #endif
59 
Affine3d Transform3d
Definition: Eigen.hpp:39
Eigen::Matrix< double, 4, 1, Eigen::DontAlign > Vector4d
Definition: Eigen.hpp:21
Eigen::Matrix< double, 6, 1, Eigen::DontAlign > Vector6d
Definition: Eigen.hpp:22
Eigen::Transform< double, 3, Eigen::Affine, Eigen::DontAlign > Affine3d
Definition: Eigen.hpp:35
Eigen::Matrix< double, 4, 4, Eigen::DontAlign > Matrix4d
Definition: Eigen.hpp:28
Eigen::Matrix< double, 2, 2, Eigen::DontAlign > Matrix2d
Definition: Eigen.hpp:26
Eigen::AngleAxis< double > AngleAxisd
Definition: Eigen.hpp:34
Eigen::Quaternion< double, Eigen::DontAlign > Quaterniond
Definition: Eigen.hpp:33
Eigen::Matrix< double, Eigen::Dynamic, 1, Eigen::DontAlign > VectorXd
Definition: Eigen.hpp:24
Definition: LinearAngular6DCommand.hpp:8
Eigen::Transform< double, 3, Eigen::Isometry, Eigen::DontAlign > Isometry3d
Definition: Eigen.hpp:36
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::DontAlign > MatrixXd
Definition: Eigen.hpp:31
Eigen::Matrix< double, 3, 1, Eigen::DontAlign > Vector3d
Definition: Eigen.hpp:20
Eigen::Matrix< double, 6, 6, Eigen::DontAlign > Matrix6d
Definition: Eigen.hpp:29
Eigen::Matrix< double, 2, 1, Eigen::DontAlign > Vector2d
Definition: Eigen.hpp:19
Eigen::Matrix< double, 3, 3, Eigen::DontAlign > Matrix3d
Definition: Eigen.hpp:27