APM:Libraries
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SITL::Plane Class Reference

#include <SIM_Plane.h>

Inheritance diagram for SITL::Plane:
[legend]
Collaboration diagram for SITL::Plane:
[legend]

Public Member Functions

 Plane (const char *home_str, const char *frame_str)
 
virtual void update (const struct sitl_input &input)
 
- Public Member Functions inherited from SITL::Aircraft
 Aircraft (const char *home_str, const char *frame_str)
 
void set_speedup (float speedup)
 
void set_instance (uint8_t _instance)
 
void set_autotest_dir (const char *_autotest_dir)
 
virtual void set_interface_ports (const char *address, const int port_in, const int port_out)
 
void fill_fdm (struct sitl_fdm &fdm)
 
void smooth_sensors (void)
 
float get_rate_hz (void) const
 
const Vector3fget_gyro (void) const
 
const Vector3fget_velocity_ef (void) const
 
const Vector3fget_velocity_air_ef (void) const
 
const Matrix3fget_dcm (void) const
 
const Vector3fget_mag_field_bf (void) const
 
virtual float gross_mass () const
 
const Locationget_location () const
 
const Vector3fget_position () const
 
void get_attitude (Quaternion &attitude) const
 

Static Public Member Functions

static Aircraftcreate (const char *home_str, const char *frame_str)
 
- Static Public Member Functions inherited from SITL::Aircraft
static double rand_normal (double mean, double stddev)
 
static bool parse_home (const char *home_str, Location &loc, float &yaw_degrees)
 

Protected Member Functions

float liftCoeff (float alpha) const
 
float dragCoeff (float alpha) const
 
Vector3f getForce (float inputAileron, float inputElevator, float inputRudder) const
 
Vector3f getTorque (float inputAileron, float inputElevator, float inputRudder, float inputThrust, const Vector3f &force) const
 
void calculate_forces (const struct sitl_input &input, Vector3f &rot_accel, Vector3f &body_accel)
 
- Protected Member Functions inherited from SITL::Aircraft
float ground_height_difference () const
 
virtual bool on_ground () const
 
float hagl () const
 
void update_position (void)
 
void update_mag_field_bf (void)
 
void time_advance ()
 
void setup_frame_time (float rate, float speedup)
 
void adjust_frame_time (float rate)
 
void sync_frame_time (void)
 
void add_noise (float throttle)
 
uint64_t get_wall_time_us (void) const
 
void update_dynamics (const Vector3f &rot_accel)
 
void update_wind (const struct sitl_input &input)
 
float filtered_idx (float v, uint8_t idx)
 
float filtered_servo_angle (const struct sitl_input &input, uint8_t idx)
 
float filtered_servo_range (const struct sitl_input &input, uint8_t idx)
 
void extrapolate_sensors (float delta_time)
 

Protected Attributes

const float hover_throttle = 0.7f
 
const float air_density = 1.225
 
float angle_of_attack
 
float beta
 
struct {
   float   s = 0.45
 
   float   b = 1.88
 
   float   c = 0.24
 
   float   c_lift_0 = 0.56
 
   float   c_lift_deltae = 0
 
   float   c_lift_a = 6.9
 
   float   c_lift_q = 0
 
   float   mcoeff = 50
 
   float   oswald = 0.9
 
   float   alpha_stall = 0.4712
 
   float   c_drag_q = 0
 
   float   c_drag_deltae = 0.0
 
   float   c_drag_p = 0.1
 
   float   c_y_0 = 0
 
   float   c_y_b = -0.98
 
   float   c_y_p = 0
 
   float   c_y_r = 0
 
   float   c_y_deltaa = 0
 
   float   c_y_deltar = -0.2
 
   float   c_l_0 = 0
 
   float   c_l_p = -1.0
 
   float   c_l_b = -0.12
 
   float   c_l_r = 0.14
 
   float   c_l_deltaa = 0.25
 
   float   c_l_deltar = -0.037
 
   float   c_m_0 = 0.045
 
   float   c_m_a = -0.7
 
   float   c_m_q = -20
 
   float   c_m_deltae = 1.0
 
   float   c_n_0 = 0
 
   float   c_n_b = 0.25
 
   float   c_n_p = 0.022
 
   float   c_n_r = -1
 
   float   c_n_deltaa = 0.00
 
   float   c_n_deltar = 0.1
 
   float   deltaa_max = 0.3491
 
   float   deltae_max = 0.3491
 
   float   deltar_max = 0.3491
 
