Board index FlightGear Development Nasal

Reading Aircraft information using Nasal

Nasal is the scripting language of FlightGear.

Reading Aircraft information using Nasal

Postby Muhammad Ahmad » Sat Nov 17, 2018 6:14 am

I need to read or display some information regarding aircraft flying like position, velocity, orientation etc how can I do it in the nasal console
In simple I want to control aircraft via nasal console is that possible if so how can I do it
Muhammad Ahmad
 
Posts: 16
Joined: Sat Nov 03, 2018 7:05 am

Re: Reading Aircraft information using Nasal

Postby Hooray » Sat Nov 17, 2018 6:41 am

We have previously answered this in one of your other threads - in general, you will want to look at the property tree, especially at the /position, /orientation and /velocities nodes. There is also a dedicated /fdm node.

The Nasal bindings to access the property tree are primarily getprop/setprop, and props.nas for an object-oriented interface:

http://wiki.flightgear.org/Nasal_library#getprop.28.29
http://wiki.flightgear.org/Nasal_library#setprop.28.29

http://wiki.flightgear.org/Nasal_library/props

As we said, things are slightly different for AI/MP aircraft, because you don't currently have access to an actual FDM, autopilot or route manager instance there.

http://wiki.flightgear.org/Howto:Workin ... properties

tanker.nas is basically what you need, but using that makes only sense if you understand how the property tree is used, and how the data there relates to Nasal variables and vice versa (you cannot necessarily access all variables via the property tree, and you may not necessarily always want to use the property tree for your variables either).

Again: You will definitely want to make sure that you understand how the property browser and Nasal console work, before writing any real code. Otherwise, it will not make much sense to you.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11329
Joined: Tue Mar 25, 2008 8:40 am


Return to Nasal

Who is online

Users browsing this forum: No registered users and 2 guests