Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
nps_fdm_fixedwing_sim.c File Reference
#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"
Include dependency graph for nps_fdm_fixedwing_sim.c:

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.
void nps_fdm_run_init_step (void)
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.
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.

Variables

struct NpsFdm fdm
static struct LtpDef_d ltpdef
static struct fixedwing_sim_state sim_state

Data Structure Documentation

◆ fixedwing_sim_state

struct fixedwing_sim_state

Definition at line 93 of file nps_fdm_fixedwing_sim.c.

Collaboration diagram for fixedwing_sim_state:
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

Macro Definition Documentation

◆ AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE

#define AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE   0.45

Definition at line 81 of file nps_fdm_fixedwing_sim.c.

Referenced by nps_fdm_run_step().

◆ MAXIMUM_AIRSPEED

#define MAXIMUM_AIRSPEED   (NOMINAL_AIRSPEED * 1.5)

Definition at line 73 of file nps_fdm_fixedwing_sim.c.

Referenced by nps_fdm_run_step().

◆ MAXIMUM_POWER

#define MAXIMUM_POWER   (5. * MAXIMUM_AIRSPEED * WEIGHT)

Definition at line 77 of file nps_fdm_fixedwing_sim.c.

Referenced by nps_fdm_run_step().

◆ PITCH_RESPONSE_FACTOR

#define PITCH_RESPONSE_FACTOR   1.

Definition at line 49 of file nps_fdm_fixedwing_sim.c.

Referenced by nps_fdm_run_step().

◆ ROLL_MAX_SETPOINT

#define ROLL_MAX_SETPOINT   RadOfDeg(40.)

Definition at line 61 of file nps_fdm_fixedwing_sim.c.

Referenced by nps_fdm_run_step().

◆ ROLL_RATE_MAX_SETPOINT

#define ROLL_RATE_MAX_SETPOINT   RadOfDeg(15.)

Definition at line 65 of file nps_fdm_fixedwing_sim.c.

Referenced by nps_fdm_run_step().

◆ ROLL_RESPONSE_FACTOR

#define ROLL_RESPONSE_FACTOR   15.

Definition at line 45 of file nps_fdm_fixedwing_sim.c.

Referenced by nps_fdm_run_step().

◆ WEIGHT

#define WEIGHT   1.

Definition at line 57 of file nps_fdm_fixedwing_sim.c.

Referenced by nps_fdm_run_step().

◆ YAW_RESPONSE_FACTOR

#define YAW_RESPONSE_FACTOR   1.

Definition at line 53 of file nps_fdm_fixedwing_sim.c.

Referenced by nps_fdm_run_step().

Function Documentation

◆ init_ltp()

void init_ltp ( void )
static

Definition at line 264 of file nps_fdm_fixedwing_sim.c.

References LlaCoor_d::alt, ecef_of_lla_d(), fdm, LlaCoor_d::lat, LlaCoor_d::lon, ltp_def_from_ecef_d(), and ltpdef.

Referenced by nps_fdm_init().

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

◆ nps_fdm_init()

void nps_fdm_init ( double dt)

NPS FDM rover init.

Definition at line 109 of file nps_fdm_fixedwing_sim.c.

◆ nps_fdm_run_init_step()

void nps_fdm_run_init_step ( void )

Definition at line 142 of file nps_fdm_fixedwing_sim.c.

◆ nps_fdm_run_step()

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 161 of file nps_fdm_fixedwing_sim.c.

◆ nps_fdm_set_temperature()

void nps_fdm_set_temperature ( double temp,
double h )

Set temperature in degrees Celcius at given height h above MSL.

Definition at line 311 of file nps_fdm_fixedwing_sim.c.

◆ nps_fdm_set_turbulence()

void nps_fdm_set_turbulence ( double wind_speed,
int turbulence_severity )

Definition at line 306 of file nps_fdm_fixedwing_sim.c.

◆ nps_fdm_set_wind()

void nps_fdm_set_wind ( double speed,
double dir )

Definition at line 292 of file nps_fdm_fixedwing_sim.c.

◆ nps_fdm_set_wind_ned()

void nps_fdm_set_wind_ned ( double wind_north,
double wind_east,
double wind_down )

Definition at line 299 of file nps_fdm_fixedwing_sim.c.

Variable Documentation

◆ fdm

struct NpsFdm fdm

Definition at line 85 of file nps_fdm_fixedwing_sim.c.

◆ ltpdef

struct LtpDef_d ltpdef
static

◆ sim_state

struct fixedwing_sim_state sim_state
static