SIM_SingleCopter.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. single copter simulator class
  15. */
  16. #pragma once
  17. #include "SIM_Aircraft.h"
  18. #include <AP_Motors/AP_Motors.h>
  19. namespace SITL {
  20. /*
  21. a single copter simulator
  22. */
  23. class SingleCopter : public Aircraft {
  24. public:
  25. SingleCopter(const char *frame_str);
  26. /* update model by one time step */
  27. void update(const struct sitl_input &input) override;
  28. /* static object creator */
  29. static Aircraft *create(const char *frame_str) {
  30. return new SingleCopter(frame_str);
  31. }
  32. private:
  33. float terminal_rotation_rate = 4*radians(360.0f);
  34. float hover_throttle = 0.65f;
  35. float terminal_velocity = 40;
  36. float rotor_rot_accel = radians(20) * AP_MOTORS_MATRIX_YAW_FACTOR_CW;
  37. float roll_rate_max = radians(700);
  38. float pitch_rate_max = radians(700);
  39. float yaw_rate_max = radians(700);
  40. float thrust_scale;
  41. enum {
  42. FRAME_SINGLE,
  43. FRAME_COAX,
  44. } frame_type;
  45. };
  46. } // namespace SITL