From d3db1e622ba5d4bd5517bca70f868da8f2e91cd6 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 1 Feb 2002 02:11:13 +0000 Subject: [PATCH] Latest JSBSim changes, including SGI patch. --- src/FDM/JSBSim/FGGroundReactions.cpp | 18 +- src/FDM/JSBSim/FGJSBBase.h | 1 + src/FDM/JSBSim/FGLGear.cpp | 7 +- src/FDM/JSBSim/FGLGear.h | 14 +- src/FDM/JSBSim/FGTable.cpp | 5 + src/FDM/JSBSim/FGTranslation.cpp | 3 +- src/FDM/JSBSim/JSBSim.cpp | 523 ++++++++++++++++++--------- 7 files changed, 379 insertions(+), 192 deletions(-) diff --git a/src/FDM/JSBSim/FGGroundReactions.cpp b/src/FDM/JSBSim/FGGroundReactions.cpp index 3f133eeac..dde442afd 100644 --- a/src/FDM/JSBSim/FGGroundReactions.cpp +++ b/src/FDM/JSBSim/FGGroundReactions.cpp @@ -116,9 +116,14 @@ string FGGroundReactions::GetGroundReactionStrings(void) for (unsigned int i=0;iGetXYZcg()) / 12.0; vWhlBodyVec(eX) = -vWhlBodyVec(eX); diff --git a/src/FDM/JSBSim/FGLGear.h b/src/FDM/JSBSim/FGLGear.h index 1c4857b16..84520b5e7 100644 --- a/src/FDM/JSBSim/FGLGear.h +++ b/src/FDM/JSBSim/FGLGear.h @@ -232,9 +232,14 @@ public: inline int GetBrakeGroup(void) { return (int)eBrakeGrp; } inline int GetSteerType(void) { return (int)eSteerType; } - inline bool GetRetractable(void) { return isRetractable; } - inline bool GetGearUnitUp(void) { return GearUp; } - inline bool GetGearUnitDown(void) { return GearDown; } + inline bool GetRetractable(void) { return isRetractable; } + inline bool GetGearUnitUp(void) { return GearUp; } + inline bool GetGearUnitDown(void) { return GearDown; } + inline double GetWheelSideForce(void) { return SideForce; } + inline double GetWheelRollForce(void) { return RollingForce; } + inline double GetBodyXForce(void) { return vLocalForce(eX); } + inline double GetBodyYForce(void) { return vLocalForce(eY); } + inline double GetWheelSlipAngle(void) { return WheelSlip; } private: FGColumnVector3 vXYZ; @@ -258,6 +263,9 @@ private: double DistanceTraveled; double MaximumStrutForce; double MaximumStrutTravel; + double SideWhlVel, RollingWhlVel; + double RollingForce, SideForce, FCoeff; + double WheelSlip; bool WOW; bool lastWOW; bool FirstContact; diff --git a/src/FDM/JSBSim/FGTable.cpp b/src/FDM/JSBSim/FGTable.cpp index d9256decb..20e0fdd18 100644 --- a/src/FDM/JSBSim/FGTable.cpp +++ b/src/FDM/JSBSim/FGTable.cpp @@ -211,7 +211,12 @@ void FGTable::Print(void) if (Type == tt1D) startRow = 1; else startRow = 0; +#if defined (sgi) && !defined(__GNUC__) + unsigned long flags = cout.setf(ios::fixed); +#else ios::fmtflags flags = cout.setf(ios::fixed); // set up output stream +#endif + cout.precision(4); for (int r=startRow; r<=nRows; r++) { diff --git a/src/FDM/JSBSim/FGTranslation.cpp b/src/FDM/JSBSim/FGTranslation.cpp index fe6714dfe..9b36f81cf 100644 --- a/src/FDM/JSBSim/FGTranslation.cpp +++ b/src/FDM/JSBSim/FGTranslation.cpp @@ -116,7 +116,8 @@ bool FGTranslation::Run(void) vUVWdot = mVel*Rotation->GetPQR() + Aircraft->GetBodyAccel(); - vUVW += Tc * (vlastUVWdot + vUVWdot); + vUVW += Tc*(vUVWdot + vlastUVWdot); + vAeroUVW = vUVW + State->GetTl2b()*Atmosphere->GetWindNED(); Vt = vAeroUVW.Magnitude(); diff --git a/src/FDM/JSBSim/JSBSim.cpp b/src/FDM/JSBSim/JSBSim.cpp index e79d96fc7..cbe40ff0b 100644 --- a/src/FDM/JSBSim/JSBSim.cpp +++ b/src/FDM/JSBSim/JSBSim.cpp @@ -1,180 +1,343 @@ -/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - Module: JSBSim.cpp - Author: Jon S. Berndt - Date started: 08/17/99 - Purpose: Standalone version of JSBSim. - Called by: The USER. - - ------------- Copyright (C) 1999 Jon S. Berndt (jsb@hal-pc.org) ------------- - - This program is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any later - version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - details. - - You should have received a copy of the GNU General Public License along with - this program; if not, write to the Free Software Foundation, Inc., 59 Temple - Place - Suite 330, Boston, MA 02111-1307, USA. - - Further information about the GNU General Public License can also be found on - the world wide web at http://www.gnu.org. - -FUNCTIONAL DESCRIPTION --------------------------------------------------------------------------------- - -This class Handles calling JSBSim standalone. It is set up for compilation under -Borland C+Builder or other compiler. - -HISTORY --------------------------------------------------------------------------------- -08/17/99 JSB Created - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -INCLUDES -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ - -#include "FGFDMExec.h" -#include "FGRotation.h" -#include "FGAtmosphere.h" -#include "FGState.h" -#include "FGFCS.h" -#include "FGAircraft.h" -#include "FGTranslation.h" -#include "FGPosition.h" -#include "FGAuxiliary.h" -#include "FGOutput.h" -#include "FGConfigFile.h" -#include "FGScript.h" - -#ifdef FGFS -#include -#include STL_IOSTREAM -#else -# if defined(sgi) && !defined(__GNUC__) -# include -# else -# include -# endif -#endif - -/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -DEFINITIONS -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ - -/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -GLOBAL DATA -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ - -static const char *IdSrc = "$Id$"; - -/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs] -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ - -/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -DOCUMENTATION -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ - -/** Standalone JSBSim main program - This is the wrapper program used to instantiate the JSBSim system and control - it. Use this program to build a version of JSBSim that can be run from the - command line. To get any use out of this, you will have to create a script - to run a test case and specify what kind of output you would like. - @author Jon S. Berndt - @version $Id$ - @see - -*/ - -/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -IMPLEMENTATION -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ - -int main(int argc, char** argv) -{ - FGFDMExec* FDMExec; - bool result = false; - bool Scripted = false; - FGScript* Script; - - if (argc != 3 && argc != 2) { - cerr << endl - << " You must enter the name of a registered aircraft and reset point:" - << endl << endl << " FDM " << endl; - cerr << endl << " Alternatively, you may specify only the name of a script file:" - << endl << endl << " FDM