MCPcopy Create free account
hub / github.com/Robotics-STAR-Lab/SOAR / pose_inverse

Function pose_inverse

src/simulator/Utils/pose_utils/src/pose_utils.cpp:173–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171}
172
173colvec pose_inverse(const colvec& X) {
174 mat R = ypr_to_R(X.rows(3, 5));
175 colvec n = R.col(0);
176 colvec o = R.col(1);
177 colvec a = R.col(2);
178
179 colvec XIxyz = -trans(R) * (X.rows(0, 2));
180 colvec XIypr(3);
181 double XIy = atan2(o(0), n(0));
182 double XIp = atan2(-a(0), n(0) * cos(XIy) + o(0) * sin(XIy));
183 double XIr = atan2(n(2) * sin(XIy) - o(2) * cos(XIy), -n(1) * sin(XIy) + o(1) * cos(XIy));
184 XIypr(0) = XIy;
185 XIypr(1) = XIp;
186 XIypr(2) = XIr;
187
188 colvec XI = join_cols(XIxyz, XIypr);
189 return XI;
190}
191
192colvec pose_update_2d(const colvec& X1, const colvec& X2) {
193 mat R = yaw_to_R(X1(2));

Callers 1

odom_callbackFunction · 0.85

Calls 2

atan2Function · 0.85
ypr_to_RFunction · 0.70

Tested by

no test coverage detected