use P3D wgs84 and nav data base with external sim

Post your feature requests here. Note that we cannot promise that any of these posts will be commented on or that requested features will be implemented.
Post Reply
castle
Posts: 14
Joined: Wed Apr 20, 2011 8:40 pm

use P3D wgs84 and nav data base with external sim

Post by castle »

Hi,

I'm running a full scale 737 cockpit with a 180 degree collimated mirror system. The external sim is open source JSBSim and a real time Linux for the 737 displays and hardware. Using the LinuxSimulationIntegration package to send position and 6DOF state data to P3D to run the visual system.

ATM using WGS84 and navigation databases on the Linux side provided by the FlightGear open source project which differ to varying degrees with the data provided in the P3D version5.3 package.

Have developed two SimConnect apps ( called nvcomm and p3dto737 ) which send nav/radio instructions from the 737 pedestal control panels and FMC to select nav fixes, radios, OBS values, and such and the second to return the avionics SimVars and such to drive the glass cockpit displays and MCDUs with navigation info. Was planning and hoping to use the P3D side to stay in sync with what the OTW was displaying. Problem is most apparent when operating in and around airports with departures and arrivals.

I'm assuming that all the calculations of positions, distances, orientation and such are done in P3D based on the lat/lon position and irrespective of the aircraft model. However, the problem I'm seeing is that sending avionic commands, say to a Mooney model, returns the appropriate nav info, but when the same commands are sent when the LinuxSimulation package is running the various SimConnect functions appear to be received but no nav info is returned in the datagram, just all zeros which seems to indicate there is no path through the Linux and iSimpleAirplane and/or no avionics objects created when these models are used.

Question? Is it the responsibility of the aircraft modeler to create the appropriate modules? In examining the various models and config files provided by LM was unable to discern any such references other than some window/camera details calling out settings for such displays.

If there is something in the SDK manual, would you please point me to the reference. Or perhaps something to consider as a feature detailing the addition of avionics and hooks into the P3D geo and nav databases and creation of such a module.

BTW, as an aside. I've been working with the folks at the National Air Museum of World War II located at the Colorado Springs airport, Bill the founder and Director has access to an old B-25 cockpit shell and we've been exploring the idea of a simulator based on the design of my 737 but modeling a B-25. If there is any interest within your LM facility up the road from us would love to meet and chat regards the project.

Cheers
John
Clifton Crane
Lockheed Martin
Posts: 1207
Joined: Tue Sep 25, 2012 2:34 pm

Re: use P3D wgs84 and nav data base with external sim

Post by Clifton Crane »

Hi John,
However, the problem I'm seeing is that sending avionic commands, say to a Mooney model, returns the appropriate nav info, but when the same commands are sent when the LinuxSimulation package is running the various SimConnect functions appear to be received but no nav info is returned in the datagram, just all zeros which seems to indicate there is no path through the Linux and iSimpleAirplane and/or no avionics objects created when these models are used.
The main difference between the Mooney Bravo and SimpleAirplane sample is the former is a native Airplane simulation, whereas the SimpleAirplane is a custom ISimObject. The Mooney Bravo would have access to the simulation variables listed in the Learning Center, but the SimpleAirplane will register it's own set of custom properties specific to its simulation.

There are simulation variables available to both the native SimObject's and custom ISimObjects. This would include radio systems and weapons systems for example. The ISimObject would need the appropriate configuration entries for this to be possible (i.e. [radios] entry in sim.cfg, or Attachments.xml for weapons systems). You can also access world position and velocity from either object using the appropriate simulation variables. However, since the ISimObject implements it's own set of properties, you will not have access to the native aircraft specific simulation variables such as landing gear or flaps.

Custom ISimObjects can also override the default simulation variables, but would still need to implement the underlying simulation. For example, an ISimObject could register GEAR HANDLE POSITION, which could be useful if a plugin or gauge need to query a variable from a native or custom simulation.

Regards,
Clifton
Clifton Crane
Prepar3D® Software Engineer Sr.
castle
Posts: 14
Joined: Wed Apr 20, 2011 8:40 pm

Re: use P3D wgs84 and nav data base with external sim

Post by castle »

HI,

Thank you, Clifton for the info. Still not quite there yet,

Have a two small SimConnect apps that send nav/comm commands over a network and return the nav data. Runs on either windows or linux. But it still refuses to run with the Linux simulation. Start P3D and select the Mooney aircraft ( or any aircraft from the SimObject folder for that matter ), start the app from a windows console and everything works just fine. Send command from the 737 to change freqs, obs's, etc and all sorts of nav data is sent back to the 737. Fly the Mooney and position, bearings, dme's from both VORs do just fine. Can also tune the VHF radios to ATIS, tower, ATC freqs and get P3D voice. Try the same with the Linux Sim with an updated .cfg file that also contains the [RADIOS] section and get a SimConnect exception error at start and while network selected client events are honored with the Mooney, with the Linux Sim the event ID is acknowledge but no action occurs with the SIMCONNECT_TRANSFER_CLIENT_EVENT( ... ).

Upon startup with the Mooney, the call back procedure reports with SIMCONNECT_RECV_ID (dwID=2) and the Linux SIm reports (dwID=1) an exception error which I've not quite identified, have an exception case statement in the callback SIMCONNECT_RECV_ID_EXCEPTION but don't fully understand or trust the result. Working my way through the various data structures called out in simconnect.h. Are there any sample apps demonstrating exception handling?

I''ll forgo inserting any code since ti works with the Mooney. My best guess is something is still amiss with the global and custom properties that is throwing the exception when starting the network interface under the Linux Sim.

An interesting aside, after starting select the Mooney aircraft, close the network app and restart it and the Mooney radios work just fine, go back and reselect the Linux Sim from the menu and now the radios also work, but now positional and aircraft attitude inputs do not. Again something to do with the binding of native versus custom variables that I need to get my head around. Any suggestions, thoughts would be most welcome.

Thank you again for the help
John
Post Reply