123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- #pragma once
- #include "SIM_Aircraft.h"
- namespace SITL {
- class Sailboat : public Aircraft {
- public:
- Sailboat(const char *frame_str);
-
- void update(const struct sitl_input &input) override;
-
- static Aircraft *create(const char *frame_str) {
- return new Sailboat(frame_str);
- }
- bool on_ground() const override {return true;};
- private:
-
- void calc_lift_and_drag(float wind_speed, float angle_of_attack_deg, float& lift, float& drag) const;
-
- float get_turn_circle(float steering) const;
-
- float get_yaw_rate(float steering, float speed) const;
-
- float get_lat_accel(float steering, float speed) const;
-
- void update_wave(float delta_time);
- float steering_angle_max;
- float turning_circle;
-
-
- const float lift_curve[18] = {0.00f, 0.50f, 1.00f, 1.10f, 0.95f, 0.75f, 0.60f, 0.40f, 0.20f, 0.00f, -0.20f, -0.40f, -0.60f, -0.75f, -0.95f, -1.10f, -1.00f, -0.50f};
- const float drag_curve[18] = {0.10f, 0.10f, 0.20f, 0.40f, 0.80f, 1.20f, 1.50f, 1.70f, 1.90f, 1.95f, 1.90f, 1.70f, 1.50f, 1.20f, 0.80f, 0.40f, 0.20f, 0.10f};
- const float mass = 2.0f;
- Vector3f velocity_ef_water;
- Vector3f wave_gyro;
- float wave_heave;
- float wave_phase;
- bool motor_connected;
- };
- }
|