XPlaneROS is a ROS wrapper for the XPlane-11 flight simulator.

Overview

XPlaneROS

First View

XPlaneROS is a ROS wrapper for the XPlane-11 flight simulator. The wrapper provides functionality for extracting aircraft data from the simulator and feeding control commands to control the aircraft in the simulator.
The main advantage is due to the fact that XPlane is a realistic simulator and thereby provides more realistic dynamics, responses and images.

XPlaneROS interfaces with XPlane simulator using the XPlaneConnect plugin.

Compatibility

XPlaneROS has been tested with the following systems/versions :

Ubuntu 18.04 
ROS-Melodic
XPlane-11.50
Python 3

The specs of the system are given as follows:

Processor : Intel® Core™ i7-10750H CPU @ 2.60GHz × 12 
Graphics  : GeForce GTX 1660 Ti/PCIe/SSE2
OS Type   : 64-bit
RAM       : 15.4 GiB

There's a possibility that if the system does not have enough computational power, then it can decrease the frame rate in XPlane and can lead to the system getting stuck. We noticed that the XPC interface crashes in that case.

Setup

There are three main components needed to run XPlaneRos: Xplane-11, XPlaneConnect, and ROSplane.

XPlane-11 Setup

Install the XPlane-11 simulator.

XPlaneConnect Setup

First we need to install the XPlaneConnect (XPC) plugin. Follow the steps give in the XPlaneConnect repository or in their Getting Started page.

Try to use the pre-compiled binary they provide. After following the steps mentioned in the repo, open XPlane and start a flight. If you see the plugin under the Plugin Admin, try running some of the example codes given in XPlane Connect (basicExample.py or monitorExample.py in the Python3/src folder).

If these are running you are good to go. If not, try the fixes mentioned below.

XPlaneConnect Fixes

There is a chance the plugin might not have loaded correctly. If you don't see the plugin under the Plugin Admin while running XPlane, check the Log.txt file in the XPlane-11 directory.

If you received the error dlerror:/home/ /X-Plane 11/Resources/plugins/XPlaneConnect/lin.xpl: wrong ELF class: ELFCLASS32 , this is probably an OS compatibility issue with the pre-built binaries. #151

You will need to clone the XPC repo and build yourself. Go to XPlaneConnect/xpcPlugin within the cloned repo and run the commands

mkdir build 
cd build
cmake .. 
cmake --build .

When building, if the compiler could not find bits/c++config.h file, then run the following command.
sudo apt-get install gcc-multilib g++-multilib

Building will create new .xpl files under a folder named XPlaneConnect in the build directory. Replace the old .xpl in the XPlaneConnect folder in the plugins of XPlane.

After building and replacing the .xpl, if you get the error dlerror:/home/ /X-Plane 11/Resources/plugins/XPlaneConnect/64/lin.xpl: undefined symbol: _ZN3XPC15MessageHandlers21CamCallback_RunwayCamEP20XPLMCameraPosition_tiPv , the try resolving this by adding CameraCallbacks.cpp in the CMakeLists.txt in both the add_library commands.

ROSplane Setup

Prerequisites

  1. If not already done so, install ROS (Desktop-Full is recommended).

  2. If not already done so, create a catkin workspace with catkin tools:

sudo apt-get install python-catkin-tools
mkdir -p ~/xplane_ros_ws/src
cd ~/xplane_ros_ws
catkin init

After that we will install our fork of ROSplane:

cd ~/xplane_ros_ws/src
git clone -b xplane/main [email protected]:castacks/rosplane.git 
git clone https://github.com/byu-magicc/rosflight_plugins.git
git clone https://github.com/rosflight/rosflight.git
cd rosflight/
git submodule update --init --recursive

As a sanity check, try building running the ROSplane code once along with gazebo (you may also need to install eigen_stl_containers with sudo apt-get install ros-melodic-eigen-stl-containers).

catkin build
source ~/xplane_ros_ws/devel/setup.bash
roslaunch rosplane_sim fixedwing.launch

Once Gazebo launches, you can press the "play" button in the bottom left corner, and the fixedwing should take off.

For convenience, you can add the source ~/xplane_ros_ws/devel/setup.bash statement in your ~/.bashrc file.

Now! You've checked out ROSplane and finally we're ready to move onto XPlaneROS!

XPlaneROS Setup

Installation

  1. Move to your catkin workspace:
cd ~/xplane_ros_ws/src
  1. Install system dependencies:
