Blender  V3.3
eigen_types.hpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: LGPL-2.1-or-later
2  * Copyright 2009 Benoit Bolsee. */
3 
8 #ifndef EIGEN_TYPES_HPP_
9 #define EIGEN_TYPES_HPP_
10 
11 #include <Eigen/Core>
12 #include "kdl/frames.hpp"
13 #include "kdl/tree.hpp"
14 #include "kdl/chain.hpp"
15 #include "kdl/jacobian.hpp"
16 #include "kdl/jntarray.hpp"
17 
18 
19 namespace iTaSC{
20 
21 using KDL::Twist;
22 using KDL::Frame;
23 using KDL::Joint;
24 using KDL::Inertia;
25 using KDL::SegmentMap;
26 using KDL::Tree;
27 using KDL::JntArray;
28 using KDL::Jacobian;
29 using KDL::Segment;
30 using KDL::Rotation;
31 using KDL::Vector;
32 using KDL::Vector2;
33 using KDL::Chain;
34 
35 extern const Frame F_identity;
36 
37 #define e_scalar double
38 #define e_vector Eigen::Matrix<e_scalar, Eigen::Dynamic, 1>
39 #define e_zero_vector Eigen::Matrix<e_scalar, Eigen::Dynamic, 1>::Zero
40 #define e_matrix Eigen::Matrix<e_scalar, Eigen::Dynamic, Eigen::Dynamic>
41 #define e_matrix6 Eigen::Matrix<e_scalar,6,6>
42 #define e_identity_matrix Eigen::Matrix<e_scalar, Eigen::Dynamic, Eigen::Dynamic>::Identity
43 #define e_scalar_vector Eigen::Matrix<e_scalar, Eigen::Dynamic, 1>::Constant
44 #define e_zero_matrix Eigen::Matrix<e_scalar, Eigen::Dynamic, Eigen::Dynamic>::Zero
45 #define e_random_matrix Eigen::Matrix<e_scalar, Eigen::Dynamic, Eigen::Dynamic>::Random
46 #define e_vector6 Eigen::Matrix<e_scalar,6,1>
47 #define e_vector3 Eigen::Matrix<e_scalar,3,1>
48 
49 class Range {
50 public:
51  int start;
52  int count;
53  Range(int _start, int _count) { start = _start; count=_count; }
54  Range(const Range& other) { start=other.start; count=other.count; }
55 };
56 
57 template<typename MatrixType> inline Eigen::Block<MatrixType> project(MatrixType& m, Range r)
58 {
59  return Eigen::Block<MatrixType>(m,r.start,0,r.count,1);
60 }
61 
62 template<typename MatrixType> inline Eigen::Block<MatrixType> project(MatrixType& m, Range r, Range c)
63 {
64  return Eigen::Block<MatrixType>(m,r.start,c.start,r.count,c.count);
65 }
66 
67 template<typename Derived> inline static int changeBase(Eigen::MatrixBase<Derived>& J, const Frame& T) {
68 
69  if (J.rows() != 6)
70  return -1;
71  for (int j = 0; j < J.cols(); ++j) {
72  typename Derived::ColXpr Jj = J.col(j);
73  Twist arg;
74  for(unsigned int i=0;i<6;++i)
75  arg(i)=Jj[i];
76  Twist tmp(T*arg);
77  for(unsigned int i=0;i<6;++i)
78  Jj[i]=e_scalar(tmp(i));
79  }
80  return 0;
81 }
82 
83 }
84 #endif /* UBLAS_TYPES_HPP_ */
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble GLdouble r _GL_VOID_RET _GL_VOID GLfloat GLfloat r _GL_VOID_RET _GL_VOID GLint GLint r _GL_VOID_RET _GL_VOID GLshort GLshort r _GL_VOID_RET _GL_VOID GLdouble GLdouble r
struct Frame Frame
Definition: frames.hpp:261
This class encapsulates a serial kinematic interconnection structure. It is build out of segments.
Definition: chain.hpp:36
represents a frame transformation in 3D space (rotation + translation)
Definition: frames.hpp:526
This class encapsulates a simple joint, that is with one parameterized degree of freedom and with sca...
Definition: joint.hpp:43
represents rotations in 3 dimensional space.
Definition: frames.hpp:299
This class encapsulates a simple segment, that is a "rigid body" (i.e., a frame and an inertia) with...
Definition: segment.hpp:46
This class encapsulates a tree kinematic interconnection structure. It is build out of segments.
Definition: tree.hpp:68
represents both translational and rotational velocities.
Definition: frames.hpp:679
A concrete implementation of a 3 dimensional vector class.
Definition: frames.hpp:143
Range(int _start, int _count)
Definition: eigen_types.hpp:53
Range(const Range &other)
Definition: eigen_types.hpp:54
#define e_scalar
Definition: eigen_types.hpp:37
#define T
static unsigned c
Definition: RandGen.cpp:83
Point2 Vector2
Definition: FitCurve.h:52
std::map< std::string, TreeElement, std::less< std::string >, Eigen::aligned_allocator< std::pair< const std::string, TreeElement > > > SegmentMap
Definition: tree.hpp:35
const Frame F_identity
static int changeBase(Eigen::MatrixBase< Derived > &J, const Frame &T)
Definition: eigen_types.hpp:67
Eigen::Block< MatrixType > project(MatrixType &m, Range r)
Definition: eigen_types.hpp:57