APM:Libraries
SIM_Helicopter.h
Go to the documentation of this file.
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 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  GNU General Public License for more details.
11 
12  You should have received a copy of the GNU General Public License
13  along with this program. If not, see <http://www.gnu.org/licenses/>.
14  */
15 /*
16  helicopter simulator class
17 */
18 
19 #pragma once
20 
21 #include "SIM_Aircraft.h"
22 
23 namespace SITL {
24 
25 /*
26  a helicopter simulator
27  */
28 class Helicopter : public Aircraft {
29 public:
30  Helicopter(const char *home_str, const char *frame_str);
31 
32  /* update model by one time step */
33  void update(const struct sitl_input &input);
34 
35  /* static object creator */
36  static Aircraft *create(const char *home_str, const char *frame_str) {
37  return new Helicopter(home_str, frame_str);
38  }
39 
40 private:
41  float terminal_rotation_rate = 4*radians(360.0f);
42  float hover_throttle = 0.65f;
43  float terminal_velocity = 40;
44  float hover_lean = 3.0f;
45  float yaw_zero = 0.1f;
46  float rotor_rot_accel = radians(20);
47  float roll_rate_max = radians(1400);
48  float pitch_rate_max = radians(1400);
49  float yaw_rate_max = radians(1400);
50  float rsc_setpoint = 0.8f;
51  float thrust_scale;
53  enum frame_types {
58  bool gas_heli = false;
59 };
60 
61 } // namespace SITL
void update(const struct sitl_input &input)
#define f(i)
Helicopter(const char *home_str, const char *frame_str)
static constexpr float radians(float deg)
Definition: AP_Math.h:158
static Aircraft * create(const char *home_str, const char *frame_str)
enum SITL::Helicopter::frame_types frame_type
float terminal_rotation_rate