Code Monkey home page Code Monkey logo

realsimgear's Introduction

RealSimGear X-Plane Plugin for Linux

About the Plugin

What it is

This plugin maps input controls of RealSimGear flight simulator devices to X-Plane simulator commands.

What it is not

This plugin doesn't help you detaching simulator windows and automatically placing them onto the screen of your flight simulator device.

Showcase

Installation

The following software is required:

  • GCC C Compiler
  • GNU make
  • Lua 5.1

To build the plugin, open a terminal and just type make in the root directory of this repo. You will find the compiled plugin at build/realsimgear/64/lin.xpl

Copy the plugin to you X-Plane folder.

$ cp -r build/realsimgear "/opt/xplane/X-Plane 11/Resources/plugins/"
$ cp realsimgear.lua "/opt/xplane/X-Plane 11/Resources/plugins/realsimgear/"

We assume X-Plane is installed at /opt/xplane/X-Plane 11. Replace the path according to your installation location.

Usage

Before flying, you need to configure the plugin according to your flight simulator setup. The configuration is done in the file realsimgear.lua. The configuration already contains samples for all supported devices. You just need to insert the device file paths for the simulator devices you want to use.

The configuration consists of the Lua list devices containing a table for each simulator device.

devices =
{
  -- G1000: Pilot PFD
  {
    device = "/dev/ttyACM0",
    mapping = {} -- Insert mapping here
  },

  -- G1000: Co-Pilot PFD
  {
    device = nil,
    mapping = {} -- Insert mapping here
  },

  -- G1000: MFD
  {
    device = nil,
    mapping = {} -- Insert mapping here
  },
}

Each devices has the following attributes:

  • device: the linux device path
  • mapping: maps the input actuators to X-Plane commands

Just insert the path of the serial device file of your simulator device into the relevant block. If device evaluates to nil, this device is considered disabled. So you don't need to delete the devices blocks which are not applicable for you.

Each time you push a button or turn a knob on your simulator device, a specific control string is sent via the serial device. This string has to be mapped to a X-Plane command. You will find a list of available simulator command at https://www.siminnovations.com/xplane/command/. This mapping is done with the mapping-attribute, which is itself a Lua table.

This is a sample mapping for a G1000 primary flight display (pilot side of the) cockpit. Not all mappings are shown here for reason of simplicity.

devices =
{
  -- G1000: Pilot PFD
  {
    device = "/dev/ttyACM0",
    mapping =
    {
      ["ENC_NAV_VOL_DN"]   = "sim/GPS/g1000n1_nvol_dn",
      ["ENC_NAV_VOL_UP"]   = "sim/GPS/g1000n1_nvol_up",
      ["ENC_COM_VOL_DN"]   = "sim/GPS/g1000n1_cvol_dn",
      ["ENC_COM_VOL_UP"]   = "sim/GPS/g1000n1_cvol_up",
      ["BTN_NAV_VOL"]      = "sim/GPS/g1000n1_nvol",
      ["BTN_NAV_FF"]       = "sim/GPS/g1000n1_nav_ff",
      ["ENC_NAV_INNER_UP"] = "sim/GPS/g1000n1_nav_inner_up",
      ["ENC_NAV_INNER_DN"] = "sim/GPS/g1000n1_nav_inner_down",
      ["ENC_NAV_OUTER_UP"] = "sim/GPS/g1000n1_nav_outer_up",
      ["ENC_NAV_OUTER_DN"] = "sim/GPS/g1000n1_nav_outer_down",
      ["BTN_NAV_TOG"]      = "sim/GPS/g1000n1_nav12",
      ["ENC_HDG_UP"]       = "sim/GPS/g1000n1_hdg_up",
      ["ENC_HDG_DN"]       = "sim/GPS/g1000n1_hdg_down",
      ["BTN_HDG_SYNC"]     = "sim/GPS/g1000n1_hdg_sync",
      -- further mappings
    }
  },

  -- more devices
}

A G1000 MFD would send the same control strings, because it uses the same hardware with the same actuators. But they actions to be performed are different und thus have to be mapped to diffent simulator commands. In our case the term g1000n1 has just to be replaced by g1000n3 to route all input events to the MFD instead of the pilots PFD.

Miscellaneous

Disclaimer

This plugin is not officially linked to RealSimGear. It's was founded by a user of the hardware independently from the vendor. Thus it comes without warranty.

Limitations

The configuration of your input devices is global. Currently there is no way to define profiles for different aircrafts. You have to edit the configuration file by hand each time you alter you simulator setup, for example when changing between a C172 with a GNS430 and and one equipped with a G1000.

If you use multiple devices, please ensure the device paths are stable. You can ensure this by plugging in the devices in a fixed order.

Currently the following devices are supported:

  • G1000 XFD

Virtually no modification of the plugin should be necessary to support other devices. The configuration file just needs to be extend. Please contact me if you own an unsupported device.

realsimgear's People

Contributors

hamarituc avatar jo5ef avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

ch166 jo5ef dx9s

realsimgear's Issues

G1000 MFD causes crash

Great Plugin! I have a RSG G1000 Gen2 Suite (PFD, Audiopanel, MFD) and both the PFD and the Audiopanel work great. When using any button on the MFD however, X-Plane crashes with

PANIC: unprotected error in call to Lua API (attempt to index a nil value)

I'm using the mapping file you provided and configured the devices /dev/ttyACM0 and /dev/ttyACM1. Using cat /dev/ttyACM0 and cat /dev/ttyACM1, I verified that the commands are sent properly from the hardware. I'm on Fedora 37, X-Plane 12.04b3.

Any idea?

G1000 XFD not enumerating as /dev/ttyACM0

Are there additional instructions for installing the G1000 XFD on linux?
The build and installation to X-Plane 11 works, but it is not connecting to the display.
Running Ubuntu 22, the device is listed under lsusb but I am not seeing any additional /dev/tty* devices when I plug it in. Does the display require specific drivers to work with Ubuntu?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.