User Tools

Site Tools


Sidebar

Dan's Wiki

DokuWiki Instructions (local) DokuWiki Manual
Site Checker (Orphans Wanted)

Edit Sidebar

pc:software:xplane11:start

This is an old revision of the document!


X-Plane 11 Simulator

Purchased today, 12/29/2018, to understand it for the possibility to turn it into a hardware simulator for an A-4.

It is commercially licenseable for $750 which can make it FAA certifiable, but that is not our current intent.

Since I recently paid for one month of a Navigraph subscription, I downloaded the Nav Data for X-Plane 11 as well and placed it in Xplane→Custom Data as earth-awy.dat, eath_fix.dat, earth_nav.dat, and CIFP directory of SID/STAR info per airport. Also downloaded a file from the FAA - *FAACIFP18* and placed it in the same directory.

Right now, thinking of doing hardware work with a A-4 simulator, turning it into a very fancy Joystick, using Raspberry Pi with a possible servo controller board. X-Plane can communicate via UDP with it.

- 12/29/2018

Frame Rate

Tried this procedure to fix a frame rate which is about 17 - 19.

https://www.x-plane.com/kb/frame-rate-issues-windows-10/

Purchased new GTX1060, now rates are closer to 30 even with features turned on, second monitor.

1/1/2019

B737-800 Ultimate

Downloaded improved B737 from here: https://forum.thresholdx.net/topic/201-download-links-license/

Sim reported CORRUPTED NAVDATA. Found solution here: https://forums.x-plane.org/index.php?/forums/topic/167034-latest-navigraph-airac-causes-error-in-zibo-mod/ (modified file at X-Plane 11/Aircraft/Extra Aircraft/B737-800X/plugins/xlua/scripts/B738.fms/B738.fms.lua, adding additional rows to the NavData date ranges, and changing to cycle_n = 31

3D Cockpit

To make a 3D Cockpit, you use blender to make a cube, with normals pointing in. Transparent places become windows. Then the cube needs to be exported using the Xplane2Blender plugin to make an OBJ file which X-Plane 11 can read.

It is possible that the layers in Blender cause different detail:

 The purpose of layers 1-3 is LOD (Level of Detail). If you tap into LOD functionality,
  layer 1 will have full detail, layer two will contain medium detail (for medium 
  distances from object), and layer 3 will have low detail. [Per YouTube video comment]

Notes

