Comments (11)
Maybe time then to close this issue? @bcoconni your remarks look wise and indicating years of real life development experience, thanks 🥇 Hope to see you working on JSBsim in the long long future.
from jsbsim.
One more example -- distance functions for each INS waypoint:
https://gitlab.com/mdanil/Tu-144/blob/master/Tu-144-jsbsim/NPK/Orbita/func/dist.xml
from jsbsim.
@Mike402
There are already some features in JSBSim to handle the duplication of XML definitions. At the moment they are limited to:
- engines definition where you can use the special character
#
to replace the engine number. - file inclusion with the
file=
attribute
If we plan to extend that to other elements, I think we should design how the thing should work before going any further. An important point to my view is consistency with the existing features.
Suggestions ?
from jsbsim.
from jsbsim.
@Mike402 @abassign
To respond to the request of reducing the duplication of XML code in your aircraft models, I just pushed a new commit a7574e8 to JSBSim and 27ddcedad
to FlightGear that allows to use "template functions" everywhere in JSBSim. The idea is to have generic functions which can be repeatedly used in the aircraft models.
For example, say you need to multiply some values by 2 in several places in your model. First, you need to declare a template
function like below:
<function name="twice" type="template"> <!-- the type "template" tells JSBSim that it is a special function that will be evaluated later -->
<product>
<property> # </property> <!-- The character # stands for the variable of the function -->
<value> 2.0 </value>
</product>
</function>
Notice in particular the usage of the special character #
. It can appear several times in a given template function.
The second step is to use that template function everywhere you need it. For that you must use the attribute apply
of a property.
<function name="fct1">
<sum>
<pi>
<property apply="twice"> prop1 </property> <!-- the attribute apply="twice" tells JSBSim to apply the template function "twice" to the property "prop1" before proceeding to the evaluation of the function "fct1"-->
<sin>
<property apply="twice"> theta </property> <!-- same as above -->
</sin>
</sum>
</function>
This is equivalent to
<function name="fct1">
<sum>
<pi>
<product>
<property> prop1 </property>
<value> 2.0 </value>
</product>
<sin>
<product>
<property> theta </property>
<value> 2.0 </value>
</product>
</sin>
</sum>
</function>
The feature is available in the branch next
of FlightGear. Could you please test that feature and give feedback in that issue report ? Since you both requested to have a feature similar to that, or asked for new functions, I suppose that you can be beta testers ? 😃
from jsbsim.
Thanks, it will take me a while to wrap my head around this and come up with an efficient use scheme, but this already looks useful!
I think #84 can be merged with this issue, as now there's cyclic clipto, and beside that sawtooth functions can be done as templates?
from jsbsim.
But I can immediately say that if the number of arguments is limited to 1, this would be limited to only the simplest use cases?
from jsbsim.
But I can immediately say that if the number of arguments is limited to 1, this would be limited to only the simplest use cases ?
I am sure people can be creative about using such a feature 😃 And I'd rather discuss about how to solve a problem on a real case rather than jumping to negative conclusions. This is not very supportive regarding the amount of time that has been involved in developing this feature 😭
from jsbsim.
from jsbsim.
No no I didn't meant to say it's useless, I, for one, can immediately think of a hundred uses for it in my plane.
This was purposely provocative 😈 to point out that we should focus on problem solving rather than on general statements. I'm sure you will find plenty of creative ways to use the template function feature 😄
I'm just saying that with multi-argument support it would have been maybe five hundred.
Right but we should move one step at a time.
My plan is to collect feedback about the current implementation of template functions with uses, problems and bugs issued from real case uses. Only then we might consider improvements or changes to the feature.
I have had bad experiences about over-engineering things due to wrong anticipations of future needs of users. This ended up with additional, almost useless, code to maintain for backward compatibility and a redesign of the feature.
from jsbsim.
@OpenUAS I guess you are right. We got no feedback on that feature for 2 years now, it seems it's time to close the issue now.
If someone wants to report some bugs/feature request please open a new issue. Feedback and support will be handled in Discussions.
Hope to see you working on JSBsim in the long long future.
I've been involved in the project for more than 10 years now. Who knows may be there are some more 10 years of involvement ahead of me ? 😄 Anyway thanks for the positive feedback it's always very much appreciated 👍
from jsbsim.
Related Issues (20)
- JSBSim Simulink Function HOT 36
- Rust HOT 13
- Can autopilot feature come to jsbsim- unreal engine 5? HOT 2
- MSVC: toupper is not a member of std HOT 1
- Missing target_include_directories in libJSBSim
- JSBSIM_ prefix in CMake options
- Cython warnings about 'tp_print' which is deprecated
- Wrong calculation of vPQRdot in FGAccelerations class HOT 4
- Fixing the mixture for JSBSim piston aircraft HOT 54
- Request: turbine spindown table or property support HOT 2
- Aircraft crashed on air when rolling consecutively HOT 15
- How Jsbsim models the "+" shaped tail fins of missiles and rockets. HOT 1
- JSBSimFlightDynamicsModel could not be loaded in Unreal Engine HOT 4
- JSBSim interface to Matlab on Windows: throttle command from joystick doesn't work HOT 5
- Trim succeeds and results in NaN values HOT 1
- JSBSim and s-function have different results and different reactivity themselves HOT 1
- Building for Unreal 5 on Linux not working HOT 7
- Javascript alternative? HOT 2
- Linearization and simplex trim from console executable and xml script HOT 16
- FGTurbine Shutdown Spin HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsbsim.