1#ifndef BITSIM_DYNAMICS_FIXED_WING_DYNAMICS_H
2#define BITSIM_DYNAMICS_FIXED_WING_DYNAMICS_H
116 std::vector<LandingGearWheel>
gear{
117 {{0.55, 0.0, 0.32}, 2000.0, 120.0,
true,
false},
118 {{-0.08, -0.45, 0.32}, 2000.0, 120.0,
false,
true},
119 {{-0.08, 0.45, 0.32}, 2000.0, 120.0,
false,
true},
The basic types of bitsim. Code outside this file names Eigen's matrix and vector types only through ...
FixedWingState & state() noexcept
Definition fixed_wing_dynamics.h:207
bool on_ground() const
whether a wheel touches the ground
Definition fixed_wing_dynamics.cpp:270
real_t course() const
the direction of the velocity over the ground [rad]
Definition fixed_wing_dynamics.cpp:256
FixedWingDynamics(const FixedWingParameters ¶meters, const FixedWingState &state)
Definition fixed_wing_dynamics.cpp:34
void step(const FixedWingControls &controls, real_t dt)
Advance by dt [s] with the given controls, which are first limited.
Definition fixed_wing_dynamics.cpp:223
const FixedWingState & state() const noexcept
Definition fixed_wing_dynamics.h:206
FixedWingForces forces(const FixedWingState &x, const FixedWingControls &controls) const
Definition fixed_wing_dynamics.cpp:102
real_t altitude() const
Definition fixed_wing_dynamics.h:215
FixedWingState derivative(const FixedWingState &x, const FixedWingControls &controls) const
Definition fixed_wing_dynamics.cpp:200
real_t time() const noexcept
Definition fixed_wing_dynamics.h:209
const RealColVec3d & wind() const noexcept
Definition fixed_wing_dynamics.h:204
real_t beta() const
Definition fixed_wing_dynamics.cpp:247
real_t ground_speed() const
Definition fixed_wing_dynamics.cpp:249
real_t alpha() const
Definition fixed_wing_dynamics.cpp:246
void set_wind(const RealColVec3d &wind_ned)
The wind, in the world [m/s]; the direction it blows towards.
Definition fixed_wing_dynamics.h:203
real_t climb_rate() const
[m/s], positive up
Definition fixed_wing_dynamics.cpp:263
static RealMat3d rotation(real_t phi, real_t theta, real_t psi)
Definition fixed_wing_dynamics.cpp:55
FixedWingControls limit(const FixedWingControls &controls) const
Definition fixed_wing_dynamics.cpp:63
const FixedWingParameters & parameters() const noexcept
Definition fixed_wing_dynamics.h:208
real_t airspeed() const
Definition fixed_wing_dynamics.cpp:245
Where each value is in a FixedWingState.
Definition fixed_wing_dynamics.h:25
Index
Definition fixed_wing_dynamics.h:27
@ THETA
Definition fixed_wing_dynamics.h:35
@ PE
Definition fixed_wing_dynamics.h:29
@ V
Definition fixed_wing_dynamics.h:32
@ PD
Definition fixed_wing_dynamics.h:30
@ P
Definition fixed_wing_dynamics.h:37
@ PN
Definition fixed_wing_dynamics.h:28
@ U
Definition fixed_wing_dynamics.h:31
@ Q
Definition fixed_wing_dynamics.h:38
@ PSI
Definition fixed_wing_dynamics.h:36
@ PHI
Definition fixed_wing_dynamics.h:34
@ R
Definition fixed_wing_dynamics.h:39
@ W
Definition fixed_wing_dynamics.h:33
Models of how things move: wheeled robots, a bicycle, a quadrotor and a fixed wing aircraft,...
Definition bicycle_vehicle_model_dynamics.cpp:10
UnalignedMat< real_t, 12, 1 > FixedWingState
The 12 values of the state of a fixed wing aircraft, in this order: the position (north,...
Definition fixed_wing_dynamics.h:19
Eigen::Matrix< T, N, M, Eigen::DontAlign|(N==1 &&M !=1 ? Eigen::RowMajor :Eigen::ColMajor)> UnalignedMat
General fixed size matrix that Eigen does not align. Use it for a fixed size member of a class that i...
Definition bitsim_types.h:74
Eigen::Matrix3< real_t > RealMat3d
3×3 matrix of type double.
Definition bitsim_types.h:86
double real_t
real_t
Definition bitsim_types.h:20
Eigen::Vector3d RealColVec3d
3D column vector
Definition bitsim_types.h:137
What the pilot or the autopilot sets.
Definition fixed_wing_dynamics.h:47
real_t brake
of the main wheels, in [0, 1]
Definition fixed_wing_dynamics.h:52
real_t elevator
[rad]; positive is trailing edge down, which pitches the nose down
Definition fixed_wing_dynamics.h:48
real_t throttle
in [0, 1], up to FixedWingParameters::max_throttle
Definition fixed_wing_dynamics.h:51
real_t aileron
[rad]; positive rolls the aircraft right
Definition fixed_wing_dynamics.h:49
real_t rudder
[rad]; positive yaws the nose left, and steers the nose wheel left
Definition fixed_wing_dynamics.h:50
The forces and moments on the aircraft, in the body frame, and the air data they come from.
Definition fixed_wing_dynamics.h:140
real_t alpha
the angle of attack [rad]
Definition fixed_wing_dynamics.h:144
real_t beta
the sideslip angle [rad]
Definition fixed_wing_dynamics.h:145
real_t thrust
[N]
Definition fixed_wing_dynamics.h:146
RealColVec3d force
[N]
Definition fixed_wing_dynamics.h:141
real_t airspeed
[m/s]
Definition fixed_wing_dynamics.h:143
real_t ground_load
the sum of the wheels' normal forces [N]
Definition fixed_wing_dynamics.h:147
RealColVec3d moment
[N m]
Definition fixed_wing_dynamics.h:142
The aircraft: its mass, its geometry, its aerodynamic coefficients, its propeller and motor,...
Definition fixed_wing_dynamics.h:73
real_t Cm_de
Definition fixed_wing_dynamics.h:91
real_t c
the mean chord [m]
Definition fixed_wing_dynamics.h:84
real_t e
the Oswald efficiency of the wing
Definition fixed_wing_dynamics.h:86
real_t Cn0
Definition fixed_wing_dynamics.h:98
real_t nose_steering
nose wheel angle per rad of rudder
Definition fixed_wing_dynamics.h:121
real_t Cl_beta
Definition fixed_wing_dynamics.h:97
real_t stall_sharpness
how suddenly it stalls
Definition fixed_wing_dynamics.h:93
real_t max_rudder
Definition fixed_wing_dynamics.h:112
real_t CY_r
Definition fixed_wing_dynamics.h:96
real_t CL_de
Definition fixed_wing_dynamics.h:89
real_t Cl_da
Definition fixed_wing_dynamics.h:97
real_t CQ0
Definition fixed_wing_dynamics.h:107
real_t CT1
Definition fixed_wing_dynamics.h:106
real_t Cn_dr
Definition fixed_wing_dynamics.h:98
real_t CT0
Definition fixed_wing_dynamics.h:106
real_t motor_KV
[rpm/V]
Definition fixed_wing_dynamics.h:102
std::vector< LandingGearWheel > gear
Definition fixed_wing_dynamics.h:116
real_t Jx
[kg m^2]
Definition fixed_wing_dynamics.h:76
real_t aspect_ratio() const
Definition fixed_wing_dynamics.h:132
real_t Cn_r
Definition fixed_wing_dynamics.h:98
real_t Cm_alpha
Definition fixed_wing_dynamics.h:91
real_t mass
[kg]
Definition fixed_wing_dynamics.h:75
real_t Jz
[kg m^2]
Definition fixed_wing_dynamics.h:78
real_t Jxz
[kg m^2]
Definition fixed_wing_dynamics.h:79
real_t Cl_dr
Definition fixed_wing_dynamics.h:97
real_t CY_beta
Definition fixed_wing_dynamics.h:96
real_t CD0
Definition fixed_wing_dynamics.h:90
real_t CY0
Definition fixed_wing_dynamics.h:96
real_t motor_i0
the no-load current [A]
Definition fixed_wing_dynamics.h:104
real_t prop_diameter
[m]
Definition fixed_wing_dynamics.h:101
real_t CD_q
Definition fixed_wing_dynamics.h:90
real_t CD_de
Definition fixed_wing_dynamics.h:90
real_t rho
the density of the air [kg/m^3]
Definition fixed_wing_dynamics.h:85
real_t stall_alpha
the angle of attack at which the wing stalls [rad]
Definition fixed_wing_dynamics.h:92
real_t motor_R
[ohm]
Definition fixed_wing_dynamics.h:103
real_t CQ2
torque coefficient in it
Definition fixed_wing_dynamics.h:107
real_t CL_q
Definition fixed_wing_dynamics.h:89
real_t CY_dr
Definition fixed_wing_dynamics.h:96
real_t S
the wing area [m^2]
Definition fixed_wing_dynamics.h:82
real_t rolling_friction
Definition fixed_wing_dynamics.h:122
real_t battery_V
the voltage at full throttle [V]
Definition fixed_wing_dynamics.h:105
real_t Cl_p
Definition fixed_wing_dynamics.h:97
real_t max_aileron
Definition fixed_wing_dynamics.h:111
real_t Cm0
Definition fixed_wing_dynamics.h:91
real_t Cm_q
Definition fixed_wing_dynamics.h:91
real_t Cl0
Definition fixed_wing_dynamics.h:97
real_t CY_da
Definition fixed_wing_dynamics.h:96
real_t brake_friction
at full brake
Definition fixed_wing_dynamics.h:123
real_t side_friction
Definition fixed_wing_dynamics.h:124
real_t CL0
Definition fixed_wing_dynamics.h:89
real_t Cn_beta
Definition fixed_wing_dynamics.h:98
static FixedWingParameters aerosonde()
The Aerosonde of Beard and McLain, Small Unmanned Aircraft, 2nd edition, with a tricycle landing gear...
Definition fixed_wing_dynamics.h:130
real_t CY_p
Definition fixed_wing_dynamics.h:96
real_t max_elevator
Definition fixed_wing_dynamics.h:110
real_t b
the wing span [m]
Definition fixed_wing_dynamics.h:83
real_t Cl_r
Definition fixed_wing_dynamics.h:97
real_t CL_alpha
Definition fixed_wing_dynamics.h:89
real_t Cn_p
Definition fixed_wing_dynamics.h:98
real_t CQ1
Definition fixed_wing_dynamics.h:107
real_t Jy
[kg m^2]
Definition fixed_wing_dynamics.h:77
real_t CT2
thrust coefficient in the advance ratio
Definition fixed_wing_dynamics.h:106
real_t max_throttle
the throttle is in [0, max_throttle]
Definition fixed_wing_dynamics.h:113
real_t Cn_da
Definition fixed_wing_dynamics.h:98
A wheel of the landing gear: a spring and damper along the body z axis, that rolls along its heading ...
Definition fixed_wing_dynamics.h:60
bool brakes
the main wheels brake
Definition fixed_wing_dynamics.h:65
bool steers
the nose wheel turns with the rudder
Definition fixed_wing_dynamics.h:64
std::array< real_t, 3 > position
where it touches the ground, in the body frame [m]
Definition fixed_wing_dynamics.h:61
real_t stiffness
[N/m]
Definition fixed_wing_dynamics.h:62
real_t damping
[N s/m]
Definition fixed_wing_dynamics.h:63