sudo apt-get install python-wstool python-catkin-tools
  1. Download repo using a SSH key or via HTTPS:
git clone [email protected]:castacks/xplane_ros.git # SSH
git clone https://github.com/castacks/xplane_ros.git # HTTPS
  1. Source and compile:
catkin build
source ~/xplane_ros_ws/devel/setup.bash

Running XPlaneROS

  1. Open X-Plane 11 (X-Plane 11/X-Plane_x86_64).
  2. Select New Flight.
  3. In the LOCATION panel, set the location to Butler airport (ID : KBTP) with Runway 26.
  4. Click Start Flight.

You can then start XPlaneROS with

roslaunch xplane_ros default.launch

The default.launch provides the bare-minimum structure in order to interface with XPlane. The xplane_ros_wrapper node will provide the odometry data from XPlane and it will listen to Xplane commands from the user application on the topic /xplane/my_control and then send them to XPlane.

The default.launch file also has a launch command for the rviz visualization. Uncomment that to load a .perspective file with a top down visualization of the odometry.

Troubleshooting XPlaneROS

Here we provide solutions for some issues you might encounter.

  1. eigen-stl-containers are missing :
sudo apt install ros-melodic-eigen-stl-containers
  1. Build error which says CMAKE path does not have 'rosplane'
catkin build --continue-on-failure

You might have to run this command twice

  1. module export error related to python If you're running it on Melodic using Python2.7, then try to modify the shebang in xplane_ros with this :
#! /usr/bin/env python2.7

Running XPlaneROS with ROSplane

(Assumes familiarity with ROSplane)
StateReader.py also packs data in the format needed for ROSplane and publishes that. You can run the ROSplane controller along with xplane_ros by running :

cd ~/xplane_ros_ws/src/xplane_ros
bash utils/pattern_following.sh

This will run the default.launch and xplane_fw.launch file. The plane will takeoff and start the pattern following.

In case you want to try tuning some of the control loops while following the pattern, the rqt_reconfigure will be opened by the launch file. You can tweak the parameters there.

Press the Refresh button incase you don't see anything. After that the relevant config parameters should be visible once you click on fixedwing/autopilot (for PID controls) and fixedwing/pathfollower (for vector field parameters).

Takeoff

Pattern

Tuning ROSplane Parameters

We have tuned the parameters for Cessna_172 (the default aircraft in XPlane) but feel free to try it out for other aircraft yourself.

roslaunch xplane_ros default.launch rosplane_tuner:=true

Under the rqt_reconfigure gui you should see fixedwing and xplane_ros . Click on both of them.
The fixedwing setup contains the dynamic reconfigure for rosplane parameters. The nomenclature should be obvious once you take a glance at the params and cfg files provided in rosplane. Those are the tuning parameters for the PID loops implemented in rosplane.

The xplane_ros portion of the gui provides a kind of easy-to-use interface for you to give certain commands and see the response.
For example, suppose you want to tune the roll attitude parameters. Tick the hold_roll box and untick the other boxes. This means that the autopilot_tuner node will ignore all the other commanded values and will only run the roll_hold() function to set the current phi to phi_c. You can set the value for phi_c using the roll_step in the rqt_reconfigure gui.
In the rqt_plot you will be able to visualise the commanded roll, current roll and also the aileron commands output by the roll_hold() function.

NOTE : The control surfaces correponding to the unticked boxes will be defaulted to what it was just before you unticked them.

Henceforth, you should be able to experiment with other control loops like pitch, heading, throttle, etc (each corresponding to a function in controller_base.cpp and controller_example.cpp in rosplane).

For some more idea about what each code does, head over here.

Citation

