Jump to content

You're browsing the 2004-2023 VATSIM Forums archive. All content is preserved in a read-only fashion.
For the latest forum posts, please visit https://forum.vatsim.net.

Need to find something? Use the Google search below.

Accessing ground traffic through data accessors or datarefs


Joao Cabral 1114644
 Share

Recommended Posts

Joao Cabral 1114644
Posted
Posted

Apologies if this has been answered elsewhere in this forum, I couldn't find it

 

It it at all possible to access surrounding traffic (naturally only when connected to VATSIM) via XPLM DataRefs or DataAccessors?

 

The reason for asking is because I'm writing a plugin which displays surrounding moving traffic on a taxi map when on the ground at an Airport. I'm able to display X-Plane's AI traffic but when XSquawkbox kicks in, what it writes to X-Plane's AI 20 plane positions seems to be inconsistent and/or incomplete (wrong headings, etc).

 

So I'm wondering if there's a way to obtain a list of surrounding planes (callsign, lat, lon, altitude, heading, speed) to a running X-Plane plugin via a specific data accessor or via libxplanemp somehow from XSquawkbox's instance.

 

Any pointer in the right direction would be much appreciated, many thanks!

Link to comment
Share on other sites

Christopher Collins
Posted
Posted

I'll have a think about this one before I cut 1.4 and see if I can't work something in for you that's a bit more complete.

 

I've already been planning to rework the TCAS integration (it needs to be rewritten for XSB2.0 as it is so we're not reliant on the TCAS hack (which is likely to cause performance issues with the Vulkan renderer changes), and this fits in well with those planned changes.

 

The functionality as it stands currently comes entirely from libxplanemp - From memory, right now, it will rewrite the AI aircraft datarefs during the panel rendering phase only - and it only transfers the latlon/alt data of aircraft with transponders enabled as that's all that's required for TCAS. You can tell how many datarefs are valid by looking at the number of AI aircraft returned by the AI aircraft system (it sets it back to 1 during all other phases so the 3D view doesn't render the AI aircraft - this is what causes the double-aircraft bug if you try to use XSB when it doesn't have exclusive control of the AI aircraft prior to 1.4 - I fixed that in libxplanemp not that long ago). You can find the precise implementation in the libxplanemp source tree on github (look for "TCAS HACK" in the source and you'll know you're stumbling in the right direction).

 

Other than that, the known traffic state is not exported right now.

XSquawkBox - Developer/Maintainer

 

Please post any support related questions to the XSquawkBox support forum rather than private messaging me, thanks.

Link to comment
Share on other sites

Dhruv Kalra
Posted
Posted

On a semi-related note, would exporting the libxplanemp traffic state allow for X-Plane’s networking data to Foreflight to depict VATSIM traffic on the Foreflight map?

Dhruv Kalra

VATUSA ZMP ATM | Instructor | VATSIM Network Supervisor

878508.png878508.png

Link to comment
Share on other sites

Christopher Collins
Posted
Posted
On a semi-related note, would exporting the libxplanemp traffic state allow for X-Plane’s networking data to Foreflight to depict VATSIM traffic on the Foreflight map?

 

Not unless somebody else implements it. Foreflight is not a thing here (in Australia), so I certainly couldn't test it even if I was to implement the connector.

XSquawkBox - Developer/Maintainer

 

Please post any support related questions to the XSquawkBox support forum rather than private messaging me, thanks.

Link to comment
Share on other sites

Joao Cabral 1114644
Posted
Posted

Thanks for getting back. What you describe coincides with what I'm observing ... planes with strange headings hovering along runways sideways As TCAS doesn't need heading / psi, it probably doesn't get written / updated.

 

Plus on top of that planes sometimes hang or jump from one side of the airport to the other which I expect might be due to some index number changing or something caused perhaps by the TCAS Hack.

 

This is observed by monitoring sim/multiplayer/position/plane%d_lat|lon|el|psi data refs and the XPLMCountAircraft() number, which seem to stop reporting properly when xsquawkbox is in control.

 

Don't know if this needs fixing, or maybe not relying on X-Plane's AI altogether (not sure if this is even possible, but the more planes I have activated the slower X-Plane gets).

 

Other similar ATC software packages (world traffic, x-life) export their traffic with datarefs or accessors and XPLMRegisterDataAccessor and allow third party plugins to display them. If xsquawkbox could do this too and include callsign, psi/heading, timestamp (if the coordinates are not extrapolated already) and maybe speed and VS if available (although these can be calculated/extrapolated) it would allow for other plugins to extend functionality without even touching or overloading the vatsim network.

 

Writing one to export and display the data in ForeFlight would be trivial I expect, although I don't know it either.

 

Thanks for considering it! Happy to help and test it thoroughly if / when it is added.

Link to comment
Share on other sites

DAVID LOPEZ 1306565
Posted
Posted

Hello I would like to add the traffic dealers, both in p3d and X - plane 11, the a330neo a330neo model = A330 - 941, because when you selected it on the client you don't recognize me from that plane.

Link to comment
Share on other sites

Nestor Perez
Posted
Posted
Link to comment
Share on other sites

 Share