User Tools

Site Tools


pc:software:xplane11:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
pc:software:xplane11:start [2019/01/17 18:36]
dwheele [X-Plane 11 Simulator]
pc:software:xplane11:start [2020/12/05 18:22] (current)
dwheele [Using Orbx Scenery]
Line 6: Line 6:
  
 ^Manual|https://www.x-plane.com/manuals/desktop/#advancedsimulationinx-plane| ^Manual|https://www.x-plane.com/manuals/desktop/#advancedsimulationinx-plane|
 +^FMS File Format|X-Plane Native FMS format\\ https://developer.x-plane.com/?article=flightplan-files-v11-fms-file-format|
 ^OBJ File Format|This is the format that aircraft, panels, buildings, etc., are in\\ https://developer.x-plane.com/article/obj8-file-format-specification/| ^OBJ File Format|This is the format that aircraft, panels, buildings, etc., are in\\ https://developer.x-plane.com/article/obj8-file-format-specification/|
 +
 +  * [[.garming5:|Garmin G5 Emulation]]
  
 ===== NAV DATA ===== ===== NAV DATA =====
Line 36: Line 39:
  
 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'' 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''
 +
 +===== Flying J Sim 727 =====
 +
 +Purchased 727 for X-Plane 7/2020. Autopilot is unusual. Found helpful PDF:
 +
 +{{ :pc:software:xplane11:727autopilotcontrolsmore.png |}}
 +
 +{{ :pc:software:xplane11:xp11_flyjsim_727-100_guide.pdf |}}
 +
  
 ===== 3D Cockpit ===== ===== 3D Cockpit =====
Line 49: Line 61:
  
   * PlaneMaker-19-Blender-05 - Creating a simple 3D cockpit: https://www.youtube.com/watch?v=XEOLdTewxUg&t=328s   * PlaneMaker-19-Blender-05 - Creating a simple 3D cockpit: https://www.youtube.com/watch?v=XEOLdTewxUg&t=328s
 +
 +  * Better written tutorial, mostly working: https://forums.x-plane.org/index.php?/forums/topic/137897-tutorials-for-blender-279-for-x-plane-scenery-and-aircraft/
 +
 +==== Notes ====
 +
 +Finally got 3D "hello world" working by doing these steps (slightly different to [[helloworldprocess|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 ===== ===== Making custom gauges =====
Line 57: Line 81:
  
 [[xplane2blender|Xplane2Blender Notes]] [[xplane2blender|Xplane2Blender Notes]]
 +
 +Comment that is true:
 +
 +https://forums.x-plane.org/index.php?/forums/topic/114562-3d-cockpit-question-separate-instrument-objects/
 +
 +<code wrap>
 +
 + I have spent some time already doing these things, just started doing it now and then, but I have some practical knowledge.
 +
 +It is possible to make instruments in 3D. 
 +
 +For instrument objects that only have an animation(based on dataref) then they do not even have to be part of the object set as the _cockpit or _cockpit_INN. 
 +
 +Manipulators definitions must be in the cockpit object.(if you want it to work)
 +
 +For example, an altimeter could have a 3d animated needle over a textured on numbers for  hundreds.  The baro and digit readout could be made from animated from cylinders with numbers 3d "embossed" .  This could be in any object added to the plane.  However, the baro adjustment knob can be made only click/drag - able by the mouse if in  the cockpit object.
 +
 +So for objects and texturing a single x-plane object is not required for cockpit items and there are ways to get around manipulators like click/drag  transparent rectangle in the cockpit object over another appended "not cockpit" object.
 +
 +But with 4096x4096 textures, more gray could be squeezed in the texture uv space :P. for a single cockpit object. 
 +
 +</code>
 +==== 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:
 +
 +{{:pc:software:xplane11:xplanedataoutputvvi.png|}}
 +
 +This sends UDP to Connor (a Raspberry Pi), with code like this:
 +
 +<code python>
 +#!/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()
 +</code>
 +
 +**Troubleshooting**
 +
 +Had some problems because the VVI came on index [2], not [1]. I kept seeing -999 show up. Was able to see the situation by using the code up above without responding to type=4, and it dumps all of the values out, and I saw where the VVI value was located.
 +
 +Still not knowing the relationships between the type numbers and the DataRef numbers within Xplane 11.
 +
 +1/23/2019
 +
 +
 +
 +===== Changing Scenery =====
 +
 +Use XPlane Updator (''X-Plane 11 Installer.exe'')
 +
 +1/21/2019
 +
 +===== Using Orbx Scenery =====
 +
 +http://www.orbxdirect.com
 +
 +Orbx uses a "Orbx Central" app to download scenery and place it where it thinks it should be. Since I want to have one copy of the scenery, but use from multiple X-Plane instances, need to implement "Libraries." But this is just a directory where the scenery is installed, and a Shortcut is placed in the X-Plane Custom Scenery directory to point at it. Note that the Library folder directory structure is a little different than X-Plane's, so point to the right places.
 +
 +As of this writing, Orbx doesn't support very well the notion of changing where Orbx thinks the X-Plane directory is located. Helpful link: https://orbxsystems.com/forum/topic/177698-multiple-x-plane-installations/
 +
 +Using Orbx with xOrganizer: xOrganizer controls which scenery is loaded by manipulating the ini file. Since the Orbx scenery looks like all of the rest (if installed directly here, or via symbolic link (shortcut), this works.
 +
 +
 +===== Added NDB =====
 +
 +Added this to the end of user_nav.dat, located at ''X-Plane/Custom Data/user_nav.dat''
 +<code text>
 +2  33.813       -117.9              100      589    50      0.0  KDIS ENRT K1 KDIS NDB
 +</code>
 +
 +The K1 makes it think it is located in the Northwest, but this could be fixed.
 +
 +This marks Disneyland. Directions: https://forums.x-plane.org/index.php?/forums/topic/143561-add-custom-ndb/
 +
 +===== Adding Garmin 430/530 to Custom Panel =====
 +
 +Found out about how to add Garmin to custom panel from this:
 +
 +https://developer.x-plane.com/article/obj8-file-format-specification/#ATTR_cockpit
 +
 +Looks like I'll need to add a custom property from within Blender to turn on the Garmin.
 +
 +''ATTR_cockpit_device <name> <bus> <lighting channel> <auto_adjust>''
 +
 +<code text>
 +[New in 1100:] The ATTR_cockpit_device command changes the lit texture of the object to the screen of a given GPS device for an aircraft; it is legal only in aircraft-attached objects.  Use ATTR_no_cockpit when done.  Parameters:
 +
 +    Name is the device name, one of GNS430_1, GNS430_2, GNS530_1, GNS530_2, CDU739_1, CDU739_2, G1000_PFD1, G1000_MFD, G1000_PFD2.
 +    The bus is a bitfield, indicating all the electrical system bus indices (zero-based) that this device gets power from.
 +    The lighting channel is the zero-based index for the instrument lighting rheostats that control the screen’s brightness.  (Cockpit device lighting is not subject to ATTR_lit_level.)
 +    Auto-adjust is 1 if the screen brightness increases to be readable during the day, and 0 if screen brightness is “washed out” by the sun.
 +
 +The rest of the state commands affect the above published state.
 +</code>
 +
 +This goes inside of an OBJ file.
 +
 +2/12/2019
 +
  
  
pc/software/xplane11/start.1547750192.txt.gz · Last modified: 2019/01/17 18:36 by dwheele