#include <FDM/LaRCsim/ls_generic.h>
#include <FDM/LaRCsim/ls_interface.h>
#include <FDM/LaRCsimIC.hxx>
+#include <FDM/UIUCModel/uiuc_aircraft.h>
#include "IO360.hxx"
#include "LaRCsim.hxx"
ls_toplevel_init( 0.0, (char *)(aircraft->getStringValue().c_str()) );
lsic=new LaRCsimIC; //this needs to be brought up after LaRCsim is
- copy_to_LaRCsim(); // initialize all of LaRCsim's vars
-
- //this should go away someday -- formerly done in fg_init.cxx
- Mass = 8.547270E+01;
- I_xx = 1.048000E+03;
- I_yy = 3.000000E+03;
- I_zz = 3.530000E+03;
- I_xz = 0.000000E+00;
+ if ( aircraft->getStringValue() == "c172" ) {
+ copy_to_LaRCsim(); // initialize all of LaRCsim's vars
+
+ //this should go away someday -- formerly done in fg_init.cxx
+ Mass = 8.547270E+01;
+ I_xx = 1.048000E+03;
+ I_yy = 3.000000E+03;
+ I_zz = 3.530000E+03;
+ I_xz = 0.000000E+00;
+ }
ls_set_model_dt( get_delta_t() );
_set_Climb_Rate( -1 * V_down );
// cout << "climb rate = " << -V_down * 60 << endl;
+
+ if ( aircraft->getStringValue() == "uiuc" ) {
+ if (pilot_elev_no) {
+ globals->get_controls()->set_elevator(Long_control);
+ globals->get_controls()->set_elevator_trim(Long_trim);
+ // controls.set_elevator(Long_control);
+ // controls.set_elevator_trim(Long_trim);
+ }
+ if (pilot_ail_no) {
+ globals->get_controls()->set_aileron(Lat_control);
+ // controls.set_aileron(Lat_control);
+ }
+ if (pilot_rud_no) {
+ globals->get_controls()->set_rudder(Rudder_pedal);
+ // controls.set_rudder(Rudder_pedal);
+ }
+ if (Throttle_pct_input) {
+ globals->get_controls()->set_throttle(0,Throttle_pct);
+ // controls.set_throttle(0,Throttle_pct);
+ }
+ }
+
return true;
}
CURRENT RCS HEADER INFO:
$Header$
$Log$
+Revision 1.4 2001/09/14 18:47:27 curt
+More changes in support of UIUCModel.
+
Revision 1.3 2000/10/28 14:30:33 curt
Updates by Tony working on the FDM interface bus.
uiuc_aero( dt, Initialize );
uiuc_engine( dt, Initialize );
uiuc_gear( dt, Initialize );
+ uiuc_record(dt);
break;
}
}
$Header$
$Log$
+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.
--------------------------------------------------------------------------*/
+#include <FDM/UIUCModel/uiuc_wrapper.h>
+
#include "ls_types.h"
#include "ls_constants.h"
#include "ls_generic.h"
/* #include "ls_sim_control.h" */
#include <math.h>
+Model current_model;
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;
V_east = V_east + local_gnd_veast;
/* Initialize quaternions and transformation matrix from Euler angles */
+ if (current_model == UIUC && Simtime == 0) {
+ uiuc_init_vars();
+ }
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);
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();
+ }
+
/* Calculate local gravitation acceleration */
ls_gravity( Radius_to_vehicle, Lat_geocentric, &Gravity );
DATE PURPOSE BY
3/17/00 Initial test release
3/09/01 Added callout to UIUC gear function. (DPM)
-
+ 6/18/01 Added call out to UIUC record routine (RD)
----------------------------------------------------------------------------
{
uiuc_gear_routine();
}
+
+void uiuc_record(SCALAR dt)
+{
+ uiuc_record_routine(dt);
+}
#include "uiuc_menu.h"
#include "uiuc_betaprobe.h"
#include <FDM/LaRCsim/ls_generic.h>
-#include "Main/simple_udp.h"
+// #include "Main/simple_udp.h"
#include "uiuc_fog.h" //321654
#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS)
AIRCRAFT *aircraft_ = new AIRCRAFT;
AIRCRAFTDIR *aircraftdir_ = new AIRCRAFTDIR;
-SendArray testarray(4950);
+// SendArray testarray(4950);
/* Convert float to string */
string ftoa(double in)
input += " altitude " + ftoa(Altitude);
input += " climb_rate " + ftoa(-1.0*V_down_rel_ground);
- testarray.getHello();
- testarray.sendData(input);
+ // testarray.getHello();
+ // testarray.sendData(input);
/* End of Networking */