X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FFDM%2FLaRCsim%2Fls_step.c;h=3927425cd07df99c2296f0372c5c4751fd6f618c;hb=e1d5a52a3a535007d4249aeba84fc645158997a7;hp=053199ab222c5d05d050fb29bdb25e71725b555e;hpb=182fd42b4017fa54d680508c092ea1b216398a00;p=flightgear.git diff --git a/src/FDM/LaRCsim/ls_step.c b/src/FDM/LaRCsim/ls_step.c index 053199ab2..3927425cd 100644 --- a/src/FDM/LaRCsim/ls_step.c +++ b/src/FDM/LaRCsim/ls_step.c @@ -50,6 +50,25 @@ $Header$ $Log$ +Revision 1.5 2003/07/25 17:53:47 mselig +UIUC code initilization mods to tidy things up a bit. + +Revision 1.4 2003/06/20 19:53:56 ehofman +Get rid of a multiple defined symbol warning" src/FDM/LaRCsim/ls_step.c +" + +Revision 1.3 2003/06/09 02:50:23 mselig +mods made to setup for some initializations in uiuc code + +Revision 1.2 2003/05/25 12:14:46 ehofman +Rename some defines to prevent a namespace clash + +Revision 1.1.1.1 2002/09/10 01:14:02 curt +Initial revision of FlightGear-0.9.0 + +Revision 1.5 2001/09/14 18:47:27 curt +More changes in support of UIUCModel. + Revision 1.4 2001/03/24 05:03:12 curt SG-ified logstream. @@ -278,6 +297,8 @@ Initial Flight Gear revision. --------------------------------------------------------------------------*/ +//#include + #include "ls_types.h" #include "ls_constants.h" #include "ls_generic.h" @@ -290,8 +311,21 @@ Initial Flight Gear revision. /* #include "ls_sim_control.h" */ #include +extern Model current_model; /* defined in ls_model.c */ extern SCALAR Simtime; /* defined in ls_main.c */ +void uiuc_init_vars() { + static int init = 0; + + if (init==0) { + init=-1; + uiuc_init_aeromodel(); + } + + uiuc_initial_init(); +} + + void ls_step( SCALAR dt, int Initialize ) { static int inited = 0; SCALAR dth; @@ -330,6 +364,10 @@ void ls_step( SCALAR dt, int Initialize ) { V_east = V_east + local_gnd_veast; /* Initialize quaternions and transformation matrix from Euler angles */ + // Initialize UIUC aircraft model + if (current_model == UIUC) { + uiuc_init_2_wrapper(); + } e_0 = cos(Psi*0.5)*cos(Theta*0.5)*cos(Phi*0.5) + sin(Psi*0.5)*sin(Theta*0.5)*sin(Phi*0.5); @@ -349,6 +387,12 @@ void ls_step( SCALAR dt, int Initialize ) { T_local_to_body_32 = 2*(e_2*e_3 - e_0*e_1); T_local_to_body_33 = e_0*e_0 - e_1*e_1 - e_2*e_2 + e_3*e_3; + // Initialize local velocities (V_north, V_east, V_down) + // based on transformation matrix calculated above + if (current_model == UIUC) { + uiuc_local_vel_init(); + } + /* Calculate local gravitation acceleration */ ls_gravity( Radius_to_vehicle, Lat_geocentric, &Gravity ); @@ -365,8 +409,8 @@ void ls_step( SCALAR dt, int Initialize ) { /* Initialize auxiliary variables */ ls_aux(); - Alpha_dot = 0.; - Beta_dot = 0.; + Std_Alpha_dot = 0.; + Std_Beta_dot = 0.; /* set flag; disable integrators */