Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
#include "nps_fdm.h"
#include <stdlib.h>
#include <stdio.h>
#include "std.h"
#include "math/pprz_geodetic.h"
#include "math/pprz_geodetic_double.h"
#include "math/pprz_geodetic_float.h"
#include "math/pprz_algebra.h"
#include "math/pprz_algebra_float.h"
#include "math/pprz_isa.h"
#include "generated/airframe.h"
#include "generated/flight_plan.h"
#include "state.h"
Go to the source code of this file.
Data Structures | |
struct | fixedwing_sim_state |
Macros | |
#define | ROLL_RESPONSE_FACTOR 15. |
#define | PITCH_RESPONSE_FACTOR 1. |
#define | YAW_RESPONSE_FACTOR 1. |
#define | WEIGHT 1. |
#define | ROLL_MAX_SETPOINT RadOfDeg(40.) |
#define | ROLL_RATE_MAX_SETPOINT RadOfDeg(15.) |
#define | MAXIMUM_AIRSPEED (NOMINAL_AIRSPEED * 1.5) |
#define | MAXIMUM_POWER (5. * MAXIMUM_AIRSPEED * WEIGHT) |
#define | AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE 0.45 |
Functions | |
static void | init_ltp (void) |
void | nps_fdm_init (double dt) |
NPS FDM rover init. More... | |
void | nps_fdm_run_step (bool launch, double *commands, int commands_nb) |
Minimum complexity flight dynamic model In legacy Paparazzi simulator, was implemented in OCaml and correspond to the 'sim' target. More... | |
void | nps_fdm_set_wind (double speed, double dir) |
void | nps_fdm_set_wind_ned (double wind_north, double wind_east, double wind_down) |
void | nps_fdm_set_turbulence (double wind_speed, int turbulence_severity) |
void | nps_fdm_set_temperature (double temp, double h) |
Set temperature in degrees Celcius at given height h above MSL. More... | |
Variables | |
struct NpsFdm | fdm |
static struct LtpDef_d | ltpdef |
static struct fixedwing_sim_state | sim_state |
struct fixedwing_sim_state |
Definition at line 93 of file nps_fdm_fixedwing_sim.c.
Data Fields | ||
---|---|---|
double | airspeed | |
struct DoubleEulers | attitude | |
double | delta_pitch | |
double | delta_roll | |
double | delta_thrust | |
struct EnuCoor_d | pos | |
struct DoubleEulers | rates | |
struct EnuCoor_d | speed | |
struct EnuCoor_d | wind |
#define AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE 0.45 |
Definition at line 81 of file nps_fdm_fixedwing_sim.c.
#define MAXIMUM_AIRSPEED (NOMINAL_AIRSPEED * 1.5) |
Definition at line 73 of file nps_fdm_fixedwing_sim.c.
#define MAXIMUM_POWER (5. * MAXIMUM_AIRSPEED * WEIGHT) |
Definition at line 77 of file nps_fdm_fixedwing_sim.c.
#define PITCH_RESPONSE_FACTOR 1. |
Definition at line 49 of file nps_fdm_fixedwing_sim.c.
#define ROLL_MAX_SETPOINT RadOfDeg(40.) |
Definition at line 61 of file nps_fdm_fixedwing_sim.c.
#define ROLL_RATE_MAX_SETPOINT RadOfDeg(15.) |
Definition at line 65 of file nps_fdm_fixedwing_sim.c.
#define ROLL_RESPONSE_FACTOR 15. |
Definition at line 45 of file nps_fdm_fixedwing_sim.c.
#define WEIGHT 1. |
Definition at line 57 of file nps_fdm_fixedwing_sim.c.
#define YAW_RESPONSE_FACTOR 1. |
Definition at line 53 of file nps_fdm_fixedwing_sim.c.
|
static |
Definition at line 259 of file nps_fdm_fixedwing_sim.c.
References LlaCoor_d::alt, ecef_of_lla_d(), NpsFdm::ecef_pos, fdm, LlaCoor_d::lat, LlaCoor_d::lon, ltp_def_from_ecef_d(), NpsFdm::ltp_g, NpsFdm::ltp_h, ltpdef, DoubleVect3::x, DoubleVect3::y, and DoubleVect3::z.
Referenced by nps_fdm_init().
void nps_fdm_init | ( | double | dt | ) |
NPS FDM rover init.
Definition at line 109 of file nps_fdm_fixedwing_sim.c.
References fixedwing_sim_state::airspeed, fixedwing_sim_state::attitude, NpsFdm::curr_dt, fixedwing_sim_state::delta_pitch, fixedwing_sim_state::delta_roll, fixedwing_sim_state::delta_thrust, NpsFdm::dynamic_pressure, EULERS_ASSIGN, fdm, NpsFdm::init_dt, init_ltp(), NpsFdm::ltpprz_to_body_eulers, NpsFdm::nan_count, NpsFdm::on_ground, DoubleEulers::phi, fixedwing_sim_state::pos, PPRZ_ISA_SEA_LEVEL_PRESSURE, NpsFdm::pressure, NpsFdm::pressure_sl, DoubleEulers::psi, fixedwing_sim_state::rates, sim_state, fixedwing_sim_state::speed, NpsFdm::temperature, DoubleEulers::theta, NpsFdm::time, NpsFdm::total_pressure, TRUE, VECT3_ASSIGN, and fixedwing_sim_state::wind.
void nps_fdm_run_step | ( | bool | launch, |
double * | commands, | ||
int | commands_nb | ||
) |
Minimum complexity flight dynamic model In legacy Paparazzi simulator, was implemented in OCaml and correspond to the 'sim' target.
Johnson, E.N., Fontaine, S.G., and Kahn, A.D., “Minimum Complexity Uninhabited Air Vehicle Guidance And Flight Control System,” Proceedings of the 20th Digital Avionics Systems Conference, 2001. http://www.ae.gatech.edu/~ejohnson/JohnsonFontaineKahn.pdf
Johnson, E.N. and Fontaine, S.G., “Use Of Flight Simulation To Complement Flight Testing Of Low-Cost UAVs,” Proceedings of the AIAA Modeling and Simulation Technology Conference, 2001. http://www.ae.gatech.edu/~ejohnson/AIAA%202001-4059.pdf
Definition at line 156 of file nps_fdm_fixedwing_sim.c.
References NpsFdm::agl, fixedwing_sim_state::airspeed, alpha, fixedwing_sim_state::attitude, AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE, NpsFdm::body_ecef_rotvel, commands, NpsFdm::curr_dt, fixedwing_sim_state::delta_pitch, fixedwing_sim_state::delta_roll, fixedwing_sim_state::delta_thrust, double_quat_of_eulers(), NpsFdm::ecef_ecef_accel, NpsFdm::ecef_ecef_vel, ecef_of_enu_point_d(), ecef_of_enu_vect_d(), NpsFdm::ecef_pos, fdm, NpsFdm::hmsl, lla_of_ecef_d(), NpsFdm::lla_pos, NpsFdm::ltp_to_body_eulers, NpsFdm::ltp_to_body_quat, ltpdef, NpsFdm::ltpprz_ecef_accel, NpsFdm::ltpprz_ecef_vel, NpsFdm::ltpprz_pos, MAX_PPRZ, MAXIMUM_AIRSPEED, MAXIMUM_POWER, ned_of_ecef_point_d(), ned_of_ecef_vect_d(), DoubleRates::p, DoubleEulers::phi, PITCH_RESPONSE_FACTOR, fixedwing_sim_state::pos, PPRZ_ISA_GRAVITY, DoubleEulers::psi, DoubleRates::q, DoubleRates::r, fixedwing_sim_state::rates, ROLL_MAX_SETPOINT, ROLL_RATE_MAX_SETPOINT, ROLL_RESPONSE_FACTOR, sim_state, fixedwing_sim_state::speed, DoubleEulers::theta, v2, WEIGHT, fixedwing_sim_state::wind, EnuCoor_d::x, EnuCoor_d::y, YAW_RESPONSE_FACTOR, NedCoor_d::z, and EnuCoor_d::z.
void nps_fdm_set_temperature | ( | double | temp, |
double | h | ||
) |
Set temperature in degrees Celcius at given height h above MSL.
Definition at line 306 of file nps_fdm_fixedwing_sim.c.
void nps_fdm_set_turbulence | ( | double | wind_speed, |
int | turbulence_severity | ||
) |
Definition at line 301 of file nps_fdm_fixedwing_sim.c.
void nps_fdm_set_wind | ( | double | speed, |
double | dir | ||
) |
Definition at line 287 of file nps_fdm_fixedwing_sim.c.
References dir, sim_state, fixedwing_sim_state::wind, EnuCoor_d::x, EnuCoor_d::y, and EnuCoor_d::z.
void nps_fdm_set_wind_ned | ( | double | wind_north, |
double | wind_east, | ||
double | wind_down | ||
) |
Definition at line 294 of file nps_fdm_fixedwing_sim.c.
References sim_state, fixedwing_sim_state::wind, EnuCoor_d::x, EnuCoor_d::y, and EnuCoor_d::z.
struct NpsFdm fdm |
Definition at line 1 of file nps_fdm_fixedwing_sim.c.
Referenced by init_ltp(), nps_fdm_init(), and nps_fdm_run_step().
|
static |
Definition at line 1 of file nps_fdm_fixedwing_sim.c.
Referenced by init_ltp(), and nps_fdm_run_step().
|
static |
Definition at line 91 of file nps_fdm_fixedwing_sim.c.
Referenced by nps_fdm_init(), nps_fdm_run_step(), nps_fdm_set_wind(), and nps_fdm_set_wind_ned().