libalmath  2.5.7.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
bodymass.h
Go to the documentation of this file.
1 /*
2  * Copyright 2015 Aldebaran. All rights reserved.
3  *
4  */
5 #ifndef LIB_ALMATH_SCENEGRAPH_BODYMASS_H
6 #define LIB_ALMATH_SCENEGRAPH_BODYMASS_H
7 
8 #include <Eigen/Dense>
9 
10 namespace AL {
11 namespace Math {
12 
13 // Mass of a rigid body, described in an implcitly-defined "body frame".
14 template <typename T>
15 struct BodyMass {
16  typedef T Scalar;
17  typedef Eigen::Matrix<Scalar, 3, 1, Eigen::DontAlign> Vector3;
18  typedef Eigen::Matrix<Scalar, 3, 3, Eigen::DontAlign> Matrix3;
19 
21  // center of mass, expressed in the body frame.
23  // rotational inertia, expressed at the body center of mass, the body frame
24  // basis.
26 
27  template <typename S>
28  BodyMass<S> cast() const {
29  return BodyMass<S>{static_cast<S>(mass), center_of_mass.template cast<S>(),
30  rotational_inertia.template cast<S>()};
31  }
32 };
33 }
34 }
35 
36 #endif
Vector3 center_of_mass
Definition: bodymass.h:22
Eigen::Matrix< Scalar, 3, 3, Eigen::DontAlign > Matrix3
Definition: bodymass.h:18
Eigen::Matrix< Scalar, 3, 1, Eigen::DontAlign > Vector3
Definition: bodymass.h:17
BodyMass< S > cast() const
Definition: bodymass.h:28
Matrix3 rotational_inertia
Definition: bodymass.h:25