表示刚体的惯性张量和质量信息的类。Provides a class to represent the inertia tensor and mass of a rigid body.
More...
|
template<typename T , std::enable_if_t< std::is_same< T, Scalar >::value||std::is_same< T, float >::value||std::is_same< T, double >::value, int > = 0> |
| Inertia (Scalar m, const T(&values)[9]) |
| 使用质量和 3x3 惯性张量数组构造惯性对象。Constructs an inertia object using mass and a 3x3 inertia tensor array.
|
|
template<typename T , std::enable_if_t< std::is_same< T, Scalar >::value||std::is_same< T, float >::value||std::is_same< T, double >::value, int > = 0> |
| Inertia (Scalar m, const T(&matrix)[3][3]) |
| 使用质量和二维 3x3 数组构造惯性对象。Constructs an inertia object using mass and a 3x3 matrix.
|
|
| Inertia () |
| 默认构造函数,初始化质量为0,惯性张量为零矩阵。Default constructor initializing mass to 0 and inertia tensor to zero.
|
|
template<typename T , std::enable_if_t< std::is_same< T, float >::value||std::is_same< T, double >::value, int > = 0> |
| Inertia (Scalar m, const T(&arr)[6]) |
| 使用质量和 6 维数组(对称惯性矩阵)构造惯性对象。Constructs an inertia object using mass and a 6-element symmetric inertia matrix.
|
|
| Inertia (Scalar m, Scalar xx, Scalar yy, Scalar zz, Scalar xy, Scalar yz, Scalar xz) |
| 直接指定质量和惯性张量分量构造惯性对象。Constructs an inertia object with mass and specified inertia tensor elements.
|
|
| Inertia (Scalar m, const Eigen::Matrix< Scalar, 3, 3 > &R) |
| 使用 Eigen 3x3 矩阵构造惯性对象。Constructs an inertia object using an Eigen 3x3 matrix.
|
|
| operator Eigen::Matrix< Scalar, 3, 3 > () const |
| 转换为 Eigen 3x3 矩阵。Converts to an Eigen 3x3 matrix.
|
|
Scalar | operator() (int i, int j) const |
| 获取惯性张量中的特定元素。Retrieves a specific element from the inertia tensor.
|
|
Eigen::Matrix< Scalar, 3, 3 > | operator+ (const Eigen::Matrix< Scalar, 3, 3 > &R) const |
| 将惯性张量与另一个 3x3 矩阵相加。Adds the inertia tensor with another 3x3 matrix.
|
|
Inertia | Translate (const Eigen::Matrix< Scalar, 3, 1 > &p) const |
| 平移惯性对象。Translates the inertia object.
|
|
Inertia | Rotate (const Eigen::Matrix< Scalar, 3, 3 > &R) const |
| 旋转惯性张量。Rotates the inertia tensor.
|
|
Inertia | Rotate (const RotationMatrix< Scalar > &R) const |
| 使用 RotationMatrix 旋转惯性张量。Rotates the inertia tensor using a RotationMatrix.
|
|
Inertia | Rotate (const Eigen::Quaternion< Scalar > &q) const |
| 使用四元数旋转惯性张量。Rotates the inertia tensor using a quaternion.
|
|
Inertia | Rotate (const Quaternion< Scalar > &q) const |
| 使用自定义 Quaternion 旋转惯性张量。Rotates the inertia tensor using a custom Quaternion.
|
|
template<typename Scalar = DefaultScalar>
class LibXR::Inertia< Scalar >
表示刚体的惯性张量和质量信息的类。Provides a class to represent the inertia tensor and mass of a rigid body.
- Template Parameters
-
Scalar | 数据类型,默认为 DefaultScalar。The data type, defaulting to DefaultScalar. |
Definition at line 24 of file inertia.hpp.
template<typename Scalar = DefaultScalar>
template<typename T , std::enable_if_t< std::is_same< T, Scalar >::value||std::is_same< T, float >::value||std::is_same< T, double >::value, int > = 0>
使用质量和 3x3 惯性张量数组构造惯性对象。Constructs an inertia object using mass and a 3x3 inertia tensor array.
- Template Parameters
-
T | 数据类型,支持 Scalar、float 或 double。Data type, supporting Scalar, float, or double. |
- Parameters
-
m | 质量值。Mass value. |
data | 3x3 惯性张量数组。3x3 inertia tensor array. |
Definition at line 43 of file inertia.hpp.
44 {
45 for (int i = 0; i < 3; i++)
46 {
47 for (int j = 0; j < 3; j++)
48 {
49 data[i * 3 + j] =
static_cast<Scalar
>(values[i * 3 + j]);
50 }
51 }
52 }
Scalar mass
质量值。Mass value.
template<typename Scalar = DefaultScalar>
template<typename T , std::enable_if_t< std::is_same< T, Scalar >::value||std::is_same< T, float >::value||std::is_same< T, double >::value, int > = 0>
LibXR::Inertia< Scalar >::Inertia |
( |
Scalar | m, |
|
|
const T(&) | matrix[3][3] ) |
|
inlineexplicit |
使用质量和二维 3x3 数组构造惯性对象。Constructs an inertia object using mass and a 3x3 matrix.
- Template Parameters
-
T | 数据类型,支持 Scalar、float 或 double。Data type, supporting Scalar, float, or double. |
- Parameters
-
m | 质量值。Mass value. |
data | 3x3 惯性张量矩阵。3x3 inertia tensor matrix. |
Definition at line 66 of file inertia.hpp.
67 {
68 for (int i = 0; i < 3; i++)
69 {
70 for (int j = 0; j < 3; j++)
71 {
72 data[i * 3 + j] =
static_cast<Scalar
>(matrix[i][j]);
73 }
74 }
75 }
template<typename Scalar = DefaultScalar>
template<typename T , std::enable_if_t< std::is_same< T, float >::value||std::is_same< T, double >::value, int > = 0>
使用质量和 6 维数组(对称惯性矩阵)构造惯性对象。Constructs an inertia object using mass and a 6-element symmetric inertia matrix.
- Template Parameters
-
T | 数据类型,支持 float 或 double。Data type, supporting float or double. |
- Parameters
-
m | 质量值。Mass value. |
data | 6 维惯性张量数据。6-element inertia tensor data. |
Definition at line 93 of file inertia.hpp.
94 :
data{arr[0], -arr[3], -arr[5], -arr[3], arr[1],
95 -arr[4], -arr[5], -arr[4], arr[2]},
97 {
98 }