Paparazzi UAS  v6.2_unstable
Paparazzi is a free software Unmanned Aircraft System.
nps_fdm_rover.c File Reference
#include "nps_fdm.h"
#include <stdlib.h>
#include <stdio.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 "firmwares/rover/guidance/rover_guidance_steering.h"
#include "state.h"
+ Include dependency graph for nps_fdm_rover.c:

Go to the source code of this file.

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)
 Update the simulation state. 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
 Holds all necessary NPS FDM state information. More...
 
static struct LtpDef_d ltpdef
 
static struct EnuCoor_d rover_pos
 Physical model structures. More...
 
static struct EnuCoor_d rover_vel
 
static struct EnuCoor_d rover_acc
 
static float mu = 0.01
 Physical model parameters. More...
 

Function Documentation

◆ init_ltp()

static void init_ltp ( void  )
static

Definition at line 166 of file nps_fdm_rover.c.

References 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, PRINT_CONFIG_MSG(), DoubleVect3::x, DoubleVect3::y, and DoubleVect3::z.

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.

Initialize actuator dynamics, set unused fields in fdm.

Definition at line 64 of file nps_fdm_rover.c.

References NpsFdm::curr_dt, NpsFdm::dynamic_pressure, fdm, NpsFdm::init_dt, init_ltp(), NpsFdm::ltpprz_to_body_eulers, NpsFdm::nan_count, NpsFdm::on_ground, PPRZ_ISA_SEA_LEVEL_PRESSURE, NpsFdm::pressure, NpsFdm::pressure_sl, DoubleEulers::psi, NpsFdm::temperature, NpsFdm::time, NpsFdm::total_pressure, and TRUE.

Referenced by nps_main_init().

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

◆ nps_fdm_run_step()

◆ 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 217 of file nps_fdm_rover.c.

◆ nps_fdm_set_turbulence()

void nps_fdm_set_turbulence ( double  wind_speed,
int  turbulence_severity 
)

Definition at line 212 of file nps_fdm_rover.c.

Referenced by nps_atmosphere_update().

+ Here is the caller graph for this function:

◆ nps_fdm_set_wind()

void nps_fdm_set_wind ( double  speed,
double  dir 
)

Definition at line 201 of file nps_fdm_rover.c.

◆ nps_fdm_set_wind_ned()

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

Definition at line 206 of file nps_fdm_rover.c.

Referenced by nps_atmosphere_update().

+ Here is the caller graph for this function:

Variable Documentation

◆ fdm

◆ ltpdef

struct LtpDef_d ltpdef
static

Definition at line 49 of file nps_fdm_rover.c.

Referenced by init_ltp(), and nps_fdm_run_step().

◆ mu

float mu = 0.01
static

Physical model parameters.

Definition at line 60 of file nps_fdm_rover.c.

Referenced by calc_g1_element(), calc_g2_element(), find_contour(), and nps_fdm_run_step().

◆ rover_acc

struct EnuCoor_d rover_acc
static

Definition at line 57 of file nps_fdm_rover.c.

Referenced by nps_fdm_run_step().

◆ rover_pos

struct EnuCoor_d rover_pos
static

Physical model structures.

Definition at line 55 of file nps_fdm_rover.c.

Referenced by nps_fdm_run_step().

◆ rover_vel

struct EnuCoor_d rover_vel
static

Definition at line 56 of file nps_fdm_rover.c.

Referenced by nps_fdm_run_step().