More changes in support of UIUCModel.
This commit is contained in:
parent
19e7e93787
commit
bfc56f9d17
5 changed files with 71 additions and 12 deletions
|
@ -34,6 +34,7 @@
|
||||||
#include <FDM/LaRCsim/ls_generic.h>
|
#include <FDM/LaRCsim/ls_generic.h>
|
||||||
#include <FDM/LaRCsim/ls_interface.h>
|
#include <FDM/LaRCsim/ls_interface.h>
|
||||||
#include <FDM/LaRCsimIC.hxx>
|
#include <FDM/LaRCsimIC.hxx>
|
||||||
|
#include <FDM/UIUCModel/uiuc_aircraft.h>
|
||||||
|
|
||||||
#include "IO360.hxx"
|
#include "IO360.hxx"
|
||||||
#include "LaRCsim.hxx"
|
#include "LaRCsim.hxx"
|
||||||
|
@ -47,14 +48,16 @@ FGLaRCsim::FGLaRCsim( double dt ) {
|
||||||
ls_toplevel_init( 0.0, (char *)(aircraft->getStringValue().c_str()) );
|
ls_toplevel_init( 0.0, (char *)(aircraft->getStringValue().c_str()) );
|
||||||
|
|
||||||
lsic=new LaRCsimIC; //this needs to be brought up after LaRCsim is
|
lsic=new LaRCsimIC; //this needs to be brought up after LaRCsim is
|
||||||
copy_to_LaRCsim(); // initialize all of LaRCsim's vars
|
if ( aircraft->getStringValue() == "c172" ) {
|
||||||
|
copy_to_LaRCsim(); // initialize all of LaRCsim's vars
|
||||||
|
|
||||||
//this should go away someday -- formerly done in fg_init.cxx
|
//this should go away someday -- formerly done in fg_init.cxx
|
||||||
Mass = 8.547270E+01;
|
Mass = 8.547270E+01;
|
||||||
I_xx = 1.048000E+03;
|
I_xx = 1.048000E+03;
|
||||||
I_yy = 3.000000E+03;
|
I_yy = 3.000000E+03;
|
||||||
I_zz = 3.530000E+03;
|
I_zz = 3.530000E+03;
|
||||||
I_xz = 0.000000E+00;
|
I_xz = 0.000000E+00;
|
||||||
|
}
|
||||||
|
|
||||||
ls_set_model_dt( get_delta_t() );
|
ls_set_model_dt( get_delta_t() );
|
||||||
|
|
||||||
|
@ -537,6 +540,28 @@ bool FGLaRCsim::copy_from_LaRCsim() {
|
||||||
|
|
||||||
_set_Climb_Rate( -1 * V_down );
|
_set_Climb_Rate( -1 * V_down );
|
||||||
// cout << "climb rate = " << -V_down * 60 << endl;
|
// 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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,9 @@
|
||||||
CURRENT RCS HEADER INFO:
|
CURRENT RCS HEADER INFO:
|
||||||
$Header$
|
$Header$
|
||||||
$Log$
|
$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
|
Revision 1.3 2000/10/28 14:30:33 curt
|
||||||
Updates by Tony working on the FDM interface bus.
|
Updates by Tony working on the FDM interface bus.
|
||||||
|
|
||||||
|
@ -142,6 +145,7 @@ void ls_model( SCALAR dt, int Initialize ) {
|
||||||
uiuc_aero( dt, Initialize );
|
uiuc_aero( dt, Initialize );
|
||||||
uiuc_engine( dt, Initialize );
|
uiuc_engine( dt, Initialize );
|
||||||
uiuc_gear( dt, Initialize );
|
uiuc_gear( dt, Initialize );
|
||||||
|
uiuc_record(dt);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,6 +50,9 @@
|
||||||
|
|
||||||
$Header$
|
$Header$
|
||||||
$Log$
|
$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
|
Revision 1.4 2001/03/24 05:03:12 curt
|
||||||
SG-ified logstream.
|
SG-ified logstream.
|
||||||
|
|
||||||
|
@ -278,6 +281,8 @@ Initial Flight Gear revision.
|
||||||
|
|
||||||
--------------------------------------------------------------------------*/
|
--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include <FDM/UIUCModel/uiuc_wrapper.h>
|
||||||
|
|
||||||
#include "ls_types.h"
|
#include "ls_types.h"
|
||||||
#include "ls_constants.h"
|
#include "ls_constants.h"
|
||||||
#include "ls_generic.h"
|
#include "ls_generic.h"
|
||||||
|
@ -290,8 +295,21 @@ Initial Flight Gear revision.
|
||||||
/* #include "ls_sim_control.h" */
|
/* #include "ls_sim_control.h" */
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
|
Model current_model;
|
||||||
extern SCALAR Simtime; /* defined in ls_main.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 ) {
|
void ls_step( SCALAR dt, int Initialize ) {
|
||||||
static int inited = 0;
|
static int inited = 0;
|
||||||
SCALAR dth;
|
SCALAR dth;
|
||||||
|
@ -330,6 +348,9 @@ void ls_step( SCALAR dt, int Initialize ) {
|
||||||
V_east = V_east + local_gnd_veast;
|
V_east = V_east + local_gnd_veast;
|
||||||
|
|
||||||
/* Initialize quaternions and transformation matrix from Euler angles */
|
/* 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)
|
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);
|
+ sin(Psi*0.5)*sin(Theta*0.5)*sin(Phi*0.5);
|
||||||
|
@ -349,6 +370,10 @@ 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_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;
|
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 */
|
/* Calculate local gravitation acceleration */
|
||||||
|
|
||||||
ls_gravity( Radius_to_vehicle, Lat_geocentric, &Gravity );
|
ls_gravity( Radius_to_vehicle, Lat_geocentric, &Gravity );
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
DATE PURPOSE BY
|
DATE PURPOSE BY
|
||||||
3/17/00 Initial test release
|
3/17/00 Initial test release
|
||||||
3/09/01 Added callout to UIUC gear function. (DPM)
|
3/09/01 Added callout to UIUC gear function. (DPM)
|
||||||
|
6/18/01 Added call out to UIUC record routine (RD)
|
||||||
|
|
||||||
----------------------------------------------------------------------------
|
----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -82,3 +82,8 @@ void uiuc_gear ()
|
||||||
{
|
{
|
||||||
uiuc_gear_routine();
|
uiuc_gear_routine();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void uiuc_record(SCALAR dt)
|
||||||
|
{
|
||||||
|
uiuc_record_routine(dt);
|
||||||
|
}
|
||||||
|
|
|
@ -90,7 +90,7 @@
|
||||||
#include "uiuc_menu.h"
|
#include "uiuc_menu.h"
|
||||||
#include "uiuc_betaprobe.h"
|
#include "uiuc_betaprobe.h"
|
||||||
#include <FDM/LaRCsim/ls_generic.h>
|
#include <FDM/LaRCsim/ls_generic.h>
|
||||||
#include "Main/simple_udp.h"
|
// #include "Main/simple_udp.h"
|
||||||
#include "uiuc_fog.h" //321654
|
#include "uiuc_fog.h" //321654
|
||||||
|
|
||||||
#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS)
|
#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS)
|
||||||
|
@ -109,7 +109,7 @@ extern "C" void uiuc_initial_init ();
|
||||||
AIRCRAFT *aircraft_ = new AIRCRAFT;
|
AIRCRAFT *aircraft_ = new AIRCRAFT;
|
||||||
AIRCRAFTDIR *aircraftdir_ = new AIRCRAFTDIR;
|
AIRCRAFTDIR *aircraftdir_ = new AIRCRAFTDIR;
|
||||||
|
|
||||||
SendArray testarray(4950);
|
// SendArray testarray(4950);
|
||||||
|
|
||||||
/* Convert float to string */
|
/* Convert float to string */
|
||||||
string ftoa(double in)
|
string ftoa(double in)
|
||||||
|
@ -257,8 +257,8 @@ void uiuc_force_moment(double dt)
|
||||||
input += " altitude " + ftoa(Altitude);
|
input += " altitude " + ftoa(Altitude);
|
||||||
input += " climb_rate " + ftoa(-1.0*V_down_rel_ground);
|
input += " climb_rate " + ftoa(-1.0*V_down_rel_ground);
|
||||||
|
|
||||||
testarray.getHello();
|
// testarray.getHello();
|
||||||
testarray.sendData(input);
|
// testarray.sendData(input);
|
||||||
|
|
||||||
/* End of Networking */
|
/* End of Networking */
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue