| 39 | } |
| 40 | |
| 41 | mat yaw_to_R(double yaw) { |
| 42 | mat R = zeros<mat>(2, 2); |
| 43 | double c = cos(yaw); |
| 44 | double s = sin(yaw); |
| 45 | R(0, 0) = c; |
| 46 | R(1, 0) = s; |
| 47 | R(0, 1) = -s; |
| 48 | R(1, 1) = c; |
| 49 | return R; |
| 50 | } |
| 51 | |
| 52 | colvec R_to_ypr(const mat& R) { |
| 53 | colvec n = R.col(0); |