30 namespace deprecated {
35 double sy = sin(yaw*0.5);
36 double cy = cos(yaw*0.5);
37 double sp = sin(pitch*0.5);
38 double cp = cos(pitch*0.5);
39 double sr = sin(roll*0.5);
40 double cr = cos(roll*0.5);
41 double w = cr*cp*cy + sr*sp*sy;
42 double x = sr*cp*cy - cr*sp*sy;
43 double y = cr*sp*cy + sr*cp*sy;
44 double z = cr*cp*sy - sr*sp*cy;
45 return Eigen::Quaterniond(w,x,y,z);
48 void quat_to_euler(
const Eigen::Quaterniond& q,
double& yaw,
double& pitch,
double& roll)
50 const double& q0 = q.w();
51 const double& q1 = q.x();
52 const double& q2 = q.y();
53 const double& q3 = q.z();
54 roll = atan2(2*(q0*q1+q2*q3), 1-2*(q1*q1+q2*q2));
55 pitch = asin(2*(q0*q2-q3*q1));
56 yaw = atan2(2*(q0*q3+q1*q2), 1-2*(q2*q2+q3*q3));
62 const Eigen::Quaterniond& q0 = t.
rotation();
65 double idelta= 1. / (2. * delta);
67 for (
int i=0; i<6; i++){
70 Eigen::Vector3d tra=tr0;
71 Eigen::Vector3d trb=tr0;
77 Eigen::Quaterniond qa=q0;
78 Eigen::Quaterniond qb=q0;
98 Eigen::Vector3d taAngles, tbAngles;
101 Eigen::Vector3d da = (tbAngles - taAngles) * idelta;
103 for (
int j=0; j<6; j++){
void quat_to_euler(const Eigen::Quaterniond &q, double &yaw, double &pitch, double &roll)
const Eigen::Quaterniond & rotation() const
void jac_quat3_euler3(Eigen::Matrix< double, 6, 6 > &J, const SE3Quat &t)
Eigen::Quaterniond euler_to_quat(double yaw, double pitch, double roll)
const Vector3D & translation() const