61 {
63 for (int i = 0; i < 3; i++) omega[i] = update[i];
64
66 for (int i = 0; i < 3; i++) upsilon[i] = update[i + 3];
67
68 double sigma = update[6];
69 double theta = omega.norm();
74 I.setIdentity();
76
77 double eps =
cst(0.00001);
78 double A, B, C;
79 if (fabs(sigma) < eps) {
80 C = 1;
81 if (theta < eps) {
84 R = (I + Omega +
85 Omega * Omega /
86 2);
87
88 } else {
89 double theta2 = theta * theta;
90 A = (1 - std::cos(theta)) / (theta2);
91 B = (theta - std::sin(theta)) / (theta2 * theta);
92 R = I + std::sin(theta) / theta * Omega +
93 (1 - std::cos(theta)) / (theta * theta) * Omega2;
94 }
95 } else {
97 if (theta < eps) {
98 double sigma2 = sigma * sigma;
99 A = ((sigma - 1) *
s + 1) / sigma2;
100 B = ((
cst(0.5) * sigma2 - sigma + 1) *
s - 1) /
101 (sigma2 *
102 sigma);
103
104
105 R = (I + Omega +
106 Omega2 /
107 2);
108 } else {
109 R = I + std::sin(theta) / theta * Omega +
110 (1 - std::cos(theta)) / (theta * theta) * Omega2;
111 double a =
s * std::sin(theta);
112 double b =
s * std::cos(theta);
113 double theta2 = theta * theta;
114 double sigma2 = sigma * sigma;
115 double c = theta2 + sigma2;
116 A = (a * sigma + (1 - b) * theta) / (theta * c);
117 B = (C - ((b - 1) * sigma + a * theta) / (c)) * 1 / (theta2);
118 }
119 }
121
122 Matrix3 W = A * Omega + B * Omega2 + C * I;
124 }
G2O_TYPES_SLAM3D_API Matrix3 skew(const Vector3 &v)
constexpr double cst(long double v)