rotations.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * rotations.h
  3. * Copyright (C) Andrew Tridgell 2012
  4. *
  5. * This file is free software: you can redistribute it and/or modify it
  6. * under the terms of the GNU General Public License as published by the
  7. * Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This file is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. * See the GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License along
  16. * with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #pragma once
  19. // these rotations form a full set - every rotation in the following
  20. // list when combined with another in the list forms an entry which is
  21. // also in the list. This is an important property. Please run the
  22. // rotations test suite if you add to the list.
  23. // NOTE!! these rotation values are stored to EEPROM, so be careful not to
  24. // change the numbering of any existing entry when adding a new entry.
  25. enum Rotation : uint8_t {
  26. ROTATION_NONE = 0,
  27. ROTATION_YAW_45 = 1,
  28. ROTATION_YAW_90 = 2,
  29. ROTATION_YAW_135 = 3,
  30. ROTATION_YAW_180 = 4,
  31. ROTATION_YAW_225 = 5,
  32. ROTATION_YAW_270 = 6,
  33. ROTATION_YAW_315 = 7,
  34. ROTATION_ROLL_180 = 8,
  35. ROTATION_ROLL_180_YAW_45 = 9,
  36. ROTATION_ROLL_180_YAW_90 = 10,
  37. ROTATION_ROLL_180_YAW_135 = 11,
  38. ROTATION_PITCH_180 = 12,
  39. ROTATION_ROLL_180_YAW_225 = 13,
  40. ROTATION_ROLL_180_YAW_270 = 14,
  41. ROTATION_ROLL_180_YAW_315 = 15,
  42. ROTATION_ROLL_90 = 16,
  43. ROTATION_ROLL_90_YAW_45 = 17,
  44. ROTATION_ROLL_90_YAW_90 = 18,
  45. ROTATION_ROLL_90_YAW_135 = 19,
  46. ROTATION_ROLL_270 = 20,
  47. ROTATION_ROLL_270_YAW_45 = 21,
  48. ROTATION_ROLL_270_YAW_90 = 22,
  49. ROTATION_ROLL_270_YAW_135 = 23,
  50. ROTATION_PITCH_90 = 24,
  51. ROTATION_PITCH_270 = 25,
  52. ROTATION_PITCH_180_YAW_90 = 26,
  53. ROTATION_PITCH_180_YAW_270 = 27,
  54. ROTATION_ROLL_90_PITCH_90 = 28,
  55. ROTATION_ROLL_180_PITCH_90 = 29,
  56. ROTATION_ROLL_270_PITCH_90 = 30,
  57. ROTATION_ROLL_90_PITCH_180 = 31,
  58. ROTATION_ROLL_270_PITCH_180 = 32,
  59. ROTATION_ROLL_90_PITCH_270 = 33,
  60. ROTATION_ROLL_180_PITCH_270 = 34,
  61. ROTATION_ROLL_270_PITCH_270 = 35,
  62. ROTATION_ROLL_90_PITCH_180_YAW_90 = 36,
  63. ROTATION_ROLL_90_YAW_270 = 37,
  64. ROTATION_ROLL_90_PITCH_68_YAW_293 = 38,
  65. ROTATION_PITCH_315 = 39,
  66. ROTATION_ROLL_90_PITCH_315 = 40,
  67. ROTATION_PITCH_7 = 41,
  68. ///////////////////////////////////////////////////////////////////////
  69. // Do not add more rotations without checking that there is not a conflict
  70. // with the MAVLink spec. MAV_SENSOR_ORIENTATION is expected to match our
  71. // list of rotations here. If a new rotation is added it needs to be added
  72. // to the MAVLink messages as well.
  73. ///////////////////////////////////////////////////////////////////////
  74. ROTATION_MAX,
  75. ROTATION_CUSTOM = 100,
  76. };
  77. /*
  78. Here are the same values in a form sutable for a @Values attribute in
  79. auto documentation:
  80. @Values: 0:None,1:Yaw45,2:Yaw90,3:Yaw135,4:Yaw180,5:Yaw225,6:Yaw270,7:Yaw315,8:Roll180,9:Roll180Yaw45,10:Roll180Yaw90,11:Roll180Yaw135,12:Pitch180,13:Roll180Yaw225,14:Roll180Yaw270,15:Roll180Yaw315,16:Roll90,17:Roll90Yaw45,18:Roll90Yaw90,19:Roll90Yaw135,20:Roll270,21:Roll270Yaw45,22:Roll270Yaw90,23:Roll270Yaw135,24:Pitch90,25:Pitch270,26:Pitch180Yaw90,27:Pitch180Yaw270,28:Roll90Pitch90,29:Roll180Pitch90,30:Roll270Pitch90,31:Roll90Pitch180,32:Roll270Pitch180,33:Roll90Pitch270,34:Roll180Pitch270,35:Roll270Pitch270,36:Roll90Pitch180Yaw90,37:Roll90Yaw270,38:Yaw293Pitch68Roll180,39:Pitch315,40:Roll90Pitch315,100:Custom
  81. */