   Vector3f   CGOffset {-0.15, 0, -0.05}
 
coefficient
 
float thrust_scale
 
bool reverse_thrust
 
bool elevons
 
bool vtail
 
bool dspoilers
 
bool reverse_elevator_rudder
 
bool ice_engine
 
bool tailsitter
 
bool have_launcher
 
float launch_accel
 
float launch_time
 
uint64_t launch_start_ms
 
ICEngine icengine {2, 14, 12, 13, 100}
 
- Protected Attributes inherited from SITL::Aircraft
SITLsitl
 
Location home
 
Location location
 
float ground_level
 
float home_yaw
 
float frame_height
 
Matrix3f dcm
 
Vector3f gyro
 
Vector3f gyro_prev
 
Vector3f ang_accel
 
Vector3f velocity_ef
 
Vector3f wind_ef
 
Vector3f velocity_air_ef
 
Vector3f velocity_air_bf
 
Vector3f position
 
float mass
 
Vector3f accel_body
 
float airspeed
 
float airspeed_pitot
 
float battery_voltage = -1.0f
 
float battery_current = 0.0f
 
float rpm1 = 0
 
float rpm2 = 0
 
uint8_t rcin_chan_count = 0
 
float rcin [8]
 
float range = -1.0f
 
float turbulence_azimuth = 0.0f
 
float turbulence_horizontal_speed = 0.0f
 
float turbulence_vertical_speed = 0.0f
 
Vector3f mag_bf
 
uint64_t time_now_us
 
const float gyro_noise
 
const float accel_noise
 
float rate_hz
 
float achieved_rate_hz
 
float target_speedup
 
uint64_t frame_time_us
 
float scaled_frame_time_us
 
uint64_t last_wall_time_us
 
uint8_t instance
 
const char * autotest_dir
 
const char * frame
 
bool use_time_sync = true
 
float last_speedup = -1.0f
 
AP_Int8 * ahrs_orientation
 
enum SITL::Aircraft:: { ... }  ground_behavior
 
bool use_smoothing
 
AP_Terrain * terrain
 
const float FEET_TO_METERS = 0.3048f
 
const float KNOTS_TO_METERS_PER_SECOND = 0.51444f
 

Additional Inherited Members

- Protected Types inherited from SITL::Aircraft
enum  { GROUND_BEHAVIOR_NONE = 0, GROUND_BEHAVIOR_NO_MOVEMENT, GROUND_BEHAVIOR_FWD_ONLY, GROUND_BEHAVIOR_TAILSITTER }
 

Detailed Description

Definition at line 30 of file SIM_Plane.h.

Constructor & Destructor Documentation

◆ Plane()

Plane::Plane ( const char *  home_str,
const char *  frame_str 
)

Definition at line 26 of file SIM_Plane.cpp.

Referenced by create().

Here is the caller graph for this function:

Member Function Documentation

◆ calculate_forces()

void Plane::calculate_forces ( const struct sitl_input input,
Vector3f rot_accel,
Vector3f body_accel 
)
protected

Definition at line 250 of file SIM_Plane.cpp.

Referenced by update(), and SITL::QuadPlane::update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create()

static Aircraft* SITL::Plane::create ( const char *  home_str,
const char *  frame_str 
)
inlinestatic

Definition at line 38 of file SIM_Plane.h.

Here is the call graph for this function:

◆ dragCoeff()

float Plane::dragCoeff ( float  alpha) const
protected

Definition at line 109 of file SIM_Plane.cpp.

Referenced by getForce().

Here is the caller graph for this function:

◆ getForce()

Vector3f Plane::getForce ( float  inputAileron,
float  inputElevator,
float  inputRudder 
) const
protected

Definition at line 196 of file SIM_Plane.cpp.

Referenced by calculate_forces().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTorque()

Vector3f Plane::getTorque ( float  inputAileron,
float  inputElevator,
float  inputRudder,
float  inputThrust,
const Vector3f force 
) const
protected

Definition at line 125 of file SIM_Plane.cpp.

Referenced by calculate_forces().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ liftCoeff()

float Plane::liftCoeff ( float  alpha) const
protected

Definition at line 87 of file SIM_Plane.cpp.

Referenced by getForce().

Here is the caller graph for this function:

◆ update()

void Plane::update ( const struct sitl_input input)
virtual

Implements SITL::Aircraft.

Reimplemented in SITL::QuadPlane.

Definition at line 363 of file SIM_Plane.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ air_density

const float SITL::Plane::air_density = 1.225
protected

Definition at line 44 of file SIM_Plane.h.

Referenced by getForce(), and getTorque().

◆ alpha_stall

float SITL::Plane::alpha_stall = 0.4712

Definition at line 60 of file SIM_Plane.h.

◆ angle_of_attack

float SITL::Plane::angle_of_attack
protected

Definition at line 45 of file SIM_Plane.h.

Referenced by calculate_forces(), getForce(), and getTorque().

◆ b

float SITL::Plane::b = 1.88

Definition at line 52 of file SIM_Plane.h.

Referenced by dragCoeff(), getForce(), and getTorque().

◆ beta

float SITL::Plane::beta
protected

Definition at line 46 of file SIM_Plane.h.

Referenced by calculate_forces(), getForce(), and getTorque().

◆ c

float SITL::Plane::c = 0.24

Definition at line 53 of file SIM_Plane.h.

Referenced by getForce(), and getTorque().

◆ c_drag_deltae

float SITL::Plane::c_drag_deltae = 0.0

Definition at line 62 of file SIM_Plane.h.

Referenced by getForce().

◆ c_drag_p

float SITL::Plane::c_drag_p = 0.1

Definition at line 63 of file SIM_Plane.h.

Referenced by dragCoeff().

◆ c_drag_q

float SITL::Plane::c_drag_q = 0

Definition at line 61 of file SIM_Plane.h.

Referenced by getForce().

◆ c_l_0

float SITL::Plane::c_l_0 = 0

Definition at line 70 of file SIM_Plane.h.

Referenced by getTorque().

◆ c_l_b

float SITL::Plane::c_l_b = -0.12

Definition at line 72 of file SIM_Plane.h.

Referenced by getTorque().

◆ c_l_deltaa

float SITL::Plane::c_l_deltaa = 0.25

Definition at line 74 of file SIM_Plane.h.

Referenced by getTorque().

◆ c_l_deltar

float SITL::Plane::c_l_deltar = -0.037

Definition at line 75 of file SIM_Plane.h.

Referenced by getTorque().

◆ c_l_p

float SITL::Plane::c_l_p = -1.0

Definition at line 71 of file SIM_Plane.h.

Referenced by getTorque().

◆ c_l_r

float SITL::Plane::c_l_r = 0.14

Definition at line 73 of file SIM_Plane.h.

Referenced by getTorque().

◆ c_lift_0

float SITL::Plane::c_lift_0 = 0.56

Definition at line 54 of file SIM_Plane.h.

Referenced by dragCoeff(), and liftCoeff().

◆ c_lift_a

float SITL::Plane::c_lift_a = 6.9

Definition at line 56 of file SIM_Plane.h.

Referenced by getForce().

◆ c_lift_deltae

float SITL::Plane::c_lift_deltae = 0

Definition at line 55 of file SIM_Plane.h.

Referenced by getForce().

◆ c_lift_q

float SITL::Plane::c_lift_q = 0

Definition at line 57 of file SIM_Plane.h.

Referenced by getForce().

◆ c_m_0

float SITL::Plane::c_m_0 = 0.045

Definition at line 76 of file SIM_Plane.h.

Referenced by getTorque().

◆ c_m_a

float SITL::Plane::c_m_a = -0.7

Definition at line 77 of file SIM_Plane.h.

Referenced by getTorque().

◆ c_m_deltae

float SITL::Plane::c_m_deltae = 1.0

Definition at line 79 of file SIM_Plane.h.

Referenced by getTorque().

◆ c_m_q

float SITL::Plane::c_m_q = -20

Definition at line 78 of file SIM_Plane.h.

Referenced by getTorque().

◆ c_n_0

float SITL::Plane::c_n_0 = 0

Definition at line 80 of file SIM_Plane.h.

Referenced by getTorque().

◆ c_n_b

float SITL::Plane::c_n_b = 0.25

Definition at line 81 of file SIM_Plane.h.

Referenced by getTorque().

◆ c_n_deltaa

float SITL::Plane::c_n_deltaa = 0.00

Definition at line 84 of file SIM_Plane.h.

Referenced by getTorque().

◆ c_n_deltar

float SITL::Plane::c_n_deltar = 0.1

Definition at line 85 of file SIM_Plane.h.

Referenced by getTorque().

◆ c_n_p

float SITL::Plane::c_n_p = 0.022

Definition at line 82 of file SIM_Plane.h.

Referenced by getTorque().

◆ c_n_r

float SITL::Plane::c_n_r = -1

Definition at line 83 of file SIM_Plane.h.

Referenced by getTorque().

◆ c_y_0

float SITL::Plane::c_y_0 = 0

Definition at line 64 of file SIM_Plane.h.

Referenced by getForce().

◆ c_y_b

float SITL::Plane::c_y_b = -0.98

Definition at line 65 of file SIM_Plane.h.

Referenced by getForce().

◆ c_y_deltaa

float SITL::Plane::c_y_deltaa = 0

Definition at line 68 of file SIM_Plane.h.

Referenced by getForce().

◆ c_y_deltar

float SITL::Plane::c_y_deltar = -0.2

Definition at line 69 of file SIM_Plane.h.

Referenced by getForce().

◆ c_y_p

float SITL::Plane::c_y_p = 0

Definition at line 66 of file SIM_Plane.h.

Referenced by getForce().

◆ c_y_r

float SITL::Plane::c_y_r = 0

Definition at line 67 of file SIM_Plane.h.

Referenced by getForce().

◆ CGOffset

Vector3f SITL::Plane::CGOffset {-0.15, 0, -0.05}

Definition at line 91 of file SIM_Plane.h.

Referenced by getTorque().

◆ coefficient

struct { ... } SITL::Plane::coefficient

◆ deltaa_max

float SITL::Plane::deltaa_max = 0.3491

Definition at line 86 of file SIM_Plane.h.

◆ deltae_max

float SITL::Plane::deltae_max = 0.3491

Definition at line 87 of file SIM_Plane.h.

◆ deltar_max

float SITL::Plane::deltar_max = 0.3491

Definition at line 88 of file SIM_Plane.h.

◆ dspoilers

bool SITL::Plane::dspoilers
protected

Definition at line 98 of file SIM_Plane.h.

Referenced by calculate_forces(), and Plane().

◆ elevons

bool SITL::Plane::elevons
protected

Definition at line 96 of file SIM_Plane.h.

Referenced by calculate_forces(), Plane(), and SITL::QuadPlane::QuadPlane().

◆ have_launcher

bool SITL::Plane::have_launcher
protected

Definition at line 102 of file SIM_Plane.h.

Referenced by calculate_forces(), and Plane().

◆ hover_throttle

const float SITL::Plane::hover_throttle = 0.7f
protected

Definition at line 43 of file SIM_Plane.h.

Referenced by Plane().

◆ ice_engine

bool SITL::Plane::ice_engine
protected

Definition at line 100 of file SIM_Plane.h.

Referenced by calculate_forces(), and Plane().

◆ icengine

ICEngine SITL::Plane::icengine {2, 14, 12, 13, 100}
protected

Definition at line 107 of file SIM_Plane.h.

Referenced by calculate_forces().

◆ launch_accel

float SITL::Plane::launch_accel
protected

Definition at line 103 of file SIM_Plane.h.

Referenced by calculate_forces(), and Plane().

◆ launch_start_ms

uint64_t SITL::Plane::launch_start_ms
protected

Definition at line 105 of file SIM_Plane.h.

Referenced by calculate_forces().

◆ launch_time

float SITL::Plane::launch_time
protected

Definition at line 104 of file SIM_Plane.h.

Referenced by calculate_forces(), and Plane().

◆ mcoeff

float SITL::Plane::mcoeff = 50

Definition at line 58 of file SIM_Plane.h.

◆ oswald

float SITL::Plane::oswald = 0.9

Definition at line 59 of file SIM_Plane.h.

Referenced by dragCoeff().

◆ reverse_elevator_rudder

bool SITL::Plane::reverse_elevator_rudder
protected

Definition at line 99 of file SIM_Plane.h.

Referenced by calculate_forces(), and Plane().

◆ reverse_thrust

bool SITL::Plane::reverse_thrust
protected

Definition at line 95 of file SIM_Plane.h.

Referenced by calculate_forces(), and Plane().

◆ s

float SITL::Plane::s = 0.45

Definition at line 51 of file SIM_Plane.h.

Referenced by dragCoeff(), getForce(), and getTorque().

◆ tailsitter

bool SITL::Plane::tailsitter
protected

Definition at line 101 of file SIM_Plane.h.

Referenced by calculate_forces(), getTorque(), and Plane().

◆ thrust_scale

float SITL::Plane::thrust_scale
protected

Definition at line 94 of file SIM_Plane.h.

Referenced by calculate_forces(), Plane(), and SITL::QuadPlane::QuadPlane().

◆ vtail

bool SITL::Plane::vtail
protected

Definition at line 97 of file SIM_Plane.h.

Referenced by calculate_forces(), and Plane().


The documentation for this class was generated from the following files: