/src/modules/attitude_estimator_q/attitude_estimator_q_params.c

https://gitlab.com/SJWink623/Firmware · C · 146 lines · 11 code · 12 blank · 123 comment · 0 complexity · dcd25f0d76350dee6d71abb5251ba184 MD5 · raw file

  1. /****************************************************************************
  2. *
  3. * Copyright (c) 2015 PX4 Development Team. All rights reserved.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions
  7. * are met:
  8. *
  9. * 1. Redistributions of source code must retain the above copyright
  10. * notice, this list of conditions and the following disclaimer.
  11. * 2. Redistributions in binary form must reproduce the above copyright
  12. * notice, this list of conditions and the following disclaimer in
  13. * the documentation and/or other materials provided with the
  14. * distribution.
  15. * 3. Neither the name PX4 nor the names of its contributors may be
  16. * used to endorse or promote products derived from this software
  17. * without specific prior written permission.
  18. *
  19. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  20. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  21. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  22. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  23. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  24. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  25. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  26. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  27. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  28. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  29. * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  30. * POSSIBILITY OF SUCH DAMAGE.
  31. *
  32. ****************************************************************************/
  33. /*
  34. * @file attitude_estimator_q_params.c
  35. *
  36. * Parameters for attitude estimator (quaternion based)
  37. *
  38. * @author Anton Babushkin <anton.babushkin@me.com>
  39. */
  40. #include <systemlib/param/param.h>
  41. /**
  42. * Complimentary filter accelerometer weight
  43. *
  44. * @group Attitude Q estimator
  45. * @min 0
  46. * @max 1
  47. * @decimal 2
  48. */
  49. PARAM_DEFINE_FLOAT(ATT_W_ACC, 0.2f);
  50. /**
  51. * Complimentary filter magnetometer weight
  52. *
  53. * @group Attitude Q estimator
  54. * @min 0
  55. * @max 1
  56. * @decimal 2
  57. */
  58. PARAM_DEFINE_FLOAT(ATT_W_MAG, 0.1f);
  59. /**
  60. * Complimentary filter external heading weight
  61. *
  62. * @group Attitude Q estimator
  63. * @min 0
  64. * @max 1
  65. */
  66. PARAM_DEFINE_FLOAT(ATT_W_EXT_HDG, 0.1f);
  67. /**
  68. * Complimentary filter gyroscope bias weight
  69. *
  70. * @group Attitude Q estimator
  71. * @min 0
  72. * @max 1
  73. * @decimal 2
  74. */
  75. PARAM_DEFINE_FLOAT(ATT_W_GYRO_BIAS, 0.1f);
  76. /**
  77. * Magnetic declination, in degrees
  78. *
  79. * This parameter is not used in normal operation,
  80. * as the declination is looked up based on the
  81. * GPS coordinates of the vehicle.
  82. *
  83. * @group Attitude Q estimator
  84. * @unit deg
  85. * @decimal 2
  86. */
  87. PARAM_DEFINE_FLOAT(ATT_MAG_DECL, 0.0f);
  88. /**
  89. * Automatic GPS based declination compensation
  90. *
  91. * @group Attitude Q estimator
  92. * @boolean
  93. */
  94. PARAM_DEFINE_INT32(ATT_MAG_DECL_A, 1);
  95. /**
  96. * External heading usage mode (from Motion capture/Vision)
  97. * Set to 1 to use heading estimate from vision.
  98. * Set to 2 to use heading from motion capture.
  99. *
  100. * @group Attitude Q estimator
  101. * @value 0 None
  102. * @value 1 Vision
  103. * @value 2 Motion Capture
  104. * @min 0
  105. * @max 2
  106. */
  107. PARAM_DEFINE_INT32(ATT_EXT_HDG_M, 0);
  108. /**
  109. * Acceleration compensation based on GPS
  110. * velocity.
  111. *
  112. * @group Attitude Q estimator
  113. * @boolean
  114. */
  115. PARAM_DEFINE_INT32(ATT_ACC_COMP, 1);
  116. /**
  117. * Gyro bias limit
  118. *
  119. * @group Attitude Q estimator
  120. * @unit rad/s
  121. * @min 0
  122. * @max 2
  123. * @decimal 3
  124. */
  125. PARAM_DEFINE_FLOAT(ATT_BIAS_MAX, 0.05f);
  126. /**
  127. * Threshold (of RMS) to warn about high vibration levels
  128. *
  129. * @group Attitude Q estimator
  130. * @min 0.01
  131. * @max 10
  132. * @decimal 2
  133. */
  134. PARAM_DEFINE_FLOAT(ATT_VIBE_THRESH, 0.2f);