return true if two rotations are equivalent This copes with the fact that we have some duplicates, like ROLL_180_YAW_90 and PITCH_180_YAW_270 */
| 364 | This copes with the fact that we have some duplicates, like ROLL_180_YAW_90 and PITCH_180_YAW_270 |
| 365 | */ |
| 366 | bool rotation_equal(enum Rotation r1, enum Rotation r2) |
| 367 | { |
| 368 | if (r1 == r2) { |
| 369 | return true; |
| 370 | } |
| 371 | Vector3f v(1,2,3); |
| 372 | Vector3f v1 = v; |
| 373 | Vector3f v2 = v; |
| 374 | v1.rotate(r1); |
| 375 | v2.rotate(r2); |
| 376 | return (v1 - v2).length() < 0.001; |
| 377 | } |
| 378 | |
| 379 | /* |
| 380 | * return a velocity correction (in m/s in NED) for a sensor's position given it's position offsets |