#include <Eigen/Geometry>
#include <SWI-cpp.h>
Go to the source code of this file.
|
void | eigen2pl (const Eigen::Quaterniond &q, term_t &out) |
|
void | eigen2pl (const Eigen::Vector3d &v, term_t &out) |
|
void | eigen2pl (const Eigen::Matrix4d &m, term_t &out) |
|
void | pl2eigen (term_t &arg, Eigen::Quaterniond &q) |
|
void | pl2eigen (term_t &arg, Eigen::Vector3d &v) |
|
void | pl2eigen (term_t &arg, Eigen::Matrix4d &m) |
|
foreign_t | quaternion_inverse (term_t t_Quaternion, term_t t_Inverse) |
|
foreign_t | quaternion_transform (term_t t_Quaternion, term_t t_Vector, term_t t_Transformed) |
|
foreign_t | quaternion_multiply (term_t t_Quaternion1, term_t t_Quaternion2, term_t t_Multiplied) |
|
foreign_t | quaternion_diff (term_t t_Quaternion1, term_t t_Quaternion2, term_t t_Diff) |
|
foreign_t | quaternion_slerp (term_t t_Quaternion1, term_t t_Quaternion2, term_t t_Factor, term_t t_Interpolated) |
|
foreign_t | quaternion_matrix (term_t t_Quaternion, term_t t_Translation, term_t t_Matrix) |
|
foreign_t | matrix_quaternion (term_t t_Matrix, term_t t_Quaternion) |
|
foreign_t | matrix_translation (term_t t_Matrix, term_t t_Translation) |
|
◆ PL_SAFE_ARG_MACROS
#define PL_SAFE_ARG_MACROS |
◆ eigen2pl() [1/3]
void eigen2pl |
( |
const Eigen::Matrix4d & |
m, |
|
|
term_t & |
out |
|
) |
| |
Definition at line 24 of file algebra.cpp.
26 for (
int i = 0; i < 4; ++i) {
27 for (
int j = 0; j < 4; ++j) {
◆ eigen2pl() [2/3]
void eigen2pl |
( |
const Eigen::Quaterniond & |
q, |
|
|
term_t & |
out |
|
) |
| |
◆ eigen2pl() [3/3]
void eigen2pl |
( |
const Eigen::Vector3d & |
v, |
|
|
term_t & |
out |
|
) |
| |
◆ matrix_quaternion()
foreign_t matrix_quaternion |
( |
term_t |
t_Matrix, |
|
|
term_t |
t_Quaternion |
|
) |
| |
Definition at line 133 of file algebra.cpp.
136 Eigen::Matrix3d m3 = m4.block(0, 0, 3, 3);
137 Eigen::Quaterniond q(m3);
void pl2eigen(term_t &arg, Eigen::Quaterniond &q)
void eigen2pl(const Eigen::Quaterniond &q, term_t &out)
◆ matrix_translation()
foreign_t matrix_translation |
( |
term_t |
t_Matrix, |
|
|
term_t |
t_Translation |
|
) |
| |
Definition at line 143 of file algebra.cpp.
146 Eigen::Vector3d v = m.block<3, 1>(0, 3, 3, 1);
◆ pl2eigen() [1/3]
void pl2eigen |
( |
term_t & |
arg, |
|
|
Eigen::Matrix4d & |
m |
|
) |
| |
Definition at line 58 of file algebra.cpp.
61 for (
int i = 0; i < 4; ++i) {
62 for (
int j = 0; j < 4; ++j) {
◆ pl2eigen() [2/3]
void pl2eigen |
( |
term_t & |
arg, |
|
|
Eigen::Quaterniond & |
q |
|
) |
| |
◆ pl2eigen() [3/3]
void pl2eigen |
( |
term_t & |
arg, |
|
|
Eigen::Vector3d & |
v |
|
) |
| |
◆ quaternion_diff()
foreign_t quaternion_diff |
( |
term_t |
t_Quaternion1, |
|
|
term_t |
t_Quaternion2, |
|
|
term_t |
t_Diff |
|
) |
| |
Definition at line 97 of file algebra.cpp.
98 Eigen::Quaterniond q1, q2;
101 eigen2pl(q1.inverse() * q2, t_Diff);
◆ quaternion_inverse()
foreign_t quaternion_inverse |
( |
term_t |
t_Quaternion, |
|
|
term_t |
t_Inverse |
|
) |
| |
◆ quaternion_matrix()
foreign_t quaternion_matrix |
( |
term_t |
t_Quaternion, |
|
|
term_t |
t_Translation, |
|
|
term_t |
t_Matrix |
|
) |
| |
Definition at line 118 of file algebra.cpp.
119 Eigen::Quaterniond q;
123 Eigen::Matrix4d m = Eigen::Matrix4d::Identity();
125 m.block(0, 0, 3, 3) = q.toRotationMatrix();
127 m.block(0, 3, 3, 1) = v;
◆ quaternion_multiply()
foreign_t quaternion_multiply |
( |
term_t |
t_Quaternion1, |
|
|
term_t |
t_Quaternion2, |
|
|
term_t |
t_Multiplied |
|
) |
| |
Definition at line 88 of file algebra.cpp.
89 Eigen::Quaterniond q1, q2;
◆ quaternion_slerp()
foreign_t quaternion_slerp |
( |
term_t |
t_Quaternion1, |
|
|
term_t |
t_Quaternion2, |
|
|
term_t |
t_Factor, |
|
|
term_t |
t_Interpolated |
|
) |
| |
Definition at line 106 of file algebra.cpp.
107 Eigen::Quaterniond q1, q2;
111 if (!PL_get_float(t_Factor, &factor))
return FALSE;
112 Eigen::Quaterniond q = q1.slerp(factor, q2);
◆ quaternion_transform()
foreign_t quaternion_transform |
( |
term_t |
t_Quaternion, |
|
|
term_t |
t_Vector, |
|
|
term_t |
t_Transformed |
|
) |
| |