Board index FlightGear Development Aircraft

Control Channels on Custom Aircraft

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

Control Channels on Custom Aircraft

Postby zero_sync_rate » Thu Apr 19, 2018 6:05 pm

I'm developing a simulator model for a custom aircraft and need to add more channels to the flight control system. I've configured the joystick file to use all of the available channels under /controls/flight/ including rudder, elevator, aileron and their -trim variables. Is it possible to add custom channel names to the /controls/flight/ variable category? It also seems that the flight control variables are also automatically duplicated to the JSBIM variables. If I were to add a flight control channel, how would I also make this visible to the JSBSIM flight control model?

Ideally I would create a new variable called /controls/flight/channel-x1 that is controlled by one of the joystick inputs and the input would be transparent to JSBSIM, perhaps linked by a variable called /fdm/jsbsim/fcs/channel-x1-cmd-norm, so that it can influence either the propulsion or aerodynamics models.

Is this possible?

Thanks in advance,

Nick
zero_sync_rate
 
Posts: 10
Joined: Thu Apr 19, 2018 5:49 pm
Location: Toronto, Canada
Version: 2018.1.1
OS: Windows 10

Re: Control Channels on Custom Aircraft

Postby AndersG » Thu Apr 19, 2018 8:01 pm

Yes, it is easily doable.

"Channels" under /controls/flight/ are just plain properties like most others but the JSBSim connection is hard-coded for the default set. To connect them to new properties in the /fdm/jsbsim/ subtree you can use aliases.

Here are an example from my Short S.23 Empire flying boat defining new engine properties under /controls/engines/ :
Short-Empire-set.xml line 324

To make the JSBSim-side properties work well the -set file also has to define and initialize them:
Short-Empire-set.xml line 596
(This is due to JSBSim being a bit sensitive about finding that declared properties already exists - it neglects to initialize them then but alias targets from the -set file are created early but are not initialized.)

On the JSBSim-side these properties are just declared in the systems they are input to (mostly for use with JSBSim/standalone - in FlightGear they'll already exist due to the -set file.
The starter properties in System/engines.xml

This setup unlike the "standard" properties are created at the aircraft level rather than being hard-coded in the FlightGear-JSBSim interface C++ code.
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: 2442
Joined: Wed Nov 29, 2006 9:20 am
Location: Göteborg, Sweden
Callsign: SE-AG
OS: Debian GNU Linux

Re: Control Channels on Custom Aircraft

Postby zero_sync_rate » Wed May 23, 2018 6:59 pm

Thanks Anders, your suggestion to use an alias in the aircraft-set.xml file worked perfectly.
zero_sync_rate
 
Posts: 10
Joined: Thu Apr 19, 2018 5:49 pm
Location: Toronto, Canada
Version: 2018.1.1
OS: Windows 10


Return to Aircraft

Who is online

Users browsing this forum: Google [Bot] and 3 guests