MCPcopy Create free account
hub / github.com/Robotics-STAR-Lab/RACER / Jplus2

Function Jplus2

uav_simulator/Utils/pose_utils/src/pose_utils.cpp:255–283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

253}
254
255mat Jplus2(const colvec& X1, const colvec& X2) {
256 colvec X3 = pose_update(X1, X2);
257 mat R1 = ypr_to_R(X1.rows(3, 5));
258 mat R2 = ypr_to_R(X2.rows(3, 5));
259 mat R3 = ypr_to_R(X3.rows(3, 5));
260 colvec o1 = R1.col(1);
261 colvec a1 = R1.col(2);
262 colvec o2 = R2.col(1);
263 colvec a2 = R2.col(2);
264
265 mat Z = zeros<mat>(3, 3);
266
267 double K2arr[9] = { cos(X2(5 - 1)) * cos(X3(6 - 1) - X2(6 - 1)) / cos(X3(5 - 1)),
268 sin(X3(6 - 1) - X2(6 - 1)) / cos(X3(5 - 1)),
269 0,
270 -cos(X2(5 - 1)) * sin(X3(6 - 1) - X2(6 - 1)),
271 cos(X3(6 - 1) - X2(6 - 1)),
272 0,
273 (a1(1 - 1) * cos(X3(4 - 1)) + a1(2 - 1) * sin(X3(4 - 1))) / cos(X3(5 - 1)),
274 sin(X3(5 - 1)) * sin(X3(6 - 1) - X2(6 - 1)) / cos(X3(5 - 1)),
275 1 };
276 mat K2(3, 3);
277 for (int i = 0; i < 9; i++)
278 K2(i) = K2arr[i];
279 K2 = trans(K2);
280
281 mat J2 = join_cols(join_rows(R1, Z), join_rows(Z, K2));
282 return J2;
283}
284
285// For IMU EKF ----------------------
286

Callers

nothing calls this directly

Calls 2

pose_updateFunction · 0.85
ypr_to_RFunction · 0.70

Tested by

no test coverage detected