Finally got 3D “hello world” working by doing these steps (slightly different to these instructions:

  • Create cube with normals pointing in.
  • Exported as OBJ file with XPlane2Blender to the folder like this: <airplane>/cockpit_3d/-PANELS-/Cockpit.obj
  • Also included in the same folder a file Panel_Military.png which is the same size as the texture png.
  • Texture png (only one allowed) is in the same directory. It is referenced to inside of the Cockpit.obj file.

Making custom gauges

LUAA language which makes it easier to automate gauges, other purposes
https://forums.x-plane.org/index.php?/files/file/35579-flywithlua-core-edition-for-x-plane-11-windows-linux-mac-os-x-version/
Air ManagerPayware functionality to make 2D Steam gauges and to host gauges in panels. Pi version available.
https://www.siminnovations.com/index.php?option=com_content&view=article&id=3
Xplane2BlenderPython addon to Blender which can export in proper format for X-Plane
(Apparently requires Blender 2.79 or earlier, docs say X-Plane 11 ready
https://forums.x-plane.org/index.php?/forums/topic/127522-xplane2blender-v340-beta1-is-out/
Manual https://der-on.gitbooks.io/xplane2blender-docs/content/v3.4/34_installation.html
Developer Info (Wiki): https://github.com/der-On/XPlane2Blender/wiki

Xplane2Blender Notes

Servo Demo

Was successful in creating a set up so that a servo followed the VVI (Vertical Velocity Indicator, a.k.a. Vertical Speed Indicator) value from X-Plane.

In X-Plane, set up like this:

This sends UDP to Connor (a Raspberry Pi), with code like this:

#!/usr/bin/python3
 
# Example how to receive UDP Data from X-Plane 10 in Python3.
 
# License:
# 1) GPLv3
# 2) Consider it as programmer documentation, so you are free to copy some lines ignoring the License.
 
# Configure Data-Output types 3, 17 and 20
# and the IP where the python script is running (port 49000) in X-Plane.
 
UDP_PORT = 49002
 
import socket
import struct
import binascii
from adafruit_servokit import ServoKit
kit = ServoKit(channels=16)
 
def DecodeDataMessage(message):
  # Message consists of 4 byte type and 8 times a 4byte float value.
  # Write the results in a python dict.
  values = {}
  typelen = 4
  type = int.from_bytes(message[0:typelen], byteorder='little')
  data = message[typelen:]
  dataFLOATS = struct.unpack("<ffffffff",data)
  if type == 3:
    values["speed"]=dataFLOATS[0]
    print("hexlify: ", binascii.hexlify(data))
    print("length 3: ", len(data))
  elif type == 4:
    values["mach"]=dataFLOATS[0]
    values["vvi"]=dataFLOATS[2]
    # print("hexlify: ", binascii.hexlify(data))
    # print("b2a_uu: ", binascii.b2a_uu(data))
    # print("length 4: ", len(data))
    toPlot = 0
    vvi = float(values["vvi"])
    if vvi > 1000:
         vvi = 1000
    elif vvi < -1000:
         vvi = -1000
    toPlot = 90 - vvi * 80 / 1000
    kit.servo[0].angle = toPlot
 
  elif type == 17:
    values["pitch"]=dataFLOATS[0]
    values["roll"]=dataFLOATS[1]
    values["heading"]=dataFLOATS[2]
    values["heading2"]=dataFLOATS[3]
  elif type == 20:
    values["latitude"]=dataFLOATS[0]
    values["longitude"]=dataFLOATS[1]
    values["altitude MSL"]=dataFLOATS[2]
    values["altitude AGL"]=dataFLOATS[3]
    values["altitude 2"]=dataFLOATS[4]
    values["altitude 3"]=dataFLOATS[5]
  else:
    print("  Type ", type, " not implemented: ",dataFLOATS)
  return values
 
def DecodePacket(data):
  # Packet consists of 5 byte header and multiple messages.
  valuesout = {}
  headerlen = 5
  header = data[0:headerlen]
  messages = data[headerlen:]
  if(header==b'DATA*'):
    # Divide into 36 byte messages
    messagelen = 36
    for i in range(0,int((len(messages))/messagelen)):
      message = messages[(i*messagelen) : ((i+1)*messagelen)]
      values = DecodeDataMessage(message)
      valuesout.update( values )
  else:
    print("Packet type not implemented. ")
    print("  Header: ", header)
    print("  Data: ", messages)
  return valuesout
 
def main():
 
  # Open a Socket on UDP Port 49000
  UDP_IP = ""
  sock = socket.socket(socket.AF_INET, # Internet
                       socket.SOCK_DGRAM) # UDP
  sock.bind((UDP_IP, UDP_PORT))
 
  while True:
    # Receive a packet
    data, addr = sock.recvfrom(1024) # buffer size is 1024 bytes
 
    # Decode the packet. Result is a python dict (like a map in C) with values from X-Plane.
    # Example:
    # {'latitude': 47.72798156738281, 'longitude': 12.434000015258789,
    #   'altitude MSL': 1822.67, 'altitude AGL': 0.17, 'speed': 4.11,
    #   'roll': 1.05, 'pitch': -4.38, 'heading': 275.43, 'heading2': 271.84}
    values = DecodePacket(data)
    print(values)
    print()
 
if __name__ == '__main__':
  main()

Changing Scenery

Use XPlane Updator (X-Plane 11 Installer.exe)

1/21/2019

pc/software/xplane11/start.1548279229.txt.gz · Last modified: 2019/01/23 21:33 by dwheele