SIM_Helicopter.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. /*
  14. helicopter simulator class
  15. */
  16. #pragma once
  17. #include "SIM_Aircraft.h"
  18. namespace SITL {
  19. /*
  20. a helicopter simulator
  21. */
  22. class Helicopter : public Aircraft {
  23. public:
  24. Helicopter(const char *frame_str);
  25. /* update model by one time step */
  26. void update(const struct sitl_input &input) override;
  27. /* static object creator */
  28. static Aircraft *create(const char *frame_str) {
  29. return new Helicopter(frame_str);
  30. }
  31. private:
  32. float terminal_rotation_rate = 4*radians(360.0f);
  33. float hover_throttle = 0.65f;
  34. float terminal_velocity = 40;
  35. float hover_lean = 3.0f;
  36. float yaw_zero = 0.1f;
  37. float rotor_rot_accel = radians(20);
  38. float roll_rate_max = radians(1400);
  39. float pitch_rate_max = radians(1400);
  40. float yaw_rate_max = radians(1400);
  41. float rsc_setpoint = 0.8f;
  42. float thrust_scale;
  43. float tail_thrust_scale;
  44. enum frame_types {
  45. HELI_FRAME_CONVENTIONAL,
  46. HELI_FRAME_DUAL,
  47. HELI_FRAME_COMPOUND
  48. } frame_type = HELI_FRAME_CONVENTIONAL;
  49. bool gas_heli = false;
  50. };
  51. } // namespace SITL