You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
(64) |
May
(260) |
Jun
(65) |
Jul
(28) |
Aug
(13) |
Sep
(46) |
Oct
(55) |
Nov
(25) |
Dec
(57) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(97) |
Feb
(13) |
Mar
(90) |
Apr
(25) |
May
(97) |
Jun
(124) |
Jul
(39) |
Aug
(16) |
Sep
(62) |
Oct
(13) |
Nov
(32) |
Dec
(258) |
2006 |
Jan
(87) |
Feb
(67) |
Mar
(27) |
Apr
(19) |
May
(42) |
Jun
(12) |
Jul
(31) |
Aug
(51) |
Sep
(7) |
Oct
(4) |
Nov
(27) |
Dec
(6) |
2007 |
Jan
(23) |
Feb
(41) |
Mar
(6) |
Apr
(14) |
May
(31) |
Jun
(6) |
Jul
(9) |
Aug
(13) |
Sep
(41) |
Oct
(26) |
Nov
(13) |
Dec
(11) |
2008 |
Jan
(75) |
Feb
(24) |
Mar
(32) |
Apr
(103) |
May
(49) |
Jun
(15) |
Jul
(45) |
Aug
(61) |
Sep
(6) |
Oct
(12) |
Nov
(18) |
Dec
(32) |
2009 |
Jan
(77) |
Feb
(33) |
Mar
(33) |
Apr
(19) |
May
(52) |
Jun
(43) |
Jul
(14) |
Aug
(80) |
Sep
(32) |
Oct
(81) |
Nov
(20) |
Dec
(12) |
2010 |
Jan
(15) |
Feb
(50) |
Mar
(28) |
Apr
(49) |
May
(12) |
Jun
(19) |
Jul
(78) |
Aug
(49) |
Sep
(52) |
Oct
(22) |
Nov
(108) |
Dec
(33) |
2011 |
Jan
(47) |
Feb
(3) |
Mar
(7) |
Apr
(3) |
May
(7) |
Jun
(43) |
Jul
(80) |
Aug
(55) |
Sep
(34) |
Oct
(33) |
Nov
(33) |
Dec
(20) |
2012 |
Jan
(16) |
Feb
(18) |
Mar
(29) |
Apr
(26) |
May
(4) |
Jun
(5) |
Jul
(13) |
Aug
(14) |
Sep
(47) |
Oct
(29) |
Nov
(19) |
Dec
(66) |
2013 |
Jan
(55) |
Feb
(46) |
Mar
|
Apr
(1) |
May
|
Jun
(32) |
Jul
|
Aug
(1) |
Sep
(40) |
Oct
(3) |
Nov
(43) |
Dec
(26) |
2014 |
Jan
(63) |
Feb
(30) |
Mar
(2) |
Apr
(3) |
May
(51) |
Jun
(18) |
Jul
(4) |
Aug
(6) |
Sep
(10) |
Oct
|
Nov
(17) |
Dec
(3) |
2015 |
Jan
(13) |
Feb
(36) |
Mar
(12) |
Apr
(37) |
May
(8) |
Jun
|
Jul
(29) |
Aug
(23) |
Sep
(55) |
Oct
(82) |
Nov
(57) |
Dec
(72) |
2016 |
Jan
(61) |
Feb
(6) |
Mar
(1) |
Apr
(18) |
May
(59) |
Jun
(42) |
Jul
(24) |
Aug
(20) |
Sep
(6) |
Oct
|
Nov
(8) |
Dec
(1) |
2017 |
Jan
(2) |
Feb
(20) |
Mar
(14) |
Apr
(4) |
May
(9) |
Jun
(7) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Bertrand <bco...@us...> - 2016-05-16 17:29:49
|
Update of /cvsroot/jsbsim/JSBSim/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv16242/tests Modified Files: CMakeLists.txt Added Files: TestLGearSteer.py Log Message: Added a new test case that checks the landing gear steering feature. --- NEW FILE --- # TestLGearSteer.py # # Checks that landing gear steering is working # # Copyright (c) 2016 Bertrand Coconnier # # 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 3 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, see <http://www.gnu.org/licenses/> # import os import xml.etree.ElementTree as et from JSBSim_utils import JSBSimTestCase, CreateFDM, RunTest, CopyAircraftDef class TestLGearSteer(JSBSimTestCase): def test_direct_steer(self): fdm = CreateFDM(self.sandbox) fdm.load_model('c172r') aircraft_path = self.sandbox.path_to_jsbsim_file('aircraft') fdm.load_ic(os.path.join(aircraft_path, 'c172r', 'reset00'), False) fdm.run_ic() self.assertAlmostEqual(fdm['fcs/steer-cmd-norm'], 0.0) self.assertAlmostEqual(fdm['fcs/steer-pos-deg'], 0.0) fdm['fcs/steer-pos-deg'] = 5.0 self.assertAlmostEqual(fdm['fcs/steer-pos-deg'], 5.0) fdm.run() self.assertAlmostEqual(fdm['fcs/steer-cmd-norm'], 0.0) fdm['fcs/steer-cmd-norm'] = 1.0 self.assertAlmostEqual(fdm['fcs/steer-cmd-norm'], 1.0) fdm.run() self.assertAlmostEqual(fdm['fcs/steer-cmd-norm'], 1.0) self.assertAlmostEqual(fdm['fcs/steer-pos-deg'], 10.0) def test_steer_with_fcs(self): fdm = CreateFDM(self.sandbox) fdm.load_model('L410') aircraft_path = self.sandbox.path_to_jsbsim_file('aircraft') fdm.load_ic(os.path.join(aircraft_path, 'L410', 'reset00'), False) fdm.run_ic() self.assertAlmostEqual(fdm['fcs/steer-cmd-norm'], 0.0) self.assertAlmostEqual(fdm['fcs/steer-pos-deg'], 0.0) fdm['fcs/steer-cmd-norm'] = 1.0 self.assertAlmostEqual(fdm['fcs/steer-cmd-norm'], 1.0) fdm.run() self.assertAlmostEqual(fdm['fcs/steer-cmd-norm'], 1.0) self.assertAlmostEqual(fdm['fcs/steer-pos-deg'], 5.0) fdm['/controls/switches/full-steering-sw'] = 1.0 fdm.run() self.assertAlmostEqual(fdm['fcs/steer-cmd-norm'], 1.0) self.assertAlmostEqual(fdm['fcs/steer-pos-deg'], 0.0) fdm['/controls/switches/full-steering-sw'] = 2.0 fdm.run() self.assertAlmostEqual(fdm['fcs/steer-cmd-norm'], 1.0) self.assertAlmostEqual(fdm['fcs/steer-pos-deg'], 45.0) fdm['fcs/steer-cmd-norm'] = -0.5 fdm.run() self.assertAlmostEqual(fdm['fcs/steer-cmd-norm'], -0.5) self.assertAlmostEqual(fdm['fcs/steer-pos-deg'], -22.5) def steerType(self, hasSteerPosDeg, hasSteeringAngle, hasCastered): self.tree.write(self.sandbox('aircraft', self.aircraft_name, self.aircraft_name+'.xml')) fdm = CreateFDM(self.sandbox) fdm.set_aircraft_path('aircraft') fdm.load_script(self.script_path) fdm.run_ic() pm = fdm.get_property_manager() self.assertTrue(pm.hasNode('fcs/steer-pos-deg') == hasSteerPosDeg) self.assertTrue(pm.hasNode('gear/unit/steering-angle-deg') == hasSteeringAngle) self.assertTrue(pm.hasNode('gear/unit/castered') == hasCastered) return fdm def isCastered(self): fdm = self.steerType(True, True, True) self.assertTrue(fdm['gear/unit/castered']) fdm['fcs/steer-cmd-norm'] = 0.5 fdm.run() self.assertEqual(fdm['gear/unit/steering-angle-deg'], 0.0) # self.assertEqual(fdm['fcs/steer-pos-deg'], # fdm['gear/unit/steering-angle-deg']) fdm['fcs/steer-pos-deg'] = 20.0 self.assertEqual(fdm['gear/unit/steering-angle-deg'], 0.0) # self.assertEqual(fdm['fcs/steer-pos-deg'], # fdm['gear/unit/steering-angle-deg']) fdm['gear/unit/castered'] = 0.0 fdm['fcs/steer-cmd-norm'] = 1.0 fdm.run() self.assertEqual(fdm['gear/unit/steering-angle-deg'], float(self.max_steer_tag.text)) # self.assertEqual(fdm['fcs/steer-pos-deg'], # fdm['gear/unit/steering-angle-deg']) del fdm def isSteered(self): fdm = self.steerType(True, False, False) fdm['fcs/steer-cmd-norm'] = 0.5 fdm.run() self.assertEqual(fdm['fcs/steer-pos-deg'], 0.5*float(self.max_steer_tag.text)) del fdm def test_steer_type(self): self.script_path = self.sandbox.path_to_jsbsim_file('scripts', 'c1721.xml') self.tree, self.aircraft_name, b = CopyAircraftDef(self.script_path, self.sandbox) root = self.tree.getroot() self.max_steer_tag = root.find('ground_reactions/contact/max_steer') # Check the fixed type self.max_steer_tag.text = '0.0' fdm = self.steerType(False, False, False) del fdm # Check the castered type self.max_steer_tag.text = '360.0' self.isCastered() # Check the steered type self.max_steer_tag.text = '10.0' fdm = self.steerType(True, False, False) fdm['fcs/steer-cmd-norm'] = 0.5 fdm.run() self.assertAlmostEqual(fdm['fcs/steer-pos-deg'], 5.0) del fdm bogey_tag = root.find('ground_reactions/contact//max_steer/..') castered_tag = et.SubElement(bogey_tag, 'castered') castered_tag.text = '1.0' # Check that the bogey is castered no matter what is the value # of <max_steer> self.max_steer_tag.text = '10.0' self.isCastered() self.max_steer_tag.text = '0.0' self.isCastered() self.max_steer_tag.text = '360.0' self.isCastered() # Check the fixed type castered_tag.text = '0.0' self.max_steer_tag.text = '0.0' fdm = self.steerType(False, False, False) del fdm # Check the steered type self.max_steer_tag.text = '10.0' self.isSteered() # Check the steered type with 360.0 self.max_steer_tag.text = '360.0' self.isSteered() RunTest(TestLGearSteer) Index: CMakeLists.txt =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/tests/CMakeLists.txt,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -r1.26 -r1.27 *** CMakeLists.txt 1 May 2016 16:40:01 -0000 1.26 --- CMakeLists.txt 16 May 2016 17:29:46 -0000 1.27 *************** *** 42,46 **** TestChannelRate TestWaypoint ! TestSuspend) foreach(test ${PYTHON_TESTS}) --- 42,47 ---- TestChannelRate TestWaypoint ! TestSuspend ! TestLGearSteer) foreach(test ${PYTHON_TESTS}) |
From: Bertrand <bco...@us...> - 2016-05-16 17:25:51
|
Update of /cvsroot/jsbsim/JSBSim/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv16068/tests Modified Files: jsbsim.pxd jsbsim.pyx Log Message: Added FGPropertyManager::HasNode to the Python interface to be able to check whether a node exists or not. Index: jsbsim.pxd =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/tests/jsbsim.pxd,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** jsbsim.pxd 24 Jan 2016 12:30:10 -0000 1.1 --- jsbsim.pxd 16 May 2016 17:25:48 -0000 1.2 *************** *** 54,57 **** --- 54,62 ---- c_FGColumnVector3& GetUVW() + cdef extern from "input_output/FGPropertyManager.h" namespace "JSBSim": + cdef cppclass c_FGPropertyManager "JSBSim::FGPropertyManager": + c_FGPropertyManager() + bool HasNode(string path) + cdef extern from "FGFDMExec.h" namespace "JSBSim": cdef cppclass c_FGFDMExec "JSBSim::FGFDMExec": *************** *** 112,113 **** --- 117,119 ---- c_FGInitialCondition* GetIC() c_FGPropagate* GetPropagate() + c_FGPropertyManager* GetPropertyManager() Index: jsbsim.pyx =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/tests/jsbsim.pyx,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** jsbsim.pyx 1 May 2016 16:37:35 -0000 1.11 --- jsbsim.pyx 16 May 2016 17:25:48 -0000 1.12 *************** *** 78,81 **** --- 78,91 ---- return convertToNumpyVec(vUVW) + cdef class FGPropertyManager: + + cdef c_FGPropertyManager *thisptr + + def __init__(self): + self.thisptr = NULL + + def hasNode(self, path): + return self.thisptr.HasNode(path) + # this is the python wrapper class cdef class FGFDMExec: *************** *** 549,550 **** --- 559,565 ---- propagate.thisptr = self.thisptr.GetPropagate() return propagate + + def get_property_manager(self): + pm = FGPropertyManager() + pm.thisptr = self.thisptr.GetPropertyManager() + return pm |
From: Bertrand <bco...@us...> - 2016-05-05 17:23:14
|
Update of /cvsroot/jsbsim/JSBSim/src/models/propulsion In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv6612/src/models/propulsion Modified Files: FGTank.cpp Log Message: The grain density is now initialized from the tank capacity rather than from the tank initial content. Otherwise the tank inertia returns garbage when the initial content is set to a value different from the capacity and then modified (bug reported by Uriah George) Index: FGTank.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/propulsion/FGTank.cpp,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -r1.44 -r1.45 *** FGTank.cpp 2 Dec 2015 04:23:26 -0000 1.44 --- FGTank.cpp 5 May 2016 17:23:10 -0000 1.45 *************** *** 85,89 **** element = el->FindElement("location"); if (element) vXYZ = element->FindElementTripletConvertTo("IN"); ! else cerr << "No location found for this tank." << endl; vXYZ_drain = vXYZ; // Set initial drain location to initial tank CG --- 85,90 ---- element = el->FindElement("location"); if (element) vXYZ = element->FindElementTripletConvertTo("IN"); ! else cerr << el->ReadFrom() << "No location found for this tank." ! << endl; vXYZ_drain = vXYZ; // Set initial drain location to initial tank CG *************** *** 117,127 **** if (Capacity == 0) { ! cerr << "Tank capacity must not be zero. Reset to 0.00001 lbs!" << endl; Capacity = 0.00001; Contents = 0.0; } if (Contents > Capacity) { ! cerr << "Tank content (" << Contents << " lbs) is greater than tank capacity (" ! << Capacity << " lbs) for tank " << tank_number << "! Did you accidentally swap contents and capacity?" << endl; throw("tank definition error"); --- 118,130 ---- if (Capacity == 0) { ! cerr << el->ReadFrom() ! << "Tank capacity must not be zero. Reset to 0.00001 lbs!" << endl; Capacity = 0.00001; Contents = 0.0; } if (Contents > Capacity) { ! cerr << el->ReadFrom() << "Tank content (" << Contents ! << " lbs) is greater than tank capacity (" << Capacity ! << " lbs) for tank " << tank_number << "! Did you accidentally swap contents and capacity?" << endl; throw("tank definition error"); *************** *** 170,174 **** } } ! else cerr << "Unknown propellant grain type specified" << endl; if (element_Grain->FindElement("length")) --- 173,179 ---- } } ! else ! cerr << el->ReadFrom() << "Unknown propellant grain type specified" ! << endl; if (element_Grain->FindElement("length")) *************** *** 182,186 **** case gtCYLINDRICAL: if (Radius <= InnerRadius) { ! cerr << "The bore diameter should be smaller than the total grain diameter!" << endl; exit(-1); } --- 187,193 ---- case gtCYLINDRICAL: if (Radius <= InnerRadius) { ! cerr << element_Grain->ReadFrom() ! << "The bore diameter should be smaller than the total grain diameter!" ! << endl; exit(-1); } *************** *** 194,201 **** break; case gtUNKNOWN: ! cerr << "Unknown grain type found in this rocket engine definition." << endl; exit(-1); } ! Density = (Contents*lbtoslug)/Volume; // slugs/in^3 } --- 201,210 ---- break; case gtUNKNOWN: ! cerr << el->ReadFrom() ! << "Unknown grain type found in this rocket engine definition." ! << endl; exit(-1); } ! Density = (Capacity*lbtoslug)/Volume; // slugs/in^3 } |
From: Bertrand <bco...@us...> - 2016-05-05 17:19:10
|
Update of /cvsroot/jsbsim/JSBSim/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv6442/tests Modified Files: TestFuelTanksInertia.py Log Message: Check that the tank inertia computation is independent from the tank initial content. Index: TestFuelTanksInertia.py =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/tests/TestFuelTanksInertia.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** TestFuelTanksInertia.py 5 May 2016 15:40:08 -0000 1.4 --- TestFuelTanksInertia.py 5 May 2016 17:19:07 -0000 1.5 *************** *** 1,7 **** # TestFuelTanksInertia.py # ! # A regression test that checks that the fuel tanks inertias are updated. # ! # Copyright (c) 2015 Bertrand Coconnier # # This program is free software; you can redistribute it and/or modify it under --- 1,11 ---- # TestFuelTanksInertia.py # ! # A regression test that checks that: ! # * Fuel tanks inertias are updated when the tanks content is modified. ! # * Fuel and oxidizer total quantities are correctly computed. ! # * Fuel tanks inertias computation does not depend on the initial content but ! # rather on the tank capacity and current content. # ! # Copyright (c) 2015-2016 Bertrand Coconnier # # This program is free software; you can redistribute it and/or modify it under *************** *** 32,36 **** # need to add one. tree, aircraft_name, b = CopyAircraftDef(script_path, self.sandbox) ! tank_tag = tree.getroot().find('./propulsion/tank') inertia_factor = et.SubElement(tank_tag, 'inertia_factor') inertia_factor.text = '1.0' --- 36,40 ---- # need to add one. tree, aircraft_name, b = CopyAircraftDef(script_path, self.sandbox) ! tank_tag = tree.getroot().find('propulsion/tank') inertia_factor = et.SubElement(tank_tag, 'inertia_factor') inertia_factor.text = '1.0' *************** *** 115,117 **** --- 119,174 ---- total_oxidizer_quantity) + def test_grain_tanks_content(self): + script_path = self.sandbox.path_to_jsbsim_file('scripts', 'J2460.xml') + tree, aircraft_name, b = CopyAircraftDef(script_path, self.sandbox) + + id = 0 + for tank in tree.getroot().findall('propulsion/tank'): + grain_config = tank.find('grain_config') + if grain_config and grain_config.attrib['type'] == 'CYLINDRICAL': + break + ++id + + capacity = float(tank.find('capacity').text) + tank.find('contents').text = str(0.5*capacity) + tree.write(self.sandbox('aircraft', aircraft_name, + aircraft_name+'.xml')) + + radius_tag = tank.find('radius') + radius = float(radius_tag.text) + if 'unit' in radius_tag.attrib and radius_tag.attrib['unit'] == 'IN': + radius /= 12.0 + + bore_diameter_tag = tank.find('grain_config/bore_diameter') + bore_radius = 0.5*float(bore_diameter_tag.text) + if 'unit' in bore_diameter_tag.attrib and bore_diameter_tag.attrib['unit'] == 'IN': + bore_radius /= 12.0 + + fdm = CreateFDM(self.sandbox) + fdm.set_aircraft_path('aircraft') + fdm.load_script(script_path) + fdm.run_ic() + + tank_name = 'propulsion/tank[%g]' % (id,) + + self.assertAlmostEqual(fdm[tank_name+'/contents-lbs'], 0.5*capacity) + fdm['propulsion/tank/contents-lbs'] = capacity + mass = capacity / 32.174049 # Converting lbs to slugs + ixx = 0.5 * mass * (radius * radius + bore_radius*bore_radius) + self.assertAlmostEqual(fdm[tank_name+'local-ixx-slug_ft2'], ixx) + + del fdm + + tank.find('contents').text = '0.0' + tree.write(self.sandbox('aircraft', aircraft_name, + aircraft_name+'.xml')) + + fdm = CreateFDM(self.sandbox) + fdm.set_aircraft_path('aircraft') + fdm.load_script(script_path) + fdm.run_ic() + + self.assertAlmostEqual(fdm[tank_name+'/contents-lbs'], 0.0) + fdm['propulsion/tank/contents-lbs'] = capacity + RunTest(TestFuelTanksInertia) |
From: Bertrand <bco...@us...> - 2016-05-05 15:40:11
|
Update of /cvsroot/jsbsim/JSBSim/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv31239/tests Modified Files: TestFuelTanksInertia.py Log Message: Added a new check for fuel and oxidizer total quantities Index: TestFuelTanksInertia.py =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/tests/TestFuelTanksInertia.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** TestFuelTanksInertia.py 30 Jan 2016 18:50:24 -0000 1.3 --- TestFuelTanksInertia.py 5 May 2016 15:40:08 -0000 1.4 *************** *** 19,24 **** # import xml.etree.ElementTree as et ! from JSBSim_utils import JSBSimTestCase, CreateFDM, ExecuteUntil, CopyAircraftDef, RunTest --- 19,26 ---- # + import os import xml.etree.ElementTree as et ! from JSBSim_utils import (JSBSimTestCase, CreateFDM, ExecuteUntil, RunTest, ! CopyAircraftDef) *************** *** 84,86 **** --- 86,117 ---- msg="Izz does not vary as the tank content does\nIzz ratio=%f\nContents ratio=%f" % (izz_ratio, contents_ratio)) + def test_fuel_tanks_content(self): + script_path = self.sandbox.path_to_jsbsim_file('scripts', 'J2460.xml') + fdm = CreateFDM(self.sandbox) + fdm.load_script(script_path) + fdm.run_ic() + + tree = et.parse(script_path) + use_tag = tree.getroot().find('use') + aircraft_name = use_tag.attrib['aircraft'] + aircraft_path = self.sandbox.path_to_jsbsim_file('aircraft', + aircraft_name) + aircraft_tree = et.parse(os.path.join(aircraft_path, + aircraft_name+'.xml')) + + total_fuel_quantity = 0.0 + total_oxidizer_quantity = 0.0 + for tank in aircraft_tree.findall('propulsion/tank'): + contents = float(tank.find('contents').text) + if tank.attrib['type'] == "FUEL": + total_fuel_quantity += contents + elif tank.attrib['type'] == 'OXIDIZER': + total_oxidizer_quantity += contents + + self.assertAlmostEqual(fdm['propulsion/total-fuel-lbs'], + total_fuel_quantity) + + self.assertAlmostEqual(fdm['propulsion/total-oxidizer-lbs'], + total_oxidizer_quantity) + RunTest(TestFuelTanksInertia) |
From: Bertrand <bco...@us...> - 2016-05-05 15:38:12
|
Update of /cvsroot/jsbsim/JSBSim/src/models In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv31149/src/models Modified Files: FGPropulsion.h FGPropulsion.cpp Log Message: Added the computation of the total oxidizer content. Also use SGPropertyObject to save the use of trivial getters and setters. Index: FGPropulsion.h =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGPropulsion.h,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -r1.35 -r1.36 *** FGPropulsion.h 7 Jan 2015 23:22:59 -0000 1.35 --- FGPropulsion.h 5 May 2016 15:38:08 -0000 1.36 *************** *** 42,45 **** --- 42,46 ---- #include <iosfwd> + #include "simgear/props/propertyObject.hxx" #include "FGModel.h" #include "propulsion/FGEngine.h" *************** *** 173,180 **** double GetMoments(int n) const {return vMoments(n);} - bool GetRefuel(void) const {return refuel;} - void SetRefuel(bool setting) {refuel = setting;} - bool GetFuelDump(void) const {return dump;} - void SetFuelDump(bool setting) {dump = setting;} double Transfer(int source, int target, double amount); void DoRefuel(double time_slice); --- 174,177 ---- *************** *** 187,191 **** inline int GetActiveEngine(void) const {return ActiveEngine;} inline bool GetFuelFreeze(void) const {return FuelFreeze;} - double GetTotalFuelQuantity(void) const {return TotalFuelQuantity;} void SetMagnetos(int setting); --- 184,187 ---- *************** *** 213,220 **** FGColumnVector3 vXYZtank_arm; FGMatrix33 tankJ; ! bool refuel; ! bool dump; bool FuelFreeze; ! double TotalFuelQuantity; double DumpRate; double RefuelRate; --- 209,217 ---- FGColumnVector3 vXYZtank_arm; FGMatrix33 tankJ; ! simgear::PropertyObject<bool> refuel; ! simgear::PropertyObject<bool> dump; bool FuelFreeze; ! simgear::PropertyObject<double> TotalFuelQuantity; ! simgear::PropertyObject<double> TotalOxidizerQuantity; double DumpRate; double RefuelRate; Index: FGPropulsion.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGPropulsion.cpp,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -r1.86 -r1.87 *** FGPropulsion.cpp 17 Jan 2016 15:26:18 -0000 1.86 --- FGPropulsion.cpp 5 May 2016 15:38:09 -0000 1.87 *************** *** 85,93 **** ActiveEngine = -1; // -1: ALL, 0: Engine 1, 1: Engine 2 ... tankJ.InitMatrix(); - refuel = dump = false; DumpRate = 0.0; RefuelRate = 6000.0; FuelFreeze = false; - TotalFuelQuantity = 0.0; IsBound = HavePistonEngine = --- 85,91 ---- *************** *** 123,126 **** --- 121,127 ---- for (unsigned int i=0; i<numTanks; i++) Tanks[i]->ResetToIC(); + TotalFuelQuantity = 0.0; + TotalOxidizerQuantity = 0.0; + refuel = dump = false; for (unsigned int i=0; i<numEngines; i++) *************** *** 152,164 **** TotalFuelQuantity = 0.0; for (i=0; i<numTanks; i++) { Tanks[i]->Calculate( in.TotalDeltaT, in.TAT_c); ! if (Tanks[i]->GetType() == FGTank::ttFUEL) { TotalFuelQuantity += Tanks[i]->GetContents(); } } ! if (refuel) DoRefuel( in.TotalDeltaT ); ! if (dump) DumpFuel( in.TotalDeltaT ); RunPostFunctions(); --- 153,173 ---- TotalFuelQuantity = 0.0; + TotalOxidizerQuantity = 0.0; for (i=0; i<numTanks; i++) { Tanks[i]->Calculate( in.TotalDeltaT, in.TAT_c); ! switch (Tanks[i]->GetType()) { ! case FGTank::ttFUEL: TotalFuelQuantity += Tanks[i]->GetContents(); + break; + case FGTank::ttOXIDIZER: + TotalOxidizerQuantity += Tanks[i]->GetContents(); + break; + default: + break; } } ! if (refuel.node() && refuel) DoRefuel( in.TotalDeltaT ); ! if (dump.node() && dump) DumpFuel( in.TotalDeltaT ); RunPostFunctions(); *************** *** 766,774 **** PropertyManager->Tie("propulsion/active_engine", this, (iPMF)&FGPropulsion::GetActiveEngine, &FGPropulsion::SetActiveEngine, true); - PropertyManager->Tie("propulsion/total-fuel-lbs", this, &FGPropulsion::GetTotalFuelQuantity); - PropertyManager->Tie("propulsion/refuel", this, &FGPropulsion::GetRefuel, - &FGPropulsion::SetRefuel, true); - PropertyManager->Tie("propulsion/fuel_dump", this, &FGPropulsion::GetFuelDump, - &FGPropulsion::SetFuelDump, true); PropertyManager->Tie("forces/fbx-prop-lbs", this, eX, (PMF)&FGPropulsion::GetForces); PropertyManager->Tie("forces/fby-prop-lbs", this, eY, (PMF)&FGPropulsion::GetForces); --- 775,778 ---- *************** *** 777,780 **** --- 781,788 ---- PropertyManager->Tie("moments/m-prop-lbsft", this, eY, (PMF)&FGPropulsion::GetMoments); PropertyManager->Tie("moments/n-prop-lbsft", this, eZ, (PMF)&FGPropulsion::GetMoments); + TotalFuelQuantity = PropertyManager->CreatePropertyObject<double>("propulsion/total-fuel-lbs"); + TotalOxidizerQuantity = PropertyManager->CreatePropertyObject<double>("propulsion/total-oxidizer-lbs"); + refuel = PropertyManager->CreatePropertyObject<bool>("propulsion/refuel"); + dump = PropertyManager->CreatePropertyObject<bool>("propulsion/fuel_dump"); } |
From: Bertrand <bco...@us...> - 2016-05-05 15:32:46
|
Update of /cvsroot/jsbsim/JSBSim/src/models/flight_control In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv30859/src/models/flight_control Modified Files: FGWaypoint.cpp Log Message: Added a helper function to FGPropertyManager to get an SGPropertyObject Index: FGWaypoint.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/flight_control/FGWaypoint.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** FGWaypoint.cpp 17 Apr 2016 13:19:39 -0000 1.7 --- FGWaypoint.cpp 5 May 2016 15:32:42 -0000 1.8 *************** *** 67,71 **** if (element->FindElement("target_latitude") ) { ! target_latitude = simgear::PropertyObject<double>(PropertyManager->GetNode(element->FindElementValue("target_latitude"))); if (element->FindElement("target_latitude")->HasAttribute("unit")) { if (element->FindElement("target_latitude")->GetAttributeValue("unit") == "DEG") { --- 67,71 ---- if (element->FindElement("target_latitude") ) { ! target_latitude = PropertyManager->CreatePropertyObject<double>(element->FindElementValue("target_latitude")); if (element->FindElement("target_latitude")->HasAttribute("unit")) { if (element->FindElement("target_latitude")->GetAttributeValue("unit") == "DEG") { *************** *** 81,85 **** if (element->FindElement("target_longitude") ) { ! target_longitude = simgear::PropertyObject<double>(PropertyManager->GetNode(element->FindElementValue("target_longitude"))); if (element->FindElement("target_longitude")->HasAttribute("unit")) { if (element->FindElement("target_longitude")->GetAttributeValue("unit") == "DEG") { --- 81,85 ---- if (element->FindElement("target_longitude") ) { ! target_longitude = PropertyManager->CreatePropertyObject<double>(element->FindElementValue("target_longitude")); if (element->FindElement("target_longitude")->HasAttribute("unit")) { if (element->FindElement("target_longitude")->GetAttributeValue("unit") == "DEG") { *************** *** 95,99 **** if (element->FindElement("source_latitude") ) { ! source_latitude = simgear::PropertyObject<double>(PropertyManager->GetNode(element->FindElementValue("source_latitude"))); if (element->FindElement("source_latitude")->HasAttribute("unit")) { if (element->FindElement("source_latitude")->GetAttributeValue("unit") == "DEG") { --- 95,99 ---- if (element->FindElement("source_latitude") ) { ! source_latitude = PropertyManager->CreatePropertyObject<double>(element->FindElementValue("source_latitude")); if (element->FindElement("source_latitude")->HasAttribute("unit")) { if (element->FindElement("source_latitude")->GetAttributeValue("unit") == "DEG") { *************** *** 109,113 **** if (element->FindElement("source_longitude") ) { ! source_longitude = simgear::PropertyObject<double>(PropertyManager->GetNode(element->FindElementValue("source_longitude"))); if (element->FindElement("source_longitude")->HasAttribute("unit")) { if (element->FindElement("source_longitude")->GetAttributeValue("unit") == "DEG") { --- 109,113 ---- if (element->FindElement("source_longitude") ) { ! source_longitude = PropertyManager->CreatePropertyObject<double>(element->FindElementValue("source_longitude")); if (element->FindElement("source_longitude")->HasAttribute("unit")) { if (element->FindElement("source_longitude")->GetAttributeValue("unit") == "DEG") { |
From: Bertrand <bco...@us...> - 2016-05-05 15:32:45
|
Update of /cvsroot/jsbsim/JSBSim/src/input_output In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv30859/src/input_output Modified Files: FGPropertyManager.h Log Message: Added a helper function to FGPropertyManager to get an SGPropertyObject Index: FGPropertyManager.h =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/input_output/FGPropertyManager.h,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -r1.29 -r1.30 *** FGPropertyManager.h 15 Nov 2014 11:32:54 -0000 1.29 --- FGPropertyManager.h 5 May 2016 15:32:42 -0000 1.30 *************** *** 43,47 **** #include <string> ! #include "simgear/props/props.hxx" #if !PROPS_STANDALONE # include "simgear/math/SGMath.hxx" --- 43,47 ---- #include <string> ! #include "simgear/props/propertyObject.hxx" #if !PROPS_STANDALONE # include "simgear/math/SGMath.hxx" *************** *** 384,388 **** /// Constructor ! FGPropertyManager(FGPropertyNode* _root) : root(_root) {}; /// Destructor --- 384,388 ---- /// Constructor ! explicit FGPropertyManager(FGPropertyNode* _root) : root(_root) {}; /// Destructor *************** *** 688,691 **** --- 688,695 ---- } + template <class T> simgear::PropertyObject<T> + CreatePropertyObject(const std::string &path) + { return simgear::PropertyObject<T>(root->GetNode(path, true)); } + private: std::vector<SGPropertyNode_ptr> tied_properties; |
From: Bertrand <bco...@us...> - 2016-05-05 15:28:13
|
Update of /cvsroot/jsbsim/JSBSim/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv30560/tests Modified Files: JSBSim_utils.py Log Message: Removed the hardcoded directory Index: JSBSim_utils.py =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/tests/JSBSim_utils.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** JSBSim_utils.py 1 May 2016 16:35:43 -0000 1.11 --- JSBSim_utils.py 5 May 2016 15:28:10 -0000 1.12 *************** *** 137,145 **** def setUp(self, *args): self.sandbox = SandBox(*args) os.chdir(self.sandbox()) def tearDown(self): self.sandbox.erase() ! os.chdir('..') # Generator that returns the full path to all the scripts in JSBSim --- 137,146 ---- def setUp(self, *args): self.sandbox = SandBox(*args) + self.currentdir = os.getcwd() os.chdir(self.sandbox()) def tearDown(self): self.sandbox.erase() ! os.chdir(self.currentdir) # Generator that returns the full path to all the scripts in JSBSim |
From: Erik H. <eh...@us...> - 2016-05-03 11:51:23
|
Update of /cvsroot/jsbsim/JSBSim/utils/aeromatic++/Systems In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv24202/Systems Modified Files: Chute.cpp Systems.h Thruster.cpp Log Message: Initialize the srd::vectors to zero Index: Chute.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/utils/aeromatic++/Systems/Chute.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** Chute.cpp 19 Nov 2015 14:07:08 -0000 1.10 --- Chute.cpp 3 May 2016 11:51:19 -0000 1.11 *************** *** 119,123 **** file << " <property>systems/chute/drag-chute-offset</property>" << std::endl; file << " <property>systems/chute/chute-not-released</property>" << std::endl; ! file << " <gain>0.9</gain>" << std::endl; file << " </product>" << std::endl; file << " </function>" << std::endl; --- 119,123 ---- file << " <property>systems/chute/drag-chute-offset</property>" << std::endl; file << " <property>systems/chute/chute-not-released</property>" << std::endl; ! file << " <value>0.9</value>" << std::endl; file << " </product>" << std::endl; file << " </function>" << std::endl; Index: Systems.h =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/utils/aeromatic++/Systems/Systems.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** Systems.h 19 Nov 2015 14:07:08 -0000 1.11 --- Systems.h 3 May 2016 11:51:19 -0000 1.12 *************** *** 260,264 **** RescueChute(Aeromatic *p) : Chute(p) { _description.clear(); ! _description.push_back("Rescue Chute"); } ~RescueChute() {} --- 260,264 ---- RescueChute(Aeromatic *p) : Chute(p) { _description.clear(); ! _description.push_back("Rescue Chute (Ballistic Recovery System)"); } ~RescueChute() {} Index: Thruster.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/utils/aeromatic++/Systems/Thruster.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -r1.24 -r1.25 *** Thruster.cpp 17 Jan 2016 12:44:14 -0000 1.24 --- Thruster.cpp 3 May 2016 11:51:19 -0000 1.25 *************** *** 156,160 **** } float max_thickness = 0.3f*_max_chord; ! float max_camber = 0.015f; float xt = R; --- 156,160 ---- } float max_thickness = 0.3f*_max_chord; ! float max_camber = 0.035f; float xt = R; *************** *** 208,213 **** float CLa = PAR/(1.0f + sqrtf(1.0f + 0.25f*AR*AR)); float CDi = 1.0f/(eff*B*PAR); ! float CD0 = 0.3333f*CDi*CL0*CL0; ! float CDa = 2.0f*CLa*CDi; float DtDr, DqDr, tem1, tem2, anew, bnew; --- 208,213 ---- float CLa = PAR/(1.0f + sqrtf(1.0f + 0.25f*AR*AR)); float CDi = 1.0f/(eff*B*PAR); ! float CD0 = TC*k1*Cf + 0.3333f*CDi*CL0*CL0; ! float CDa = CLa*CDi; float DtDr, DqDr, tem1, tem2, anew, bnew; *************** *** 221,225 **** float alpha = th-phi; ! float CL = CL0 + alpha*CLa; float CD = CD0 + alpha*CDa*CL + CDi*CL*CL; float CY = CL*cphi - CD*sphi; --- 221,225 ---- float alpha = th-phi; ! float CL = std::min(std::max(CL0 + alpha*CLa, -1.42f), 1.42f); float CD = CD0 + alpha*CDa*CL + CDi*CL*CL; float CY = CL*cphi - CD*sphi; |
From: Erik H. <eh...@us...> - 2016-05-03 11:51:22
|
Update of /cvsroot/jsbsim/JSBSim/utils/aeromatic++ In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv24202 Modified Files: Aircraft.cpp Log Message: Initialize the srd::vectors to zero Index: Aircraft.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/utils/aeromatic++/Aircraft.cpp,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -r1.64 -r1.65 *** Aircraft.cpp 17 Jan 2016 12:44:14 -0000 1.64 --- Aircraft.cpp 3 May 2016 11:51:19 -0000 1.65 *************** *** 156,174 **** _Cnbeta = 0.0f; _Cnr = 0.0f; _Cndr = 0.0f; _Cnda = 0.0f; ! _Re.reserve(4); ! _alpha.reserve(4); ! _CLalpha.reserve(3); ! _CLmax.reserve(3); ! _CDalpha.reserve(4); ! _CYp.reserve(4); ! _Clbeta.reserve(1); ! _Clr.reserve(1); ! _Cnp.reserve(4); ! ! _CLaw.reserve(3); ! _CLah.reserve(3); ! _CLav.reserve(3); } --- 156,174 ---- _Cnbeta = 0.0f; _Cnr = 0.0f; _Cndr = 0.0f; _Cnda = 0.0f; ! _Re.resize(4, 0.0f); ! _alpha.resize(4, 0.0f); ! _CLalpha.resize(3, 0.0f); ! _CLmax.resize(3, 0.0f); ! _CDalpha.resize(4, 0.0f); ! _CYp.resize(4, 0.0f); ! _Clbeta.resize(1, 0.0f); ! _Clr.resize(1, 0.0f); ! _Cnp.resize(4, 0.0f); ! ! _CLaw.resize(3, 0.0f); ! _CLah.resize(3, 0.0f); ! _CLav.resize(3, 0.0f); } |
From: Bertrand <bco...@us...> - 2016-05-01 18:26:00
|
Update of /cvsroot/jsbsim/JSBSim/src In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv4123/src Modified Files: FGFDMExec.cpp Log Message: Prevent the integrators from continuing to accumulate while the simulation is suspended. Index: FGFDMExec.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/FGFDMExec.cpp,v retrieving revision 1.189 retrieving revision 1.190 diff -C2 -r1.189 -r1.190 *** FGFDMExec.cpp 16 Apr 2016 12:24:39 -0000 1.189 --- FGFDMExec.cpp 1 May 2016 18:25:57 -0000 1.190 *************** *** 562,565 **** --- 562,566 ---- Run(); + Propagate->InitializeDerivatives(); ResumeIntegration(); // Restores the integration rate to what it was. *************** *** 594,598 **** Winds->SetWindNED(FGIC->GetWindNEDFpsIC()); Run(); - Propagate->InitializeDerivatives(); } --- 595,598 ---- |
From: Bertrand <bco...@us...> - 2016-05-01 18:26:00
|
Update of /cvsroot/jsbsim/JSBSim/src/models In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv4123/src/models Modified Files: FGPropagate.cpp Log Message: Prevent the integrators from continuing to accumulate while the simulation is suspended. Index: FGPropagate.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGPropagate.cpp,v retrieving revision 1.130 retrieving revision 1.131 diff -C2 -r1.130 -r1.131 *** FGPropagate.cpp 16 Apr 2016 12:24:39 -0000 1.130 --- FGPropagate.cpp 1 May 2016 18:25:57 -0000 1.131 *************** *** 223,230 **** // Propagate rotational / translational velocity, angular /translational position, respectively. ! Integrate(VState.qAttitudeECI, VState.vQtrndot, VState.dqQtrndot, dt, integrator_rotational_position); ! Integrate(VState.vPQRi, in.vPQRidot, VState.dqPQRidot, dt, integrator_rotational_rate); ! Integrate(VState.vInertialPosition, VState.vInertialVelocity, VState.dqInertialVelocity, dt, integrator_translational_position); ! Integrate(VState.vInertialVelocity, in.vUVWidot, VState.dqUVWidot, dt, integrator_translational_rate); // CAUTION : the order of the operations below is very important to get transformation --- 223,232 ---- // Propagate rotational / translational velocity, angular /translational position, respectively. ! if (!FDMExec->IntegrationSuspended()) { ! Integrate(VState.qAttitudeECI, VState.vQtrndot, VState.dqQtrndot, dt, integrator_rotational_position); ! Integrate(VState.vPQRi, in.vPQRidot, VState.dqPQRidot, dt, integrator_rotational_rate); ! Integrate(VState.vInertialPosition, VState.vInertialVelocity, VState.dqInertialVelocity, dt, integrator_translational_position); ! Integrate(VState.vInertialVelocity, in.vUVWidot, VState.dqUVWidot, dt, integrator_translational_rate); ! } // CAUTION : the order of the operations below is very important to get transformation *************** *** 232,236 **** // 1. Update the Earth position angle (EPA) ! VState.vLocation.IncrementEarthPositionAngle(in.vOmegaPlanet(eZ)*(in.DeltaT*rate)); // 2. Update the Ti2ec and Tec2i transforms from the updated EPA --- 234,238 ---- // 1. Update the Earth position angle (EPA) ! VState.vLocation.IncrementEarthPositionAngle(in.vOmegaPlanet(eZ)*dt); // 2. Update the Ti2ec and Tec2i transforms from the updated EPA |
From: Bertrand <bco...@us...> - 2016-05-01 16:40:04
|
Update of /cvsroot/jsbsim/JSBSim/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv31332/tests Modified Files: CMakeLists.txt Added Files: TestSuspend.py Log Message: Added a new test that checks that we get the same results whether the execution of a script is suspended or not --- NEW FILE --- # TestSuspend.py # # A regression test that checks that suspending JSBSim is not modifying the # results compared to the same script that was run without being suspended. # # Copyright (c) 2016 Bertrand Coconnier # # 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 3 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, see <http://www.gnu.org/licenses/> # import pandas as pd from JSBSim_utils import JSBSimTestCase, CreateFDM, RunTest, ExecuteUntil, FindDifferences class TestSuspend(JSBSimTestCase): def setUp(self, *args): JSBSimTestCase.setUp(self, *args) fdm = self.initFDM() while fdm.run(): pass self.ref = pd.read_csv('BallOut.csv', index_col=0) def initFDM(self): fdm = CreateFDM(self.sandbox) script_path = self.sandbox.path_to_jsbsim_file('scripts', 'cannonball.xml') fdm.load_script(script_path) fdm['simulation/integrator/rate/rotational'] = 5 fdm['simulation/integrator/rate/translational'] = 5 fdm['simulation/integrator/position/rotational'] = 5 fdm['simulation/integrator/position/translational'] = 5 fdm.run_ic() fdm.set_dt(0.05) return fdm def testSuspend(self): fdm = self.initFDM() ExecuteUntil(fdm, 1.0) fdm.suspend_integration() fdm.disable_output() for i in xrange(5): fdm.run() fdm.resume_integration() fdm.enable_output() while fdm.run(): pass out = pd.read_csv('BallOut.csv', index_col=0) # Find all the data that are differing by more than 1E-8 between the # two data sets. diff = FindDifferences(self.ref, out, 1E-8) self.longMessage = True self.assertEqual(len(diff), 0, msg='\n'+diff.to_string()) def testHold(self): fdm = self.initFDM() ExecuteUntil(fdm, 1.0) fdm.hold() for i in xrange(5): fdm.run() fdm.resume() while fdm.run(): pass out = pd.read_csv('BallOut.csv', index_col=0) # Find all the data that are differing by more than 1E-8 between the # two data sets. diff = FindDifferences(self.ref, out, 1E-8) self.longMessage = True self.assertEqual(len(diff), 0, msg='\n'+diff.to_string()) RunTest(TestSuspend) Index: CMakeLists.txt =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/tests/CMakeLists.txt,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -r1.25 -r1.26 *** CMakeLists.txt 17 Apr 2016 13:12:05 -0000 1.25 --- CMakeLists.txt 1 May 2016 16:40:01 -0000 1.26 *************** *** 41,45 **** CheckTrim TestChannelRate ! TestWaypoint) foreach(test ${PYTHON_TESTS}) --- 41,46 ---- CheckTrim TestChannelRate ! TestWaypoint ! TestSuspend) foreach(test ${PYTHON_TESTS}) |
From: Bertrand <bco...@us...> - 2016-05-01 16:37:38
|
Update of /cvsroot/jsbsim/JSBSim/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv31234/tests Modified Files: jsbsim.pyx Log Message: Keep a consistent naming between Python and C++ interfaces Index: jsbsim.pyx =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/tests/jsbsim.pyx,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** jsbsim.pyx 24 Jan 2016 18:49:28 -0000 1.10 --- jsbsim.pyx 1 May 2016 16:37:35 -0000 1.11 *************** *** 383,387 **** self.thisptr.DoTrim(mode) ! def do_disable_output(self): """ Disables data logging to all outputs. --- 383,387 ---- self.thisptr.DoTrim(mode) ! def disable_output(self): """ Disables data logging to all outputs. *************** *** 389,393 **** self.thisptr.DisableOutput() ! def do_enable_output(self): """ Enables data logging to all outputs. --- 389,393 ---- self.thisptr.DisableOutput() ! def enable_output(self): """ Enables data logging to all outputs. |
From: Bertrand <bco...@us...> - 2016-05-01 16:35:47
|
Update of /cvsroot/jsbsim/JSBSim/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv31148/tests Modified Files: JSBSim_utils.py Log Message: The CVS module is no longer needed. Index: JSBSim_utils.py =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/tests/JSBSim_utils.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** JSBSim_utils.py 31 Jan 2016 16:40:06 -0000 1.10 --- JSBSim_utils.py 1 May 2016 16:35:43 -0000 1.11 *************** *** 18,22 **** # this program; if not, see <http://www.gnu.org/licenses/> ! import os, sys, csv, string, tempfile, shutil, unittest import xml.etree.ElementTree as et import numpy as np --- 18,22 ---- # this program; if not, see <http://www.gnu.org/licenses/> ! import os, sys, string, tempfile, shutil, unittest import xml.etree.ElementTree as et import numpy as np |
From: Bertrand <bco...@us...> - 2016-04-17 13:19:42
|
Update of /cvsroot/jsbsim/JSBSim/src/models/flight_control In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28218/src/models/flight_control Modified Files: FGWaypoint.h FGWaypoint.cpp Log Message: Now uses the same Earth radius as the rest of JSBSim. Error messages now give the file name and line number at which the problem occurred. First use of simgear::PropertyObject in JSBSim as a proof of concept. Index: FGWaypoint.h =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/flight_control/FGWaypoint.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** FGWaypoint.h 20 Sep 2015 20:53:13 -0000 1.3 --- FGWaypoint.h 17 Apr 2016 13:19:39 -0000 1.4 *************** *** 39,42 **** --- 39,43 ---- #include <string> + #include "simgear/props/propertyObject.hxx" #include "FGFCSComponent.h" *************** *** 109,116 **** private: ! FGPropertyNode_ptr target_latitude_pNode; ! FGPropertyNode_ptr target_longitude_pNode; ! FGPropertyNode_ptr source_latitude_pNode; ! FGPropertyNode_ptr source_longitude_pNode; double target_latitude_unit; double target_longitude_unit; --- 110,117 ---- private: ! simgear::PropertyObject<double> target_latitude; ! simgear::PropertyObject<double> target_longitude; ! simgear::PropertyObject<double> source_latitude; ! simgear::PropertyObject<double> source_longitude; double target_latitude_unit; double target_longitude_unit; Index: FGWaypoint.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/flight_control/FGWaypoint.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** FGWaypoint.cpp 20 Sep 2015 20:53:13 -0000 1.6 --- FGWaypoint.cpp 17 Apr 2016 13:19:39 -0000 1.7 *************** *** 67,71 **** if (element->FindElement("target_latitude") ) { ! target_latitude_pNode = PropertyManager->GetNode(element->FindElementValue("target_latitude")); if (element->FindElement("target_latitude")->HasAttribute("unit")) { if (element->FindElement("target_latitude")->GetAttributeValue("unit") == "DEG") { --- 67,71 ---- if (element->FindElement("target_latitude") ) { ! target_latitude = simgear::PropertyObject<double>(PropertyManager->GetNode(element->FindElementValue("target_latitude"))); if (element->FindElement("target_latitude")->HasAttribute("unit")) { if (element->FindElement("target_latitude")->GetAttributeValue("unit") == "DEG") { *************** *** 73,81 **** } } ! } else ! throw("Target latitude is required for waypoint component: "+Name); if (element->FindElement("target_longitude") ) { ! target_longitude_pNode = PropertyManager->GetNode(element->FindElementValue("target_longitude")); if (element->FindElement("target_longitude")->HasAttribute("unit")) { if (element->FindElement("target_longitude")->GetAttributeValue("unit") == "DEG") { --- 73,85 ---- } } ! } else { ! cerr << element->ReadFrom() << endl ! << "Target latitude is required for waypoint component: " << Name ! << endl; ! throw("Malformed waypoint definition"); ! } if (element->FindElement("target_longitude") ) { ! target_longitude = simgear::PropertyObject<double>(PropertyManager->GetNode(element->FindElementValue("target_longitude"))); if (element->FindElement("target_longitude")->HasAttribute("unit")) { if (element->FindElement("target_longitude")->GetAttributeValue("unit") == "DEG") { *************** *** 83,91 **** } } ! } else ! throw("Target longitude is required for waypoint component: "+Name); if (element->FindElement("source_latitude") ) { ! source_latitude_pNode = PropertyManager->GetNode(element->FindElementValue("source_latitude")); if (element->FindElement("source_latitude")->HasAttribute("unit")) { if (element->FindElement("source_latitude")->GetAttributeValue("unit") == "DEG") { --- 87,99 ---- } } ! } else { ! cerr << element->ReadFrom() << endl ! << "Target longitude is required for waypoint component: " << Name ! << endl; ! throw("Malformed waypoint definition"); ! } if (element->FindElement("source_latitude") ) { ! source_latitude = simgear::PropertyObject<double>(PropertyManager->GetNode(element->FindElementValue("source_latitude"))); if (element->FindElement("source_latitude")->HasAttribute("unit")) { if (element->FindElement("source_latitude")->GetAttributeValue("unit") == "DEG") { *************** *** 93,101 **** } } ! } else ! throw("Source latitude is required for waypoint component: "+Name); if (element->FindElement("source_longitude") ) { ! source_longitude_pNode = PropertyManager->GetNode(element->FindElementValue("source_longitude")); if (element->FindElement("source_longitude")->HasAttribute("unit")) { if (element->FindElement("source_longitude")->GetAttributeValue("unit") == "DEG") { --- 101,113 ---- } } ! } else { ! cerr << element->ReadFrom() << endl ! << "Source latitude is required for waypoint component: " << Name ! << endl; ! throw("Malformed waypoint definition"); ! } if (element->FindElement("source_longitude") ) { ! source_longitude = simgear::PropertyObject<double>(PropertyManager->GetNode(element->FindElementValue("source_longitude"))); if (element->FindElement("source_longitude")->HasAttribute("unit")) { if (element->FindElement("source_longitude")->GetAttributeValue("unit") == "DEG") { *************** *** 103,113 **** } } ! } else ! throw("Source longitude is required for waypoint component: "+Name); if (element->FindElement("radius")) radius = element->FindElementValueAsNumberConvertTo("radius", "FT"); ! else ! radius = 21144000; // Radius of Earth in feet. unit = element->GetAttributeValue("unit"); --- 115,132 ---- } } ! } else { ! cerr << element->ReadFrom() << endl ! << "Source longitude is required for waypoint component: " << Name ! << endl; ! throw("Malformed waypoint definition"); ! } if (element->FindElement("radius")) radius = element->FindElementValueAsNumberConvertTo("radius", "FT"); ! else { ! FGLocation source(source_longitude * source_latitude_unit, ! source_latitude * source_longitude_unit, 1.0); ! radius = source.GetSeaLevelRadius(); // Radius of Earth in feet. ! } unit = element->GetAttributeValue("unit"); *************** *** 116,120 **** if (unit == "DEG") eUnit = eDeg; else if (unit == "RAD") eUnit = eRad; ! else throw("Unknown unit "+unit+" in HEADING waypoint component, "+Name); } else { eUnit = eRad; // Default is radians if unspecified --- 135,144 ---- if (unit == "DEG") eUnit = eDeg; else if (unit == "RAD") eUnit = eRad; ! else { ! cerr << element->ReadFrom() << endl ! << "Unknown unit " << unit << " in HEADING waypoint component, " ! << Name << endl; ! throw("Malformed waypoint definition"); ! } } else { eUnit = eRad; // Default is radians if unspecified *************** *** 124,128 **** if (unit == "FT") eUnit = eFeet; else if (unit == "M") eUnit = eMeters; ! else throw("Unknown unit "+unit+" in DISTANCE waypoint component, "+Name); } else { eUnit = eFeet; // Default is feet if unspecified --- 148,157 ---- if (unit == "FT") eUnit = eFeet; else if (unit == "M") eUnit = eMeters; ! else { ! cerr << element->ReadFrom() << endl ! << "Unknown unit " << unit << " in DISTANCE waypoint component, " ! << Name << endl; ! throw("Malformed waypoint definition"); ! } } else { eUnit = eFeet; // Default is feet if unspecified *************** *** 145,172 **** bool FGWaypoint::Run(void ) { ! double target_latitude = target_latitude_pNode->getDoubleValue() * target_latitude_unit; ! double target_longitude = target_longitude_pNode->getDoubleValue() * target_longitude_unit; ! double source_latitude = source_latitude_pNode->getDoubleValue() * source_latitude_unit; ! double source_longitude = source_longitude_pNode->getDoubleValue() * source_longitude_unit; ! FGLocation source(source_longitude, source_latitude, radius); if (WaypointType == eHeading) { // Calculate Heading ! double heading_to_waypoint_rad = source.GetHeadingTo(target_longitude, ! target_latitude); ! double heading_to_waypoint = 0; ! if (eUnit == eDeg) heading_to_waypoint = heading_to_waypoint_rad * radtodeg; ! else heading_to_waypoint = heading_to_waypoint_rad; ! ! Output = heading_to_waypoint; } else { // Calculate Distance ! double wp_distance = source.GetDistanceTo(target_longitude, target_latitude); ! if (eUnit == eMeters) { ! Output = FeetToMeters(wp_distance); ! } else { ! Output = wp_distance; ! } } --- 174,195 ---- bool FGWaypoint::Run(void ) { ! double target_latitude_rad = target_latitude * target_latitude_unit; ! double target_longitude_rad = target_longitude * target_longitude_unit; ! FGLocation source(source_longitude * source_latitude_unit, ! source_latitude * source_longitude_unit, radius); if (WaypointType == eHeading) { // Calculate Heading ! double heading_to_waypoint_rad = source.GetHeadingTo(target_longitude_rad, ! target_latitude_rad); ! if (eUnit == eDeg) Output = heading_to_waypoint_rad * radtodeg; ! else Output = heading_to_waypoint_rad; } else { // Calculate Distance ! double wp_distance = source.GetDistanceTo(target_longitude_rad, ! target_latitude_rad); ! if (eUnit == eMeters) Output = FeetToMeters(wp_distance); ! else Output = wp_distance; } |
From: Bertrand <bco...@us...> - 2016-04-17 13:13:32
|
Update of /cvsroot/jsbsim/JSBSim/src/input_output In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv27952/src/input_output Modified Files: FGfdmSocket.h Log Message: Removed an obsolete member (issue reported by James Turner) Index: FGfdmSocket.h =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/input_output/FGfdmSocket.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -r1.23 -r1.24 *** FGfdmSocket.h 28 Mar 2015 15:03:44 -0000 1.23 --- FGfdmSocket.h 17 Apr 2016 13:13:29 -0000 1.24 *************** *** 115,119 **** int sckt; int sckt_in; - int udpsckt; DirectionType Direction; ProtocolType Protocol; --- 115,118 ---- |
From: Bertrand <bco...@us...> - 2016-04-17 13:12:09
|
Update of /cvsroot/jsbsim/JSBSim/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv27869/tests Modified Files: CMakeLists.txt Added Files: TestWaypoint.py Log Message: Added a test case for waypoints --- NEW FILE --- # TestWaypoint.py # # Test the waypoint system # # Copyright (c) 2016 Bertrand Coconnier # # 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 3 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, see <http://www.gnu.org/licenses/> # import os, math from JSBSim_utils import JSBSimTestCase, CreateFDM, RunTest class TestWaypoint(JSBSimTestCase): def test_waypoint(self): fdm = CreateFDM(self.sandbox) fdm.load_model('c310') aircraft_path = self.sandbox.path_to_jsbsim_file('aircraft') fdm.load_ic(os.path.join(aircraft_path, 'c310', 'reset00'), False) slr = 20925646.32546 # Sea Level Radius TestCases = ((0.25*math.pi, 0.5*math.pi, 0.0, 0.0), (0.0, 0.5*math.pi, math.pi, slr*0.25*math.pi), # North pole (0.5*math.pi, 0.5*math.pi, 0.0, slr*0.25*math.pi), # South pole (-0.5*math.pi, 0.5*math.pi, math.pi, slr*0.75*math.pi), (0.0, 0.0, 1.5*math.pi, slr*0.5*math.pi), (0.0, math.pi, 0.5*math.pi, slr*0.5*math.pi)) fdm['ic/lat-gc-rad'] = TestCases[0][0] fdm['ic/long-gc-rad'] = TestCases[0][1] for case in TestCases: fdm['guidance/target_wp_latitude_rad'] = case[0] fdm['guidance/target_wp_longitude_rad'] = case[1] fdm.run_ic() self.assertAlmostEqual(fdm['guidance/wp-heading-rad'], case[2]) self.assertAlmostEqual(fdm['guidance/wp-distance'], case[3]) RunTest(TestWaypoint) Index: CMakeLists.txt =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/tests/CMakeLists.txt,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -r1.24 -r1.25 *** CMakeLists.txt 27 Feb 2016 17:49:12 -0000 1.24 --- CMakeLists.txt 17 Apr 2016 13:12:05 -0000 1.25 *************** *** 40,44 **** TestPitotAngle CheckTrim ! TestChannelRate) foreach(test ${PYTHON_TESTS}) --- 40,45 ---- TestPitotAngle CheckTrim ! TestChannelRate ! TestWaypoint) foreach(test ${PYTHON_TESTS}) |
From: Bertrand <bco...@us...> - 2016-04-16 12:24:44
|
Update of /cvsroot/jsbsim/JSBSim/src/models In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25940/src/models Modified Files: FGAccelerations.cpp FGAccelerations.h FGPropagate.cpp FGPropagate.h Log Message: The forces/hold-down feature now zeroes the velocities to make sure that the aircraft is motionless once the property is enabled. To get this result the property is now managed by FGFDMExec that coordinates FGAccelerations and FGPropagate so that they remain in a consistent state. Index: FGAccelerations.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGAccelerations.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -r1.27 -r1.28 *** FGAccelerations.cpp 16 Apr 2016 12:01:51 -0000 1.27 --- FGAccelerations.cpp 16 Apr 2016 12:24:39 -0000 1.28 *************** *** 75,79 **** gravType = gtWGS84; gravTorque = false; - HoldDown = 0; vPQRidot.InitMatrix(); --- 75,78 ---- *************** *** 122,126 **** CalculateUVWdot(); // Translational rate derivative ! ResolveFrictionForces(in.DeltaT * rate); // Update rate derivatives with friction forces Debug(2); --- 121,126 ---- CalculateUVWdot(); // Translational rate derivative ! if (!FDMExec->GetHoldDown()) ! ResolveFrictionForces(in.DeltaT * rate); // Update rate derivatives with friction forces Debug(2); *************** *** 158,162 **** // frame. // if (HoldDown && !FDMExec->GetTrimStatus()) { ! if (HoldDown) { // The rotational acceleration in ECI is calculated so that the rotational // acceleration is zero in the body frame. --- 158,162 ---- // frame. // if (HoldDown && !FDMExec->GetTrimStatus()) { ! if (FDMExec->GetHoldDown()) { // The rotational acceleration in ECI is calculated so that the rotational // acceleration is zero in the body frame. *************** *** 189,193 **** void FGAccelerations::CalculateUVWdot(void) { ! if (HoldDown && !FDMExec->GetTrimStatus()) vBodyAccel.InitMatrix(); else --- 189,193 ---- void FGAccelerations::CalculateUVWdot(void) { ! if (FDMExec->GetHoldDown() && !FDMExec->GetTrimStatus()) vBodyAccel.InitMatrix(); else *************** *** 201,219 **** // Include Gravitation accel switch (gravType) { ! case gtStandard: ! { ! double radius = in.vInertialPosition.Magnitude(); ! vGravAccel = -(in.GAccel / radius) * in.vInertialPosition; ! } ! break; ! case gtWGS84: ! vGravAccel = in.Tec2i * in.J2Grav; ! break; } ! if (HoldDown) { // The acceleration in ECI is calculated so that the acceleration is zero // in the body frame. ! vUVWidot = -1.0 * (in.Tb2i * vUVWdot); vUVWdot.InitMatrix(); } --- 201,219 ---- // Include Gravitation accel switch (gravType) { ! case gtStandard: ! { ! double radius = in.vInertialPosition.Magnitude(); ! vGravAccel = -(in.GAccel / radius) * in.vInertialPosition; ! } ! break; ! case gtWGS84: ! vGravAccel = in.Tec2i * in.J2Grav; ! break; } ! if (FDMExec->GetHoldDown()) { // The acceleration in ECI is calculated so that the acceleration is zero // in the body frame. ! vUVWidot = in.vOmegaPlanet * (in.vOmegaPlanet * in.vInertialPosition); vUVWdot.InitMatrix(); } *************** *** 225,228 **** --- 225,240 ---- //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + void FGAccelerations::SetHoldDown(bool hd) + { + if (hd) { + vUVWidot = in.vOmegaPlanet * (in.vOmegaPlanet * in.vInertialPosition); + vUVWdot.InitMatrix(); + vPQRidot = in.vPQRi * (in.Ti2b * in.vOmegaPlanet); + vPQRdot.InitMatrix(); + } + } + + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // Resolves the contact forces just before integrating the EOM. // This routine is using Lagrange multipliers and the projected Gauss-Seidel *************** *** 370,375 **** PropertyManager->Tie("forces/fby-gear-lbs", this, eY, (PMF)&FGAccelerations::GetGroundForces); PropertyManager->Tie("forces/fbz-gear-lbs", this, eZ, (PMF)&FGAccelerations::GetGroundForces); - - PropertyManager->Tie("forces/hold-down", this, &FGAccelerations::GetHoldDown, &FGAccelerations::SetHoldDown); } --- 382,385 ---- Index: FGAccelerations.h =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGAccelerations.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -r1.18 -r1.19 *** FGAccelerations.h 16 Apr 2016 12:01:51 -0000 1.18 --- FGAccelerations.h 16 Apr 2016 12:24:39 -0000 1.19 *************** *** 316,325 **** such as for rockets on a launch pad with engines ignited. @param hd enab |
From: Bertrand <bco...@us...> - 2016-04-16 12:24:42
|
Update of /cvsroot/jsbsim/JSBSim/src In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25940/src Modified Files: FGFDMExec.cpp FGFDMExec.h Log Message: The forces/hold-down feature now zeroes the velocities to make sure that the aircraft is motionless once the property is enabled. To get this result the property is now managed by FGFDMExec that coordinates FGAccelerations and FGPropagate so that they remain in a consistent state. Index: FGFDMExec.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/FGFDMExec.cpp,v retrieving revision 1.188 retrieving revision 1.189 diff -C2 -r1.188 -r1.189 *** FGFDMExec.cpp 16 Apr 2016 12:01:51 -0000 1.188 --- FGFDMExec.cpp 16 Apr 2016 12:24:39 -0000 1.189 *************** *** 101,104 **** --- 101,105 ---- ResetMode = 0; RandomSeed = 0; + HoldDown = false; IncrementThenHolding = false; // increment then hold is off by default *************** *** 174,177 **** --- 175,179 ---- instance->Tie("simulation/frame", (int *)&Frame, false); instance->Tie("simulation/trim-completed", (int *)&trim_completed, false); + instance->Tie("forces/hold-down", this, &FGFDMExec::GetHoldDown, &FGFDMExec::SetHoldDown); Constructing = false; *************** *** 621,624 **** --- 623,639 ---- //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + void FGFDMExec::SetHoldDown(bool hd) + { + HoldDown = hd; + Accelerations->SetHoldDown(hd); + if (hd) { + Propagate->in.vPQRidot = Accelerations->GetPQRidot(); + Propagate->in.vUVWidot = Accelerations->GetUVWidot(); + } + Propagate->SetHoldDown(hd); + } + + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + vector <string> FGFDMExec::EnumerateFDMs(void) { Index: FGFDMExec.h =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/FGFDMExec.h,v retrieving revision 1.104 retrieving revision 1.105 diff -C2 -r1.104 -r1.105 *** FGFDMExec.h 13 Dec 2015 07:54:48 -0000 1.104 --- FGFDMExec.h 16 Apr 2016 12:24:39 -0000 1.105 *************** *** 579,582 **** --- 579,593 ---- void Initialize(FGInitialCondition *FGIC); + /** Sets the property forces/hold-down. This allows to do hard 'hold-down' + such as for rockets on a launch pad with engines ignited. + @param hd enables the 'hold-down' function if non-zero + */ + void SetHoldDown(bool hd); + + /** Gets the value of the property forces/hold-down. + @result zero if the 'hold-down' function is disabled, non-zero otherwise. + */ + bool GetHoldDown(void) const {return HoldDown;} + private: int Error; *************** *** 633,637 **** bool StandAlone; FGPropertyManager* instance; ! // The FDM counter is used to give each child FDM an unique ID. The root FDM has the ID 0 unsigned int* FDMctr; --- 644,650 ---- bool StandAlone; FGPropertyManager* instance; ! ! bool HoldDown; ! // The FDM counter is used to give each child FDM an unique ID. The root FDM has the ID 0 unsigned int* FDMctr; |
From: Bertrand <bco...@us...> - 2016-04-16 12:01:54
|
Update of /cvsroot/jsbsim/JSBSim/src In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv24929/src Modified Files: FGFDMExec.cpp Log Message: Moved CalculateQuatDot() from FGAccelerations to FGPropagate since the quaternion derivative is a velocity, not an acceleration. Also it relies only on values computed by FGPropagate. Moreover the quaternion derivative was not updated when either vPQRi or qAttitudeECI were updated. Index: FGFDMExec.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/FGFDMExec.cpp,v retrieving revision 1.187 retrieving revision 1.188 diff -C2 -r1.187 -r1.188 *** FGFDMExec.cpp 31 Jan 2016 11:12:59 -0000 1.187 --- FGFDMExec.cpp 16 Apr 2016 12:01:51 -0000 1.188 *************** *** 346,350 **** case ePropagate: Propagate->in.vPQRidot = Accelerations->GetPQRidot(); - Propagate->in.vQtrndot = Accelerations->GetQuaterniondot(); Propagate->in.vUVWidot = Accelerations->GetUVWidot(); Propagate->in.DeltaT = dT; --- 346,349 ---- *************** *** 498,502 **** Accelerations->in.Tec2b = Propagate->GetTec2b(); Accelerations->in.Tec2i = Propagate->GetTec2i(); - Accelerations->in.qAttitudeECI = Propagate->GetQuaternionECI(); Accelerations->in.Moment = Aircraft->GetMoments(); Accelerations->in.GroundMoment = GroundReactions->GetMoments(); --- 497,500 ---- |
From: Bertrand <bco...@us...> - 2016-04-16 12:01:54
|
Update of /cvsroot/jsbsim/JSBSim/src/models In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv24929/src/models Modified Files: FGAccelerations.cpp FGAccelerations.h FGPropagate.cpp FGPropagate.h Log Message: Moved CalculateQuatDot() from FGAccelerations to FGPropagate since the quaternion derivative is a velocity, not an acceleration. Also it relies only on values computed by FGPropagate. Moreover the quaternion derivative was not updated when either vPQRi or qAttitudeECI were updated. Index: FGAccelerations.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGAccelerations.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -r1.26 -r1.27 *** FGAccelerations.cpp 31 Jan 2016 11:13:00 -0000 1.26 --- FGAccelerations.cpp 16 Apr 2016 12:01:51 -0000 1.27 *************** *** 82,86 **** vGravAccel.InitMatrix(); vBodyAccel.InitMatrix(); - vQtrndot = FGQuaternion(0,0,0); bind(); --- 82,85 ---- *************** *** 106,110 **** vGravAccel.InitMatrix(); vBodyAccel.InitMatrix(); - vQtrndot = FGQuaternion(0,0,0); return true; --- 105,108 ---- *************** *** 123,127 **** CalculatePQRdot(); // Angular rate derivative CalculateUVWdot(); // Translational rate derivative - CalculateQuatdot(); // Angular orientation derivative ResolveFrictionForces(in.DeltaT * rate); // Update rate derivatives with friction forces --- 121,124 ---- *************** *** 174,190 **** //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - // Compute the quaternion orientation derivative - // - // vQtrndot is the quaternion derivative. - // Reference: See Stevens and Lewis, "Aircraft Control and Simulation", - // Second edition (2004), eqn 1.5-16b (page 50) - - void FGAccelerations::CalculateQuatdot(void) - { - // Compute quaternion orientation derivative on current body rates - vQtrndot = in.qAttitudeECI.GetQDot(in.vPQRi); - } - - //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // This set of calculations results in the body and inertial frame accelerations // being computed. --- 171,174 ---- *************** *** 352,356 **** CalculatePQRdot(); // Angular rate derivative CalculateUVWdot(); // Translational rate derivative - CalculateQuatdot(); // Angular orientation derivative ResolveFrictionForces(0.); // Update rate derivatives with friction forces } --- 336,339 ---- Index: FGAccelerations.h =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGAccelerations.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** FGAccelerations.h 31 Jan 2015 14:56:21 -0000 1.17 --- FGAccelerations.h 16 Apr 2016 12:01:51 -0000 1.18 *************** *** 45,49 **** #include "math/LagrangeMultiplier.h" #include "math/FGMatrix33.h" - #include "math/FGQuaternion.h" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --- 45,48 ---- *************** *** 136,150 **** bool Run(bool Holding); - /** Retrieves the time derivative of the body orientation quaternion. - Retrieves the time derivative of the body orientation quaternion based on - the rate of change of the orientation between the body and the ECI frame. - The quaternion returned is represented by an FGQuaternion reference. The - quaternion is 1-based, so that the first element can be retrieved using - the "()" operator. - units rad/sec^2 - @return The time derivative of the body orientation quaternion. - */ - const FGQuaternion& GetQuaterniondot(void) const {return vQtrndot;} - /** Retrieves the body axis acceleration. Retrieves the computed body axis accelerations based on the --- 135,138 ---- *************** *** 348,353 **** /// Transformation matrix from the ECEF to the ECI frame FGMatrix33 Tec2i; - /// Orientation quaternion of the body with respect to the ECI frame - FGQuaternion qAttitudeECI; /// Total moments applied to the body except friction and gravity (expressed in the body frame) FGColumnVector3 Moment; --- 336,339 ---- *************** *** 388,392 **** FGColumnVector3 vPQRdot, vPQRidot; FGColumnVector3 vUVWdot, vUVWidot; - FGQuaternion vQtrndot; FGColumnVector3 vBodyAccel; FGColumnVector3 vGravAccel; --- 374,377 ---- *************** *** 399,403 **** void CalculatePQRdot(void); - void CalculateQuatdot(void); void CalculateUVWdot(void); --- 384,387 ---- Index: FGPropagate.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGPropagate.cpp,v retrieving revision 1.128 retrieving revision 1.129 diff -C2 -r1.128 -r1.129 *** FGPropagate.cpp 23 Jan 2016 10:48:11 -0000 1.128 --- FGPropagate.cpp 16 Apr 2016 12:01:51 -0000 1.129 *************** *** 180,183 **** --- 180,184 ---- CalculateInertialVelocity(); // Translational position derivative + CalculateQuatdot(); // Angular orientation derivative } *************** *** 190,194 **** VState.dqUVWidot.assign(5, in.vUVWidot); VState.dqInertialVelocity.assign(5, VState.vInertialVelocity); ! VState.dqQtrndot.assign(5, in.vQtrndot); } --- 191,195 ---- VState.dqUVWidot.assign(5, in.vUVWidot); VState.dqInertialVelocity.assign(5, VState.vInertialVelocity); ! VState.dqQtrndot.assign(5, VState.vQtrndot); } *************** *** 222,226 **** // Propagate rotational / translational velocity, angular /translational position, respectively. ! Integrate(VState.qAttitudeECI, in.vQtrndot, VState.dqQtrndot, dt, integrator_rotational_position); Integrate(VState.vPQRi, in.vPQRidot, VState.dqPQRidot, dt, integrator_rotational_rate); Integrate(VState.vInertialPosition, VState.vInertialVelocity, VState.dqInertialVelocity, dt, integrator_translational_position); --- 223,227 ---- // Propagate rotational / translational velocity, angular /translational position, respectively. ! Integrate(VState.qAttitudeECI, VState.vQtrndot, VState.dqQtrndot, dt, integrator_rotational_position); Integrate(VState.vPQRi, in.vPQRidot, VState.dqPQRidot, dt, integrator_rotational_rate); Integrate(VState.vInertialPosition, VState.vInertialVelocity, VState.dqInertialVelocity, dt, integrator_translational_position); *************** *** 256,259 **** --- 257,263 ---- VState.vPQR = VState.vPQRi - Ti2b * in.vOmegaPlanet; + // Angular orientation derivative + CalculateQuatdot(); + VState.qAttitudeLocal = Tl2b.GetQuaternion(); *************** *** 266,269 **** --- 270,286 ---- //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + // Compute the quaternion orientation derivative + // + // vQtrndot is the quaternion derivative. + // Reference: See Stevens and Lewis, "Aircraft Control and Simulation", + // Second edition (2004), eqn 1.5-16b (page 50) + + void FGPropagate::CalculateQuatdot(void) + { + // Compute quaternion orientation derivative on current body rates + VState.vQtrndot = VState.qAttitudeECI.GetQDot(VState.vPQRi); + } + + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // Transform the velocity vector of the body relative to the origin (Earth // center) to be expressed in the inertial frame, and add the vehicle velocity *************** *** 458,461 **** --- 475,479 ---- UpdateBodyMatrices(); VState.qAttitudeLocal = Tl2b.GetQuaternion(); + CalculateQuatdot(); } *************** *** 473,476 **** --- 491,495 ---- VState.vPQRi = Ti2b * vRates; VState.vPQR = VState.vPQRi - Ti2b * in.vOmegaPlanet; + CalculateQuatdot(); } *************** *** 554,557 **** --- 573,577 ---- VState.vPQRi = VState.vPQR + Ti2b * in.vOmegaPlanet; VState.vInertialPosition = vstate.vInertialPosition; + CalculateQuatdot(); } Index: FGPropagate.h =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGPropagate.h,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -r1.83 -r1.84 *** FGPropagate.h 23 Jan 2016 10:48:11 -0000 1.83 --- FGPropagate.h 16 Apr 2016 12:01:51 -0000 1.84 *************** *** 134,137 **** --- 134,139 ---- FGQuaternion qAttitudeECI; + FGQuaternion vQtrndot; + FGColumnVector3 vInertialVelocity; *************** *** 230,233 **** --- 232,246 ---- const FGColumnVector3& GetPQRi(void) const {return VState.vPQRi;} + /** Retrieves the time derivative of the body orientation quaternion. + Retrieves the time derivative of the body orientation quaternion based on + the rate of change of the orientation between the body and the ECI frame. + The quaternion returned is represented by an FGQuaternion reference. The + quaternion is 1-based, so that the first element can be retrieved using + the "()" operator. + units rad/sec^2 + @return The time derivative of the body orientation quaternion. + */ + const FGQuaternion& GetQuaterniondot(void) const {return VState.vQtrndot;} + /** Retrieves the Euler angles that define the vehicle orientation. Extracts the Euler angles from the quaternion that stores the orientation *************** *** 588,592 **** struct Inputs { FGColumnVector3 vPQRidot; - FGQuaternion vQtrndot; FGColumnVector3 vUVWidot; FGColumnVector3 vOmegaPlanet; --- 601,604 ---- *************** *** 627,630 **** --- 639,643 ---- void CalculateInertialVelocity(void); void CalculateUVW(void); + void CalculateQuatdot(void); void Integrate( FGColumnVector3& Integrand, |
From: Bertrand <bco...@us...> - 2016-04-16 11:54:40
|
Update of /cvsroot/jsbsim/JSBSim/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv24529/tests Modified Files: TestHoldDown.py Log Message: Added a new test case with ground reactions and check that velocities are zeroed when the hold down feature is enabled. Index: TestHoldDown.py =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/tests/TestHoldDown.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** TestHoldDown.py 30 Jan 2016 18:50:24 -0000 1.2 --- TestHoldDown.py 16 Apr 2016 11:54:37 -0000 1.3 *************** *** 20,24 **** import os ! from JSBSim_utils import JSBSimTestCase, CreateFDM, RunTest --- 20,24 ---- import os ! from JSBSim_utils import JSBSimTestCase, CreateFDM, RunTest, ExecuteUntil *************** *** 39,41 **** --- 39,68 ---- self.assertAlmostEqual(fdm['position/h-sl-ft'], h0, delta=1E-5) + def test_hold_down_with_gnd_reactions(self): + fdm = CreateFDM(self.sandbox) + fdm.load_script(self.sandbox.path_to_jsbsim_file('scripts', + 'c1721.xml')) + fdm.run_ic() + ExecuteUntil(fdm, 0.25) + + fdm['forces/hold-down'] = 1.0 + h0 = fdm['position/h-sl-ft'] + pitch = fdm['attitude/pitch-rad'] + roll = fdm['attitude/roll-rad'] + heading = fdm['attitude/heading-true-rad'] + + while fdm['simulation/sim-time-sec'] < 2.0: + fdm.run() + self.assertAlmostEqual(fdm['accelerations/pdot-rad_sec2'], 0.0) + self.assertAlmostEqual(fdm['accelerations/qdot-rad_sec2'], 0.0) + self.assertAlmostEqual(fdm['accelerations/rdot-rad_sec2'], 0.0) + self.assertAlmostEqual(fdm['accelerations/udot-ft_sec2'], 0.0) + self.assertAlmostEqual(fdm['accelerations/vdot-ft_sec2'], 0.0) + self.assertAlmostEqual(fdm['accelerations/wdot-ft_sec2'], 0.0) + + self.assertAlmostEqual(fdm['position/h-sl-ft'], h0, delta=1E-6) + self.assertAlmostEqual(fdm['attitude/pitch-rad'], pitch) + self.assertAlmostEqual(fdm['attitude/roll-rad'], roll) + self.assertAlmostEqual(fdm['attitude/heading-true-rad'], heading) + RunTest(TestHoldDown) |
From: Bertrand <bco...@us...> - 2016-04-16 11:00:15
|
Update of /cvsroot/jsbsim/JSBSim/src/models In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv21973/src/models Modified Files: FGFCSChannel.h Log Message: Fixed a bug that prevented the systems to be correctly initialized (the second Run() from FGFDMExec::RunIC() was skipped). Index: FGFCSChannel.h =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGFCSChannel.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** FGFCSChannel.h 3 Apr 2016 17:06:24 -0000 1.9 --- FGFCSChannel.h 16 Apr 2016 11:00:11 -0000 1.10 *************** *** 128,133 **** if (OnOffNode && !OnOffNode->getBoolValue()) return; ! if (fcs->GetDt() != 0.0) ++ExecFrameCountSinceLastRun; // channel will be run at rate 1 if trimming, or when the next execrate --- 128,138 ---- if (OnOffNode && !OnOffNode->getBoolValue()) return; ! if (fcs->GetDt() != 0.0) { ! if (ExecFrameCountSinceLastRun >= ExecRate) { ! ExecFrameCountSinceLastRun = 0; ! } ! ++ExecFrameCountSinceLastRun; + } // channel will be run at rate 1 if trimming, or when the next execrate *************** *** 137,143 **** FCSComponents[i]->Run(); } - - if (ExecFrameCountSinceLastRun >= ExecRate) - ExecFrameCountSinceLastRun = 0; } /// Get the channel rate --- 142,145 ---- |