Board index FlightGear Development Aircraft

Engine and thruster location as variable

Questions and discussion about creating aircraft. Flight dynamics, 3d models, cockpits, systems, animation, textures.

Engine and thruster location as variable

Postby zero_sync_rate » Thu May 31, 2018 4:43 pm

I'm working on a multi-engine aircraft and each of the engines have the same z co-ordinate. As I experiment with the aircraft configuration in flightgear, I'd like to be able to easily change the co-ordinate by creating a variable called fdm/jsbsim/propulsion/zCT and assigning it to the z co-ordinate for each engine and thruster. My thought now is to create a property with an assigned value and substitute within the z co-ord call as shown below. This unfortunately does not work and causes flightgear to crash on start-up.

Here is the relevant code from the aircraft.xml file:

Code: Select all
<propulsion>

    <property type="double" value="1.00">propulsion/zCT</property>

    <engine file="motor">
        <location unit="M">
            <x> 1.00 </x>
            <y> 1.00 </y>
            <z>
                <property> propulsion/zCT </property>
           </z>
        </location>
...
    </engine>
...
</propulsion>


It seems as though the engine/location/z parameter is expecting a "value" and it's having trouble evaluating the property as a value. Anyone out there have an idea of how to implement a variable co-ordinate for engine placement?

Thanks in advance.

Nick
Last edited by Johan G on Thu May 31, 2018 9:43 pm, edited 1 time in total.
Reason: Added [code] tags. They can be added manually or with the [^_ ] button.
zero_sync_rate
 
Posts: 10
Joined: Thu Apr 19, 2018 6:49 pm
Location: Toronto, Canada
Version: 2018.1.1
OS: Windows 10

Re: Engine and thruster location as variable

Postby zero_sync_rate » Thu May 31, 2018 8:44 pm

Found one way to do it using XML tricks.

At the top of your XML file define an "entity"

Code: Select all
<!DOCTYPE constants [
<!ENTITY zCT "1.00">
]>

which will perform a text substituion everywhere in the XML file that it sees $zCT;

Then the x,y,z co-ords input looks like this:

Code: Select all
    <engine file="motor">
        <location unit="M">
            <x> 1.00 </x>
            <y> 1.00 </y>
            <z> &zCT; </z>
...

Hope this helps someone else!
Last edited by Johan G on Thu May 31, 2018 9:45 pm, edited 1 time in total.
Reason: Added [code] tags. They can be added manually or with the [^_ ] button.
zero_sync_rate
 
Posts: 10
Joined: Thu Apr 19, 2018 6:49 pm
Location: Toronto, Canada
Version: 2018.1.1
OS: Windows 10

Re: Engine and thruster location as variable

Postby Necolatis » Thu May 31, 2018 9:52 pm

It would actually be nice to have and angles and location of thrusters being properties that can be manipulated in real time.
For VTOL and vector thrust.
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2233
Joined: Mon Oct 29, 2012 1:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2020.3.19
OS: Windows 10

Re: Engine and thruster location as variable

Postby AndersG » Thu May 31, 2018 10:23 pm

You mean like the properties
propulsion/engine/pitch-angle-rad
propulsion/engine/yaw-angle-rad
for JSBSim?
So, orientation, at least for piston engines, can be manipulated at run time.
Position, however, I don't think can be changed at run time.

The XML entity trick is kind of neat, btw.
Callsign: SE-AG
Aircraft (uhm...): Submarine Scout, Zeppelin NT, ZF Navy free balloon, Nordstern, Hindenburg, Short Empire flying-boat, ZNP-K, North Sea class, MTB T21 class, U.S.S. Monitor, MFI-9B, Type UB I submarine, Gokstad ship, Renault FT.
AndersG
 
Posts: 2524
Joined: Wed Nov 29, 2006 10:20 am
Location: Göteborg, Sweden
Callsign: SE-AG
OS: Debian GNU Linux

Re: Engine and thruster location as variable

Postby PINTO » Thu May 31, 2018 10:35 pm

I solved this in my AV-8B by using external forces to first nullify the engine output and using 4 other external forces to distribute the thrust to the individual output nozzles. The external force's orientation can be moved during runtime in this manner, although I'm not sure about spatially.
Actively developing the MiG-21bis (github repo) (forum thread) (dev discord) (fg wiki)

http://opredflag.com is an active flightgear dogfighting community (using a system that isn’t bombable)
User avatar
PINTO
 
Posts: 966
Joined: Wed Oct 21, 2015 7:28 pm
Callsign: pinto
Version: stable
OS: Win10


Return to Aircraft

Who is online

Users browsing this forum: No registered users and 15 guests