X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FFDM%2FLaRCsim%2Fls_step.c;h=3927425cd07df99c2296f0372c5c4751fd6f618c;hb=e1d5a52a3a535007d4249aeba84fc645158997a7;hp=622199f2898a2b1beacf5513d29d3452c2201944;hpb=f8c24745b6fe927c74c8ef4fe0442d43c335cc8b;p=flightgear.git diff --git a/src/FDM/LaRCsim/ls_step.c b/src/FDM/LaRCsim/ls_step.c index 622199f28..3927425cd 100644 --- a/src/FDM/LaRCsim/ls_step.c +++ b/src/FDM/LaRCsim/ls_step.c @@ -50,8 +50,21 @@ $Header$ $Log$ -Revision 1.1 2002/09/10 01:14:02 curt -Initial revision +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. @@ -284,7 +297,7 @@ Initial Flight Gear revision. --------------------------------------------------------------------------*/ -#include +//#include #include "ls_types.h" #include "ls_constants.h" @@ -298,7 +311,7 @@ Initial Flight Gear revision. /* #include "ls_sim_control.h" */ #include -Model current_model; +extern Model current_model; /* defined in ls_model.c */ extern SCALAR Simtime; /* defined in ls_main.c */ void uiuc_init_vars() { @@ -351,8 +364,9 @@ void ls_step( SCALAR dt, int Initialize ) { V_east = V_east + local_gnd_veast; /* Initialize quaternions and transformation matrix from Euler angles */ - if (current_model == UIUC && Simtime == 0) { - uiuc_init_vars(); + // 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) @@ -373,9 +387,11 @@ 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; - if (current_model == UIUC && Simtime == 0) { - uiuc_vel_init(); - } + // 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 */ @@ -393,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 */