@misc{baijal_patrikar_moon_scherer_oh_2021,
  title={XPlaneROS : ROS Wrapper for Autonomous Fixed Wing Applications},
  url={https://kilthub.cmu.edu/articles/software/XPlaneROS_ROS_Wrapper_for_Autonomous_Fixed_Wing_Applications/16589924},  
  publisher={Carnegie Mellon University},
  author={Baijal, Rohan and Patrikar, Jay and Moon, Brady and Scherer, Sebastian and Oh, Jean},
  year={2021},
  month={Sep},
  DOI={10.1184/R1/16589924}
}
Owner
AirLab Stacks
Open Source software from the AirLab (Robotics Institute, Carnegie Mellon University)
AirLab Stacks
This is a simple game made using pygame.

Ball breaker This is a simple game made using pygame game view The game view have been updated wait for the new view to be uploaded Game_show.mp4 Lear

Rishikesh Kumar 3 Nov 05, 2021
This is a basic virtual quiz game using opencv-python

Basic Virtual-Quiz-Game This is a basic structure of a virtual quiz game using opencv-python. As the camera window opens up we can see the questions a

2 Dec 11, 2021
Tic tac toe game developed by naman in python

TIC TAC TOE GAME DEVELOPED BY NAMAN IN PYTHON . IT USES MINMAX ALGORITHM TO COMPETE IN DIFFICULTY MODE

Naman Anand 4 Jun 24, 2022
DOTD - A murder mystery game made in Python

DOTD This repo holds the files for my video game project from ENG101, Disaster o

Ben Bruzewski 1 Jan 13, 2022
This is a two player snake game

Trake This is a two player snake game How to play the game There is food and two players. You try to eat food to become large and gain points. Player

Grrub 1 Dec 19, 2021
Memory game in Python

Concentration - Memory Game Concentration is a memory game written in Python, inspired by memory-game. Description As stated in the introduction of th

Marco Colonna 0 Jul 21, 2022
Krieg is a Python package for a general game framework.

Krieg Krieg is a Python package for a general game framework. It provides base classes for implementing simple games. Some example games are already i

Juho Kim 2 Jan 06, 2022
learn and have fun developing 2D retro games using python and pygame

Retro 2D Game Development Using Python + PyGame Skill up your programming skills with a walk down the memory lane. Learn how to create a retro 2D game

Marvin Trilles 1 Feb 23, 2022
Tictactoe py tkinter canvas - Tic Tac Toe written in Python 3 with tkinter mainly using canvas

Python 3 Tic Tac Toe with tkinter This is a tkinter version of my Tic Tac Toe ga

Bojan Adzic 1 Jan 09, 2022
Pygame Raycaster made by me.

Pygame Raycaster made by me.

Sable 0 Jan 10, 2022
Tic-Tac-Toe Game in python3 Tkinter

Tic Tac Toe Tic-Tac-Toe Game in python3 Tkinter About: Tic Tac Toe or Noughts and Crosses as called in British is a pencil and paper game for two play

Sai Swarup Yakkala 5 Nov 06, 2022
Un semplice Snake game , come negli anni 90!

Project-SnakeGame Un semplice Snake game , come negli anni 90! ITA VI porto un semplice giochino per i nostalgini degli anni 90 , ispirato al vecchio

Matt K Lawrence 1 Oct 17, 2021
Magic: The Gathering Arena draft tool that utilizes 17Lands data

MTGA_Draft_17Lands Magic: The Gathering Arena draft tool that utilizes 17Lands data. Steps for Windows Step 1: Download and unzip the MTGA_Draft_17Lan

41 Dec 31, 2022
The DOS game from the 80s re-written in Python from Scratch!

Drugwars The DOS game from the 80s re-written in Python from Scratch! Play in your browser Here Installation Recommended: Using pip pip3 install drugw

Max Bridgland 45 Jan 03, 2023
Disables the chat in League of Legends for Windows.

Disables the chat in League of Legends for Windows. If you simply can't stop yourself from typing LeagueStop will play KEKW.mp3 each time you try. The sound will stack & becomes horribly annoying.

1 Nov 24, 2021
A fun discord bot for music, mini games, admin controls, economy, ai chatbot and levelling system

A fun discord bot for music, mini games, admin controls, economy, ai chatbot and levelling system. This bot was specially made for Dspark discord server.

2 Aug 30, 2022
Gamelib is a pure-Python single-file library/framework for writing simple games.

Gamelib is a pure-Python single-file library/framework for writing simple games. It is intended for educational purposes (e.g. to be used in b

Diego Essaya 15 Dec 22, 2022
Wordle-helper: python script to help solving wordle game

wordle-helper This is a python script to help solving wordle game 5-letter-word-

MD Nur Ahmed 2 Feb 08, 2022
HackNC 2021 Project

pyTunes HackNC 2021 Project Setting Up Once the repo is cloned, install the requirements through pip install -r ./requirements.txt Once that is done,

Demo 1 Nov 07, 2021
This a secret santa game organizer that assigns secret santa randomly to each participant and then sends an automated mail to each santa with details of his/her secret santa child.

Before executing the script, make sure to turn on 'Less Secure App access' option from your gmail ID that will be used to send out the mails to all participants of the game. To do so, get going with

DEV_FINWIZ 10 Dec 06, 2022