rotation.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #pragma once
  2. #ifdef __cplusplus
  3. extern "C" {
  4. #endif
  5. #include "dcm.h"
  6. enum Rotation {
  7. ROTATION_NONE = 0,
  8. ROTATION_YAW_45 = 1,
  9. ROTATION_YAW_90 = 2,
  10. ROTATION_YAW_135 = 3,
  11. ROTATION_YAW_180 = 4,
  12. ROTATION_YAW_225 = 5,
  13. ROTATION_YAW_270 = 6,
  14. ROTATION_YAW_315 = 7,
  15. ROTATION_ROLL_180 = 8,
  16. ROTATION_ROLL_180_YAW_45 = 9,
  17. ROTATION_ROLL_180_YAW_90 = 10,
  18. ROTATION_ROLL_180_YAW_135 = 11,
  19. ROTATION_PITCH_180 = 12,
  20. ROTATION_ROLL_180_YAW_225 = 13,
  21. ROTATION_ROLL_180_YAW_270 = 14,
  22. ROTATION_ROLL_180_YAW_315 = 15,
  23. ROTATION_ROLL_90 = 16,
  24. ROTATION_ROLL_90_YAW_45 = 17,
  25. ROTATION_ROLL_90_YAW_90 = 18,
  26. ROTATION_ROLL_90_YAW_135 = 19,
  27. ROTATION_ROLL_270 = 20,
  28. ROTATION_ROLL_270_YAW_45 = 21,
  29. ROTATION_ROLL_270_YAW_90 = 22,
  30. ROTATION_ROLL_270_YAW_135 = 23,
  31. ROTATION_PITCH_90 = 24,
  32. ROTATION_PITCH_270 = 25,
  33. ROTATION_PITCH_180_YAW_90 = 26, // same as ROTATION_ROLL_180_YAW_270
  34. ROTATION_PITCH_180_YAW_270 = 27, // same as ROTATION_ROLL_180_YAW_90
  35. ROTATION_ROLL_90_PITCH_90 = 28,
  36. ROTATION_ROLL_180_PITCH_90 = 29,
  37. ROTATION_ROLL_270_PITCH_90 = 30,
  38. ROTATION_ROLL_90_PITCH_180 = 31,
  39. ROTATION_ROLL_270_PITCH_180 = 32,
  40. ROTATION_ROLL_90_PITCH_270 = 33,
  41. ROTATION_ROLL_180_PITCH_270 = 34,
  42. ROTATION_ROLL_270_PITCH_270 = 35,
  43. ROTATION_ROLL_90_PITCH_180_YAW_90 = 36,
  44. ROTATION_ROLL_90_YAW_270 = 37,
  45. ROTATION_ROLL_90_PITCH_68_YAW_293 =
  46. 38, // this is actually, roll 90, pitch 68.8, yaw 293.3
  47. ROTATION_PITCH_315 = 39,
  48. ROTATION_ROLL_90_PITCH_315 = 40,
  49. ROTATION_PITCH_7 = 41,
  50. ROTATION_ROLL_45 = 42,
  51. ROTATION_ROLL_315 = 43,
  52. };
  53. void rotation_to_dcm(enum Rotation rotation, float dcm[3][3]);
  54. #ifdef __cplusplus
  55. }
  56. #endif