(roll, pitch, yaw)
| 215 | return out |
| 216 | |
| 217 | def rot_to_mat(roll, pitch, yaw): |
| 218 | roll = np.deg2rad(roll) |
| 219 | pitch = np.deg2rad(pitch) |
| 220 | yaw = np.deg2rad(yaw) |
| 221 | |
| 222 | yaw_matrix = np.array([ |
| 223 | [np.cos(yaw), -np.sin(yaw), 0], |
| 224 | [np.sin(yaw), np.cos(yaw), 0], |
| 225 | [0, 0, 1] |
| 226 | ]) |
| 227 | pitch_matrix = np.array([ |
| 228 | [np.cos(pitch), 0, -np.sin(pitch)], |
| 229 | [0, 1, 0], |
| 230 | [np.sin(pitch), 0, np.cos(pitch)] |
| 231 | ]) |
| 232 | roll_matrix = np.array([ |
| 233 | [1, 0, 0], |
| 234 | [0, np.cos(roll), np.sin(roll)], |
| 235 | [0, -np.sin(roll), np.cos(roll)] |
| 236 | ]) |
| 237 | |
| 238 | rotation_matrix = yaw_matrix.dot(pitch_matrix).dot(roll_matrix) |
| 239 | return rotation_matrix |
| 240 | |
| 241 | |
| 242 | def vec_global_to_ref(target_vec_in_global, ref_rot_in_global): |
no test coverage detected