Rigid Body Dynamics Library
rbdl_math.h
Go to the documentation of this file.
1 /*
2  * RBDL - Rigid Body Dynamics Library
3  * Copyright (c) 2011-2018 Martin Felis <martin@fysx.org>
4  *
5  * Licensed under the zlib license. See LICENSE for more details.
6  */
7 
8 #ifndef RBDL_MATH_H
9 #define RBDL_MATH_H
10 
11 #include "rbdl/rbdl_config.h"
12 
13 #ifdef RBDL_USE_SIMPLE_MATH
14 #include "rbdl/SimpleMath/SimpleMathFixed.h"
15 #include "rbdl/SimpleMath/SimpleMathDynamic.h"
16 #include "rbdl/SimpleMath/SimpleMathMixed.h"
17 #include "rbdl/SimpleMath/SimpleMathQR.h"
18 #include "rbdl/SimpleMath/SimpleMathCholesky.h"
19 #include "rbdl/SimpleMath/SimpleMathCommaInitializer.h"
20 #include "rbdl/SimpleMath/SimpleMathMap.h"
21 #include <vector>
22 
23 typedef SimpleMath::Fixed::Matrix<double, 2,1> Vector2_t;
24 typedef SimpleMath::Fixed::Matrix<double, 3,1> Vector3_t;
25 typedef SimpleMath::Fixed::Matrix<double, 3,3> Matrix3_t;
26 typedef SimpleMath::Fixed::Matrix<double, 4,1> Vector4_t;
27 
28 typedef SimpleMath::Fixed::Matrix<double, 6,1> SpatialVector_t;
29 typedef SimpleMath::Fixed::Matrix<double, 6,6> SpatialMatrix_t;
30 
31 typedef SimpleMath::Fixed::Matrix<double, 6,3> Matrix63_t;
32 typedef SimpleMath::Fixed::Matrix<double, 4,3> Matrix43_t;
33 
34 typedef SimpleMath::Dynamic::Matrix<double> MatrixN_t;
35 typedef SimpleMath::Dynamic::Matrix<double> VectorN_t;
36 
37 #else
38 #include <Eigen/Dense>
39 #include <Eigen/StdVector>
40 #include <Eigen/QR>
41 
42 #include "rbdl/rbdl_eigenmath.h"
43 
44 typedef Eigen::Matrix<double, 6, 3> Matrix63_t;
45 typedef Eigen::Matrix<double, 4, 3> Matrix43_t;
46 
47 typedef Eigen::VectorXd VectorN_t;
48 typedef Eigen::MatrixXd MatrixN_t;
49 #endif
50 
51 namespace RigidBodyDynamics {
52 
54 namespace Math {
65 } /* Math */
66 
67 } /* RigidBodyDynamics */
68 
69 #include "rbdl/Quaternion.h"
71 
72 // If we use Eigen3 we have to create specializations of the STL
73 // std::vector such that the alignment is done properly.
74 #ifndef RBDL_USE_SIMPLE_MATH
75  EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(RigidBodyDynamics::Math::SpatialVector)
76  EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(RigidBodyDynamics::Math::SpatialMatrix)
77  EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(RigidBodyDynamics::Math::Matrix63)
78  EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(RigidBodyDynamics::Math::Matrix43)
79  EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(RigidBodyDynamics::Math::SpatialTransform)
80  EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(RigidBodyDynamics::Math::SpatialRigidBodyInertia)
81 #endif
82 
83  /* RBDL_MATH_H_H */
84 #endif
Compact representation of spatial transformations.
Compact representation for Spatial Inertia.
SpatialVector_t SpatialVector
Definition: rbdl_math.h:59
Eigen::VectorXd VectorN_t
Definition: rbdl_math.h:47
Namespace for all structures of the RigidBodyDynamics library.
Definition: Constraints.cc:23
Eigen::Matrix< double, 6, 3 > Matrix63_t
Definition: rbdl_math.h:44
Eigen::MatrixXd MatrixN_t
Definition: rbdl_math.h:48
SpatialMatrix_t SpatialMatrix
Definition: rbdl_math.h:60
Eigen::Matrix< double, 4, 3 > Matrix43_t
Definition: rbdl_math.h:45