AP_Vehicle.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. This program is free software: you can redistribute it and/or modify
  3. it under the terms of the GNU General Public License as published by
  4. the Free Software Foundation, either version 3 of the License, or
  5. (at your option) any later version.
  6. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9. GNU General Public License for more details.
  10. You should have received a copy of the GNU General Public License
  11. along with this program. If not, see <http://www.gnu.org/licenses/>.
  12. */
  13. #pragma once
  14. /*
  15. this header holds a parameter structure for each vehicle type for
  16. parameters needed by multiple libraries
  17. */
  18. #include <AP_Param/AP_Param.h>
  19. class AP_Vehicle {
  20. public:
  21. /*
  22. common parameters for fixed wing aircraft
  23. */
  24. struct FixedWing {
  25. AP_Int8 throttle_min;
  26. AP_Int8 throttle_max;
  27. AP_Int8 throttle_slewrate;
  28. AP_Int8 throttle_cruise;
  29. AP_Int8 takeoff_throttle_max;
  30. AP_Int16 airspeed_min;
  31. AP_Int16 airspeed_max;
  32. AP_Int32 airspeed_cruise_cm;
  33. AP_Int32 min_gndspeed_cm;
  34. AP_Int8 crash_detection_enable;
  35. AP_Int16 roll_limit_cd;
  36. AP_Int16 pitch_limit_max_cd;
  37. AP_Int16 pitch_limit_min_cd;
  38. AP_Int8 autotune_level;
  39. AP_Int8 stall_prevention;
  40. AP_Int16 loiter_radius;
  41. struct Rangefinder_State {
  42. bool in_range:1;
  43. bool have_initial_reading:1;
  44. bool in_use:1;
  45. float initial_range;
  46. float correction;
  47. float initial_correction;
  48. float last_stable_correction;
  49. uint32_t last_correction_time_ms;
  50. uint8_t in_range_count;
  51. float height_estimate;
  52. float last_distance;
  53. };
  54. // stages of flight
  55. enum FlightStage {
  56. FLIGHT_TAKEOFF = 1,
  57. FLIGHT_VTOL = 2,
  58. FLIGHT_NORMAL = 3,
  59. FLIGHT_LAND = 4,
  60. FLIGHT_ABORT_LAND = 7
  61. };
  62. };
  63. /*
  64. common parameters for multicopters
  65. */
  66. struct MultiCopter {
  67. AP_Int16 angle_max;
  68. };
  69. };
  70. #include "AP_Vehicle_Type.h"