[prev in list] [next in list] [prev in thread] [next in thread]
List: flightgear-cvs
Subject: [Flightgear-cvslogs] CVS:
From: Erik Hofman <ehofman () baron ! flightgear ! org>
Date: 2009-08-30 8:23:24
Message-ID: 200908300823.n7U8NMpa017437 () baron ! flightgear ! org
[Download RAW message or body]
Update of /var/cvs/FlightGear-0.9/source/src/FDM/JSBSim/models/flight_control
In directory baron.flightgear.org:/tmp/cvs-serv17244/models/flight_control
Modified Files:
FGAccelerometer.cpp FGAccelerometer.h FGActuator.cpp
FGActuator.h FGFCSComponent.cpp FGFCSComponent.h FGFilter.h
FGGain.h FGPID.cpp FGPID.h FGSensor.cpp FGSensor.h FGSwitch.h
Makefile.am
Log Message:
Sync with JSBSim CVS again
Index: FGAccelerometer.cpp
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/FDM/JSBSim/models/flight_control/FGAccelerometer.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- FGAccelerometer.cpp 10 May 2009 12:23:40 -0000 1.1
+++ FGAccelerometer.cpp 30 Aug 2009 08:22:30 -0000 1.2
@@ -48,11 +48,11 @@
CLASS IMPLEMENTATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-
FGAccelerometer::FGAccelerometer(FGFCS* fcs, Element* element) : FGSensor(fcs, element)
{
Propagate = fcs->GetExec()->GetPropagate();
MassBalance = fcs->GetExec()->GetMassBalance();
+ Inertial = fcs->GetExec()->GetInertial();
Element* location_element = element->FindElement("location");
if (location_element) vLocation = location_element->FindElementTripletConvertTo("IN");
@@ -98,11 +98,18 @@
// There is no input assumed. This is a dedicated acceleration sensor.
vRadius = MassBalance->StructuralToBody(vLocation);
+
+ //gravitational forces
+ vAccel = Propagate->GetTl2b() * FGColumnVector3(0, 0, Inertial->gravity());
+
+ //aircraft forces
+ vAccel += (Propagate->GetUVWdot()
+ + Propagate->GetPQRdot() * vRadius
+ + Propagate->GetPQR() * (Propagate->GetPQR() * vRadius));
+
+ // transform to the specified orientation
+ vAccel = mT * vAccel;
- vAccel = mT * (Propagate->GetUVWdot()
- + Propagate->GetPQRdot() * vRadius
- + Propagate->GetPQR() * (Propagate->GetPQR() * vRadius));
-
Input = vAccel(axis);
Output = Input; // perfect accelerometer
@@ -118,6 +125,7 @@
if (noise_variance != 0.0) Noise(); // models noise
if (drift_rate != 0.0) Drift(); // models drift over time
if (bias != 0.0) Bias(); // models a finite bias
+ if (gain != 0.0) Gain(); // models a gain
if (fail_low) Output = -HUGE_VAL;
if (fail_high) Output = HUGE_VAL;
@@ -150,7 +158,7 @@
mT(3,1) = cr*sp*cy + sr*sy;
mT(3,2) = cr*sp*sy - sr*cy;
mT(3,3) = cr*cp;
-
+
// This transform is different than for FGForce, where we want a native nozzle
// force in body frame. Here we calculate the body frame accel and want it in
// the transformed accelerometer frame. So, the next line is commented out.
Index: FGAccelerometer.h
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/FDM/JSBSim/models/flight_control/FGAccelerometer.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- FGAccelerometer.h 10 May 2009 12:23:41 -0000 1.1
+++ FGAccelerometer.h 30 Aug 2009 08:22:31 -0000 1.2
@@ -41,6 +41,7 @@
#include <input_output/FGXMLElement.h>
#include "models/FGPropagate.h"
#include "models/FGMassBalance.h"
+#include "models/FGInertial.h"
#include "math/FGColumnVector3.h"
#include "math/FGMatrix33.h"
@@ -126,6 +127,7 @@
private:
FGPropagate* Propagate;
FGMassBalance* MassBalance;
+ FGInertial* Inertial;
FGColumnVector3 vLocation;
FGColumnVector3 vOrient;
FGColumnVector3 vRadius;
Index: FGActuator.cpp
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/FDM/JSBSim/models/flight_control/FGActuator.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- FGActuator.cpp 1 Jun 2009 08:52:38 -0000 1.7
+++ FGActuator.cpp 30 Aug 2009 08:22:31 -0000 1.8
@@ -4,7 +4,7 @@
Author: Jon Berndt
Date started: 21 February 2006
- ------------- Copyright (C) 2007 Jon S. Berndt (jsb@hal-pc.org) -------------
+ ------------- Copyright (C) 2007 Jon S. Berndt (jon@jsbsim.org) -------------
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free Software
Index: FGActuator.h
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/FDM/JSBSim/models/flight_control/FGActuator.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- FGActuator.h 10 Jul 2008 17:23:04 -0000 1.3
+++ FGActuator.h 30 Aug 2009 08:22:33 -0000 1.4
@@ -4,7 +4,7 @@
Author: Jon Berndt
Date started: 21 February 2007
- ------------- Copyright (C) 2006 Jon S. Berndt (jsb@hal-pc.org) -------------
+ ------------- Copyright (C) 2006 Jon S. Berndt (jon@jsbsim.org) -------------
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free Software
Index: FGFCSComponent.cpp
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/FDM/JSBSim/models/flight_control/FGFCSComponent.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- FGFCSComponent.cpp 13 Jun 2009 07:55:33 -0000 1.7
+++ FGFCSComponent.cpp 30 Aug 2009 08:22:33 -0000 1.8
@@ -91,6 +91,8 @@
Type = "SENSOR";
} else if (element->GetName() == string("accelerometer")) {
Type = "ACCELEROMETER";
+ } else if (element->GetName() == string("gyro")) {
+ Type = "GYRO";
} else if (element->GetName() == string("actuator")) {
Type = "ACTUATOR";
} else { // illegal component in this channel
Index: FGFCSComponent.h
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/FDM/JSBSim/models/flight_control/FGFCSComponent.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- FGFCSComponent.h 22 Jul 2008 08:49:16 -0000 1.6
+++ FGFCSComponent.h 30 Aug 2009 08:22:34 -0000 1.7
@@ -78,6 +78,9 @@
- FGSensor
- FGFCSFunction
- FGPID
+ - FGAccelerometer
+ - FGGyro
+ - FGActuator
@author Jon S. Berndt
@version $Id$
Index: FGFilter.h
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/FDM/JSBSim/models/flight_control/FGFilter.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- FGFilter.h 25 Mar 2009 10:00:46 -0000 1.5
+++ FGFilter.h 30 Aug 2009 08:22:35 -0000 1.6
@@ -4,7 +4,7 @@
Author: Jon S. Berndt
Date started: 4/2000
- ------------- Copyright (C) 2000 Jon S. Berndt jsb@hal-pc.org -------------
+ ------------- Copyright (C) 2000 Jon S. Berndt jon@jsbsim.org -------------
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free Software
Index: FGGain.h
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/FDM/JSBSim/models/flight_control/FGGain.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- FGGain.h 22 Jul 2008 08:49:16 -0000 1.5
+++ FGGain.h 30 Aug 2009 08:22:37 -0000 1.6
@@ -4,7 +4,7 @@
Author: Jon Berndt
Date started: 1998 ?
- ------------- Copyright (C) 1998 by Jon S. Berndt, jsb@hal-pc.org -------------
+ ------------- Copyright (C) 1998 by Jon S. Berndt, jon@jsbsim.org -------------
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free Software
Index: FGPID.cpp
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/FDM/JSBSim/models/flight_control/FGPID.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- FGPID.cpp 13 Jun 2009 07:55:34 -0000 1.6
+++ FGPID.cpp 30 Aug 2009 08:22:41 -0000 1.7
@@ -4,7 +4,7 @@
Author: Jon S. Berndt
Date started: 6/17/2006
- ------------- Copyright (C) 2006 Jon S. Berndt (jsb@hal-pc.org) -------------
+ ------------- Copyright (C) 2006 Jon S. Berndt (jon@jsbsim.org) -------------
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free Software
Index: FGPID.h
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/FDM/JSBSim/models/flight_control/FGPID.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- FGPID.h 25 Mar 2009 10:00:46 -0000 1.5
+++ FGPID.h 30 Aug 2009 08:22:44 -0000 1.6
@@ -4,7 +4,7 @@
Author: Jon Berndt
Date started: 6/17/2006
- ------------- Copyright (C) 2006 by Jon S. Berndt, jsb@hal-pc.org -------------
+ ------------- Copyright (C) 2006 by Jon S. Berndt, jon@jsbsim.org -------------
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free Software
Index: FGSensor.cpp
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/FDM/JSBSim/models/flight_control/FGSensor.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- FGSensor.cpp 1 Jun 2009 08:52:38 -0000 1.7
+++ FGSensor.cpp 30 Aug 2009 08:22:45 -0000 1.8
@@ -58,7 +58,7 @@
bits = quantized = divisions = index = delay = 0;
PreviousInput = PreviousOutput = 0.0;
- min = max = bias = noise_variance = lag = drift_rate = drift = span = 0.0;
+ min = max = bias = gain = noise_variance = lag = drift_rate = drift = span = 0.0;
granularity = 0.0;
noise_type = 0;
fail_low = fail_high = fail_stuck = false;
@@ -82,6 +82,9 @@
if ( element->FindElement("bias") ) {
bias = element->FindElementValueAsNumber("bias");
}
+ if ( element->FindElement("gain") ) {
+ gain = element->FindElementValueAsNumber("gain");
+ }
if ( element->FindElement("drift_rate") ) {
drift_rate = element->FindElementValueAsNumber("drift_rate");
}
@@ -152,6 +155,7 @@
if (noise_variance != 0.0) Noise(); // models noise
if (drift_rate != 0.0) Drift(); // models drift over time
if (bias != 0.0) Bias(); // models a finite bias
+ if (gain != 0.0) Gain(); // models a finite gain
if (delay != 0.0) Delay(); // models system signal transport latencies
@@ -196,6 +200,13 @@
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+void FGSensor::Gain(void)
+{
+ Output *= gain;
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
void FGSensor::Drift(void)
{
drift += drift_rate*dt;
@@ -304,6 +315,7 @@
cout << " (span: " << span << ", granularity: " << granularity << ")" << endl;
}
if (bias != 0.0) cout << " Bias: " << bias << endl;
+ if (gain != 0.0) cout << " Gain: " << gain << endl;
if (drift_rate != 0) cout << " Sensor drift rate: " << drift_rate << endl;
if (lag != 0) cout << " Sensor lag: " << lag << endl;
if (noise_variance != 0) {
Index: FGSensor.h
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/FDM/JSBSim/models/flight_control/FGSensor.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- FGSensor.h 13 Jun 2009 07:55:34 -0000 1.8
+++ FGSensor.h 30 Aug 2009 08:22:45 -0000 1.9
@@ -139,6 +139,7 @@
double min, max;
double span;
double bias;
+ double gain;
double drift_rate;
double drift;
double noise_variance;
@@ -166,6 +167,7 @@
void Quantize(void);
void Lag(void);
void Delay(void);
+ void Gain(void);
void bind(void);
Index: FGSwitch.h
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/FDM/JSBSim/models/flight_control/FGSwitch.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- FGSwitch.h 10 Jul 2008 17:23:05 -0000 1.3
+++ FGSwitch.h 30 Aug 2009 08:22:47 -0000 1.4
@@ -4,7 +4,7 @@
Author: Jon S. Berndt
Date started: 12/23/2002
- ------------- Copyright (C) 2002 jsb@hal-pc.org -------------
+ ------------- Copyright (C) 2002 jon@jsbsim.org -------------
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free Software
Index: Makefile.am
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/FDM/JSBSim/models/flight_control/Makefile.am,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Makefile.am 10 May 2009 12:23:43 -0000 1.4
+++ Makefile.am 30 Aug 2009 08:22:48 -0000 1.5
@@ -3,10 +3,10 @@
libFlightControl_a_SOURCES = FGPID.cpp FGDeadBand.cpp FGFCSComponent.cpp \
FGFilter.cpp FGGain.cpp FGGradient.cpp FGKinemat.cpp \
FGSummer.cpp FGSwitch.cpp FGFCSFunction.cpp FGSensor.cpp \
- FGActuator.cpp FGAccelerometer.cpp
+ FGActuator.cpp FGAccelerometer.cpp FGGyro.cpp
noinst_HEADERS = FGPID.h FGDeadBand.h FGFCSComponent.h FGFilter.h \
FGGain.h FGGradient.h FGKinemat.h FGSummer.h FGSwitch.h FGFCSFunction.h \
- FGSensor.h FGActuator.h FGAccelerometer.h
+ FGSensor.h FGActuator.h FGAccelerometer.h FGGyro.h
INCLUDES = -I$(top_srcdir)/src/FDM/JSBSim
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Flightgear-cvslogs mailing list
Flightgear-cvslogs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-cvslogs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic