APM:Libraries
SIM_Multicopter.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  multicopter simulator class
17 */
18 
19 #pragma once
20 
21 #include "SIM_Aircraft.h"
22 #include "SIM_Motor.h"
23 #include "SIM_Frame.h"
24 
25 #include "SIM_Sprayer.h"
26 #include "SIM_Gripper_Servo.h"
27 #include "SIM_Gripper_EPM.h"
28 
29 namespace SITL {
30 
31 /*
32  a multicopter simulator
33  */
34 class MultiCopter : public Aircraft {
35 public:
36  MultiCopter(const char *home_str, const char *frame_str);
37 
38  /* update model by one time step */
39  void update(const struct sitl_input &input);
40 
41  /* static object creator */
42  static Aircraft *create(const char *home_str, const char *frame_str) {
43  return new MultiCopter(home_str, frame_str);
44  }
45 
46 protected:
47  // calculate rotational and linear accelerations
48  void calculate_forces(const struct sitl_input &input, Vector3f &rot_accel, Vector3f &body_accel);
50 
51  // The numbers below are the pwm output channels with "0" meaning the first output (aka RC1)
55 
56  float gross_mass() const override;
57 
58 };
59 
60 }
void update(const struct sitl_input &input)
float gross_mass() const override
Gripper_Servo gripper
MultiCopter(const char *home_str, const char *frame_str)
void calculate_forces(const struct sitl_input &input, Vector3f &rot_accel, Vector3f &body_accel)
static Aircraft * create(const char *home_str, const char *frame_str)
Gripper_EPM gripper_epm